Commit Graph

6 Commits

Author SHA1 Message Date
ccfddcc09a Conlang: Add range operators
TODO: Limit range operators to at most 2 operands
2023-10-22 18:30:00 -05:00
b5abd2bff1 Lexer rewrite:
- Scan the input string *linearly*, without backtracking
  - Peek at most one character (unicode code-point) ahead
- Store data (unescaped string literals and chars, identifiers, integers, floats) inside Token
  - This unfortunately makes tokens non-Copy
- Refactor Parser to accommodate these changes
  - On the bright side, Parser no longer needs a reference to the text!
- Write a new set of lexer tests
  - TODO: write a new set of token tests using tokendata

Every day, we get closer to parsing `dummy.cl`!
2023-10-22 18:28:20 -05:00
feb5cc5dd0 AST: Refactor binary operations, fix Walk trait
- Unified math operations into a single self-referential enum
- Walk now visits the children of a node, rather than the node itself
  - The old behavior was super confusing, and led to numerous stack overflows.
2023-10-21 12:24:52 -05:00
a26a01fc17 constr: Misuse iterators to parse tokens 2023-10-20 15:33:02 -05:00
7f7393d2c6 conlang: Grammatical cleanup; merge control flow expressions 2023-10-19 14:40:03 -05:00
59617d805a parser: Move module into file 2023-10-17 13:36:21 -05:00