Git Product home page Git Product logo

pepper's People

Contributors

bocajnotnef avatar cyndyishida avatar nahumj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pepper's Issues

Make the tests assert against objects instead of strings of output

We have the power of python, we should be asserting against the objects and not the string representations of the objects

  • Make unit tests

Detail: We can actually hand individual hunks of code to the parser to see what it does with them, and then assert against the object it hands back. This would be useful for testing individual lumps, and not just testing the output of the program.

Implement #if operator

requires evaluating truthyness of arithmetic expressions

also we have to parse/evaluate arithmetic expressions

Implement system level compiler tests

Add subprocess'd tests to run the compiler against preprocessed code to make sure we're nailing all the things we need to nail to be an actual preprocessor

  • find out how to disable preprocessing in whatever compilers we're testing
  • make sure the compilers we're testing will run on Travis

Need profiling and performance regression tests

This would probably matter more when we get to our milestone, but it would be good if we monitored performance so we don't accidentally triple our runtime at some point.

Should be fairly simple: either subprocess 'time' a bunch of runs, or use python's own time profiling monitors; run a few hundred rounds of the preprocessor, take the average and assert it's below a certian range.

We could make it CI-only so it doesn't clog the normal make test call.

enforce flake8 on master

diff-quality only checks the diff of the commits....against master, which is bad if you're committing directly to master.

Update all copyright headers

Will likely require a short code freeze, since it'll modify the top of a lot of files and break git change tracking

sanitize the crap out of the parser

there's a lot of shift/reduce warnings coming out of the parser, should fix thise

  • delete the parsetab.py file from the src/pepper folder
  • run the preprocessor in debug mode on your favorite file
  • resolve problems manually in the parser source

expand macros with argument lists

followup to #25, now we need to make function-like macros that can take arguments for their expansions (since these are the actually interesting macros).

This will require changes to the lexing and parsing structure, probably.

Recursively expand macros

we have to re-scan expanded macro lines to detect if they contain additional macros, and expand them accordingly.

this should be (relatively) trivial after #17--we can now just take the output line and shove it back into the preprocessor if we expanded a macro in the last expansion.

Will add more complexity and side effects to the preprocessor module, should refactor later.

Lessen restriction on test coverage

We keep running into problems where the test coverage is slightly below 100% generally due to impossibilities/weirdness in the coverage.

I've started ignoring the CI status, which is terrible, so I think I'm gonna lessen the coverage restriction to 95% or somesuch.

type-hint as much of the preprocessor as possible

  • implement mypy static checker into make test and TravisCI testrunner
  • type as much of the library as can be reasonably typed
  • update docs/procedures to include typing in code review?
  • will enjoy enhanced autocomplete suggestions
  • enforcing expectations on programs
  • safer code

Actually preprocess things

Currently there's a preprocess method on all the nodes that does nothing

Prereqs: Needs design of how to talk to a compiler

make test utility functions

  • 'load this example output file'
  • constants for the example output files
  • make tests use subprocess.run instead of subprocess.popen

Redefine grammers for statements and expressions

  • parse structure is currently set up where it incorrectly labels expressions
    -i.e "#if x" is a statement and not a expression, the only expression is x, and the naming convention is incorrect
  • find ways to condense safe_code_expr, code_expr, and valid_expr
  • condense/fix whitespace around directives
  • change abstract symbol tree to abstract syntax tree
  • currently, if & if def has a stack of tuples where the value at index[0] has either the name of the macro for ifdef, and the if count number for the if directive. Needs to be refactored out

Macro expansion no arg error

Currently if we define an Macro with empty parentheticals, it crashes when we try to call it
i.e.

#define M() 1

int main()
{
#if M()
std::cout <<"call to with parentheses" << std::endl;
#endif

    return 0;
}

returns pepper.symbol_table.PepperSyntaxError: Macro M expects args, but was given none.

but should be valid

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.