Syntax prototype and basic parser #1

Merged
HEL merged 41 commits from feat/syntax-prototype into main 2026-05-19 08:34:07 +00:00
Owner

This PR implements a basic syntax for type annotation and type definitions
It adds adds basic lexers and parsers, adapted from the Crafting Interpreters book by Robert Nystrom, more specifically from my previous Python implementation

This is still a prototype and the syntax / implementation will change

This PR implements a basic syntax for type annotation and type definitions It adds adds basic lexers and parsers, adapted from the [_Crafting Interpreters_][1] book by Robert Nystrom, more specifically from my [previous Python implementation][2] This is still a prototype and the syntax / implementation **will** change [1]: https://craftinginterpreters.com/ [2]: https://git.kb28.ch/HEL/pebble
HEL added 41 commits 2026-05-19 08:33:36 +00:00
the lexer and token structures were adapted from another project (see docstring on the Lexer class)
the parser was adapted from another project (see docstring on the Parser class)
refactored the messy AST printer impletation with Claude to use a context manager, an enum and extract common functions

Co-authored-by: Claude <noreply@anthropic.com>
add a basic test for the annotation lexer to check punctuation tokens
consume equal token when matching bang-equal
HEL merged commit 80bfcd0d1a into main 2026-05-19 08:34:07 +00:00
HEL deleted branch feat/syntax-prototype 2026-05-19 08:34:07 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: HEL/midas#1