5484d96e7dast: Add the "Self" type in preparation for cl-typeckJohn2024-02-27 22:48:24 -06:00
e3f08ac013parser: Overhaul the semi-functional Parser::{delimited, separated, repeated} methods into real higher-order functionsJohn2024-02-27 22:46:36 -06:00
978f5e40c1conlang: Introduce type-alias/typedef syntax type T; | type T = U;John2024-02-27 20:49:02 -06:00
0c1b3bfe39ast: Do not promise PartialOrd/Ord (breaking change)John2024-02-27 20:41:15 -06:00
c36eec216aparser: Allow StmtKind to parse itself (whoops!)John2024-02-26 16:03:18 -06:00
66deb41301grammar.ebnf: Sync changes with ASTJohn2024-02-26 16:02:36 -06:00
9bde97942cast: Enum variants can have no data, or have an associated integer.John2024-02-26 15:59:15 -06:00
bb3eecd190interpreter: Allow statements to choose their own return value (reduces code duplication)John2024-02-26 15:53:45 -06:00
ffa313eea8ast: Allow type specifier in let statementJohn2024-02-26 15:49:55 -06:00
490d320633parser: allow end of input in binary and indexing operations. This improves robustness and correctness of implementation.John2024-02-26 15:37:07 -06:00
13995259aaparser: use different wording when the expected value was an operator vs an expressionJohn2024-02-26 15:35:07 -06:00
ae76df9c83interpreter: Fix bug where a break instruction would instead signal a return from subroutineJohn2024-02-26 15:33:47 -06:00
1bfeeb1755interpreter: shrink integers to pointer-size in temp type implementation, for speedJohn2024-02-26 15:32:49 -06:00
59b73f314aast: Remove unary hash operator to reserve the symbol for use in attribute parsingJohn2024-02-26 15:30:50 -06:00
77db95791acl-frontend: Improve the line-editing capabilities in REPL mode. - Note: This adds a dependency on Crossterm, to set the terminal into raw mode. This could be eliminated by linking the libraries Crossterm uses directly... Or I could embrace Crossterm, and use it for all escape sequences in the terminal, instead of assuming DEC VT500 compatibility.John2024-02-26 15:15:34 -06:00
5e4e70a72efibonacci.cl: Move the input number out of the stringJohn2024-02-26 15:11:28 -06:00
b8d70d3393Cleanup: Break Loc out into a common module, rename WhileParsing => ParsingJohn2024-01-23 01:51:00 -06:00
c4a32895dfconlang 0.3.0: Total grammar overhaul - Rewrote the grammar - Rewrote the AST - Rewrote the Parser - Removed pretty printer (now handled by ast::ast_impl::Pretty, a Writer wrapper) - Added items, and new keywords to go with them - Syntax is ~maybe temporary, based on Rust syntaxJohn2024-01-21 05:32:18 -06:00
5e2f365f45conlang: deprecate the ASTJohn2024-01-21 01:34:40 -06:00
6bb2f3774finterpreter: Add regression tests for operators and precedenceJohn2024-01-09 23:52:48 -06:00
d9d8c70556interpreter: revert storing environments in functions This change broke recursion entirelyJohn2024-01-09 22:42:15 -06:00
99ade72756interpreter: fix variable resolution and assignmentJohn2024-01-09 22:39:58 -06:00
d387e4dfd7interpreter: rewrite interpreter - Remove interpreter struct - Replace with Interpret trait - This separates concerns dramatically! Yay! - Implement block scoping via Frame abstraction - TODO: is this the right abstraction? - TODO: Modules?? - TODO: What environment should be passed into a function call? ast: - rename Name.name to Name.symbol (name.name.name.name.name.name.name is very readable, yes yes)John2024-01-05 17:48:19 -06:00
9eafae0757resolver: Whoops! Commit early WIP resolver.John2024-01-05 17:44:09 -06:00
79fda16788cl 0.0.2: MAJOR ERGONOMIC BOOSTJohn2024-01-04 02:18:09 -06:00
9b7cf9c017lexer: Add :: and #! tokensJohn2023-10-30 19:17:03 -05:00
c3e02d21adsample-code: Add some sample Conlang programs :DJohn2023-10-30 00:23:43 -05:00
c1c834701aparser: Mockup type-expression syntax - Allow name: Type notation for parameters - Allow fn x() -> RetVal notation for return values - TODO: Create syntax for type-expressions/pathsJohn2023-10-30 00:07:27 -05:00
374017d5e3examples/interpret: Call main if loading from fileJohn2023-10-29 23:48:38 -05:00
ee5dabb4f3Conlang: Implement functions 1.0 (Resolves#12) - [x] Call syntax - [x] Function declaration syntax TODO: - [ ] Any form of type checking - [ ] Static variable resolution - [ ] Closures, etc.John2023-10-29 23:47:00 -05:00
f3306e7ba4examples/format: Rename from parse_inputJohn2023-10-29 21:10:09 -05:00
9a6eb6b0f1examples/interpret: Improve the repl's UX somewhatJohn2023-10-29 01:14:36 -05:00
8fe89e6297conlang: Variable binding and cleanup ast: Separate concerns, and remove Walk interpreter: implement variable bindingJohn2023-10-29 01:13:48 -05:00
35d214c9f6ast: Remove vestigial "ignore" in ExprJohn2023-10-27 00:19:19 -05:00
ac540ebd22parser: parse let statements - TODO: Type expressions token: Add mut keywordJohn2023-10-27 00:18:02 -05:00
a339dfd549dummy.cl: Use unicode escape 🦈John2023-10-23 21:02:45 -05:00
0e917837c0identify_tokens: Use Display on token DataJohn2023-10-23 21:02:09 -05:00
8b1a1534f3docs: Improve and update documentationJohn2023-10-23 21:01:32 -05:00
c43ecf00d1token::token_data::Data: Renamed from token::TokenData & Moved into its own module + Added token::preamble; common imports when working with TokenJohn2023-10-23 19:43:16 -05:00
ccfddcc09aConlang: Add range operators TODO: Limit range operators to at most 2 operandsJohn2023-10-22 18:30:00 -05:00
b5abd2bff1Lexer 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 tokendataJohn2023-10-22 18:28:20 -05:00
feb5cc5dd0AST: 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.John2023-10-21 12:24:52 -05:00
4ec91ff806constr: switch to Rust-style unicode parsingJohn2023-10-21 12:20:22 -05:00
1e5f7149d9Token: Add range operators, rename for consistencyJohn2023-10-20 17:09:14 -05:00
34525ec77alexer: Only allow lines up to 4GB in size. Saves 8 bytes per tokenJohn2023-10-20 15:34:54 -05:00
a26a01fc17constr: Misuse iterators to parse tokensJohn2023-10-20 15:33:02 -05:00
7f7393d2c6conlang: Grammatical cleanup; merge control flow expressionsJohn2023-10-19 14:40:03 -05:00
331141356atests: Move module into fileJohn2023-10-17 13:39:05 -05:00
73f7337fd5pretty_printer: Move module into fileJohn2023-10-17 13:38:30 -05:00
59617d805aparser: Move module into fileJohn2023-10-17 13:36:21 -05:00
3d0698ba60lexer: Move module into fileJohn2023-10-17 13:33:07 -05:00
b1d9e4fd03ast: Move module into fileJohn2023-10-17 13:30:16 -05:00
5d9c45c26atoken: Move module into fileJohn2023-10-17 13:23:34 -05:00
c15490847atoken & lexer: add line & col to tokensJohn2023-10-13 13:05:14 -05:00
545483dae6token: Add Display impl for TypeJohn2023-09-28 01:34:56 -05:00
48f5e5248cconlang: Add break, true, false keywords, and example fileJohn2023-09-28 01:31:46 -05:00
f25685560aconlang: Tokenize punctuation (resolves#9) Things left to consider: - token::Type enum is getting fairly large. breaking it up could invoke substantial code bloat - Compound operators might make more sense at the parser level - Compound-assign operators are ripe for syntactic desugaring, but there must be some reason it's done separately in other languages. - Operators like FatArrow may still make sense at the tokenizer level, regardless. - What is a lexer? A miserable pile of parsers! - Operator overloading, or user-defined operators? Hmm...John2023-09-28 00:11:31 -05:00