joncatanio / cannoli

Cannoli Programming Language
MIT License
771 stars 20 forks source link

Add lots of error checking to parser. #4

Closed joncatanio closed 6 years ago

joncatanio commented 6 years ago

In the parser's current state there are not very helpful error messages. The parser operates completely fine on functioning code but doesn't make many validation checks like those found in the CPython parser. These need to be updated as much as possible.

joncatanio commented 6 years ago

Updated error checking places with get_token_expect().

joncatanio commented 6 years ago

Write validation() functions that take in AST nodes or Tokens and do the validation subsequently returning the passed in parameter.

joncatanio commented 6 years ago

mod.rs should have all the panic!() calls replaced. A ParserError should be bubbled up to main where the error is handled and the program can be exit with an error code.

joncatanio commented 6 years ago

see 1f18e0c did a pretty big refactor that covered a bunch of ground in terms of error handling. Closing this task because at this point it'll be easy to add any errors that aren't currently caught.