Commit Graph

17 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
fa51f14db5 Remove collect-identifiers example 2024-04-13 02:54:30 -05:00
4a52d2bc6a conlang: Update type checker
- cl-typeck: Add modules, intrinsic types, unify definition ids
- cl-ast: make attribute lists `Default`
- cl-structures: Add functions to iterate through a pool
- cl-repl: Create an example REPL for the type checker
2024-04-01 05:14:06 -05:00
9f9a21b4c3 cl-repl: Add example that prints the AST in a more friendly way than Debug but in a more verbose way than Display 2024-03-27 01:24:28 -05:00
2eade74d3a cl-repl: Terminal pipe support + fun stylistic fixups 2024-03-01 05:33:35 -06:00
1eec1b06ce cl-ast: Move matched brace indenter out of ast_impl (it doesn't impl the ast) 2024-03-01 02:44:35 -06:00
d7604ba039 cl-repl: restructure for future improvements. Replaces temporary handrolled argument parser with external dependency argh.
TODO: Rewrite `argh` in Conlang :^P
2024-03-01 02:35:58 -06: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
cc281fc6ab cl-parser: Move parser into its own crate 2024-02-29 20:41:07 -06:00
1afde9ce35 cl-ast: Move AST definition into its own crate 2024-02-29 19:49:50 -06:00
6e1d5af134 cl-token: Move token definition into its own crate 2024-02-29 19:36:06 -06:00
69f5035a8b span: Break out into its own crate, to make room for future expansion 2024-02-29 18:31:41 -06:00
362817e512 cl-repl: fix doctest in repline::ignore 2024-02-29 17:52:16 -06:00
421aab3aa2 interpreter: Break out into a separate crate
My editor's performance was tanking because of macro interpreter::builtins::builtin!

Temporary solution: move the interpreter into a separate crate

If I intended to keep the interpreter around, in the long-term, it might be an idea to make a proc-macro for builtin expansion.
However, the only reason I need the macros is because the interpreter's dynamic typing implementation is so half-baked. After I bang out the new type checker/inference engine, I'll have to rewrite the entire interpreter anyway!
2024-02-29 17:51:38 -06:00
e9dc8a7e32 cl-repl: hack together some temporary file loading, to aid in standard library development 2024-02-28 06:02:00 -06:00
862d81a9d4 cl-repl: Rename from cl-frontend.
Also disable escape code printing when debug assertions are off
2024-02-28 05:32:10 -06:00