52 Commits

Author SHA1 Message Date
c1d32f3efc ast: Add Fold, Folder traits, reorganize visit
parser: fix precedence of `BindOp::Let`
2025-10-29 04:39:41 -04:00
9a0d1232a6 token: docs
pat: Token::kind
2025-10-28 23:02:33 -04:00
d5e25a15dc ast: add continue expression 2025-10-28 22:47:58 -04:00
fb8677c937 lib.rs: improve the blurb 2025-10-28 22:17:43 -04:00
8e2bc5ad85 src: Split parser into modules, reorganize AST 2025-10-28 22:15:06 -04:00
a3cab92b35 parser: clean up unused ExplicitDo 2025-10-28 04:26:41 -04:00
0d7b89da96 ast: Add Visitor interface
Questions: do we need this?
2025-10-28 04:21:52 -04:00
588606e0c4 src: address a bunch of clippy::pedantic lints 2025-10-28 02:53:20 -04:00
0bf5a41498 syntax: Merge ALL definitions into Bind, and allow type variable introducers at every Bind 2025-10-28 02:27:56 -04:00
a29adeeef3 ast: move typedef up 2025-10-24 05:26:07 -04:00
287b57abd7 main: print parse stats when parse errors 2025-10-24 05:25:38 -04:00
89e4afcc42 parser: "Parse" type variable introducers (and discard them for now) 2025-10-24 05:24:58 -04:00
64dc8bb279 ast: add ptr patterns 2025-10-21 08:35:46 -04:00
263d2290c0 token: Make TKind::{Pub, Mod} match their keywords 2025-10-21 08:35:33 -04:00
3fd089ad11 parser: Move parse_for below impl Parse<'t> for Expr, and allow a single semi at EOF 2025-10-21 07:44:13 -04:00
6c57263492 token: Remove and and or tokens, since they clash with operator overload function names 2025-10-21 07:43:04 -04:00
115fe836f9 ast: move implementations of Expr below Op 2025-10-21 07:42:37 -04:00
c7e2e3d31d ast: pub patterns, and, since Pat replaced Ty, !(never) patterns. 2025-10-21 07:42:04 -04:00
ccb6bef6d9 ast: Add use, tackle remaining low-hanging fruit 2025-10-21 07:09:12 -04:00
9cccac5910 docs: Fix cargo-doc errors 2025-10-20 04:52:52 -04:00
b80a3a55c3 ast: Merge Ty into Pat, merge Mod and Fn into Bind 2025-10-20 04:24:21 -04:00
22094f4862 main: Clear screen on mode change 2025-10-20 00:40:22 -04:00
0015ac5f1b ast: rename Let to Bind 2025-10-20 00:39:56 -04:00
458e95a8ed AST: merge let, const, static, match_arm into one binder 2025-10-20 00:21:49 -04:00
607615db74 Add .cargo/config.toml, so other people can build Conlang 2025-10-20 00:07:20 -04:00
f625e4181f test.sh: add trailing newline. 2025-10-17 07:03:36 -04:00
75048c61c9 dummy.do: Semicolon elision! 2025-10-17 06:57:37 -04:00
db9c75b3c6 ast: formatting; main: explicit verbosity 2025-10-17 06:57:21 -04:00
f05d480b35 test.sh: add test script to quickly parse every file in a directory 2025-10-17 06:26:21 -04:00
6368e68941 doughlang: Preserve errors through entire pipeline
lexer:
- Un-stringify errors
- Reserve more words
- Doc the comments

parser:
- MASSIVE changes to peek, peek_if, next_if, consume_if=>expect.
- Keep track of when EOF is allowable
- TKind is stupidly cheap with >100 niches, so we can fit like 4 of them in a single ParseError lmao
- TODO: make sure EOF/UnexpectedEOF propagation is correct. It seems... Kinda Not correct.
- Add meta-expressions
2025-10-17 06:25:11 -04:00
c8f1f082c4 lexer: Document stuff 2025-10-16 23:08:16 -04:00
70042f4ed0 parser: remove "numeric" module, since (like cl) literals are handled in the lexer. 2025-10-16 22:50:04 -04:00
e1419fa430 doughlang: enums, ref patterns, ref types 2025-10-16 06:53:09 -04:00
6da201f52f parser: skip comments in peek 2025-10-16 06:50:17 -04:00
1998558468 doughlang: "fix" semi elision, add "fully qualified" paths, add proper pattern prec parsing.
This actually gets some old code parsing!
2025-10-16 05:49:02 -04:00
03d9682409 doughlang: let else, fn rety
ast:
- `let Pat (= Expr (else Expr)?)?`,
- `fn (args) -> Ty`, coagulating `do`, `if/while` formatting fixes

parser:
- int cleanup,
- fn rety parsing,
- experimental `for` desugar,
- experimental semicolon elision (TODO: it sucks),
- let-else parsing
- `do` coagulation impl (still not 100% there)

TODO:
- Fix `do` coagulation
- codify `do` elision rules
- `for` needs lib support
  - this is fine because we have no codegen yet
- Ty matching in macro_matcher
  - Or rip out macro_matcher? Who knows what the future holds.
2025-10-16 01:51:14 -04:00
95abb81f4a main: ty parser test mode, visually distinct prompt 2025-10-16 01:38:52 -04:00
f47de24cfb token: reserve "and", "or", "in" as keywords 2025-10-16 01:37:24 -04:00
b5d552376e Move integer and char parsing out of the parser and back into the lexer 2025-10-10 14:45:08 -04:00
0cbb800c19 lexer: Change base36 sigil to tilde, to match Conlang 2025-10-10 13:39:58 -04:00
2c63f1af63 ast: Make struct formatting look cool 2025-10-07 05:43:19 -04:00
4b0f30f78e lexer: Fun little lexer hack to allow trailing commas 2025-10-07 05:42:44 -04:00
222b2d7b98 ast: struct 2025-10-07 05:00:51 -04:00
bcabbcd39d ast: pub, mod, and Ty::Fn parsing 2025-09-30 15:32:20 -04:00
46b17a7eb6 dummy: fn main syntax! yay 2025-09-21 02:58:50 -04:00
8640ec4261 ast: fn main, structification
parser: unified post/infix, context-full grammar
repl: modes
2025-09-21 02:57:20 -04:00
434fa225e7 ast: Fix pattern metaidentifier display 2025-09-21 02:24:43 -04:00
b1619f6e4e parser: allow any token to be a metaidentifier 2025-09-21 02:24:15 -04:00
7b05da1334 do: Elaborate on pattern syntax, add binary as operator 2025-09-16 04:18:12 -04:00
b6949147c4 parser: Refactor coagulated binops as postfix operators
This allows them to intermingle more nicely with `Try`
2025-09-15 10:28:08 -04:00