Commit Graph

14 Commits

Author SHA1 Message Date
fc3cbbf450 Conlang v0.0.5: Pratternization
cl-token:
- Minimize data redundancy by consolidating TokenKind::Literal; TokenData::{String, Identifier}
- Rename Op to Punct

cl-ast:
- Remove ExprKind::{Member, Call} in favor of making them
'binary' operators
- Consolidate boxes (TODO: consolidate more boxes)
- Remove repetition vecs in favor of boxes (this may come with performance tradeoffs!)

cl-lexer:
- Reflect changes from cl-token

cl-interpret, cl-repl/src/examples:
- Reflect changes from cl-ast

cl-parser:
- Switch to Pratt parsing for expressions
  - TODO: Code cleanup
  - TODO: Use total ordering for Precedence instead of binding powers (that's what the binding powers are there for anyway)
- Switch functional parsers to take Punct instead of TokenKind
  - It's not like we need a `for`-separated list
- Remove `binary` macro. No longer needed with precedence climbing.
- Repurpose `operator` macro to produce both the operator and the respective Precedence
- Remove several of the smaller parser functions, since they've been consolidated into the larger `exprkind`
2024-04-13 03:33:26 -05:00
2c36ccc0cf cl-parser: Misc. cleanup 2024-04-13 03:02:54 -05:00
265db668ed cl-parser: Reword an error message 2024-04-13 02:57:29 -05:00
290ede2fa3 cl-token: Break operators into their own separate enum, to make future pratt parsing easier 2024-04-12 16:20:24 -05:00
2091cce570 cl-token: Rename Type to TokenKind, Data to TokenData to match the project's general style 2024-04-12 14:36:26 -05:00
902494e95a cl-token: Merge token_type::Type and token_type::Keyword into a single enum 2024-04-12 14:25:49 -05:00
614d20ea2c cl-parser: parse enums + enum variants 2024-04-01 04:28:30 -05:00
7b40ddc845 cl-ast: destination side of type alias should be an identifier 2024-04-01 04:20:26 -05:00
8ee318f26b cl-ast: Move ExprKind::Assign outside the box, to be more consistent with other uses of Expr 2024-03-28 16:34:24 -05:00
c665e52782 all: #![warn(clippy::all)] 2024-02-29 21:04:45 -06:00
50b473cd55 cl-lexer: Move lexer into its own crate 2024-02-29 20:58:50 -06:00
abf00f383c cl-parser: Move inline modules out of line 2024-02-29 20:44:49 -06:00
ab17ebbadc cl-parser: break parser into inline module 2024-02-29 20:43:40 -06:00
cc281fc6ab cl-parser: Move parser into its own crate 2024-02-29 20:41:07 -06:00