Skip to content

Implement WokeLang interpreter in Rust#2

Merged
hyperpolymath merged 1 commit into
mainfrom
claude/wokelang-ebnf-grammar-QoeVv
Dec 16, 2025
Merged

Implement WokeLang interpreter in Rust#2
hyperpolymath merged 1 commit into
mainfrom
claude/wokelang-ebnf-grammar-QoeVv

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

Complete implementation of WokeLang with:

Lexer (src/lexer/):

  • Token definitions for all keywords, operators, literals
  • Uses logos for fast tokenization
  • Handles comments, strings with escapes, numbers

Parser (src/parser/):

  • Recursive descent parser
  • Full expression parsing with correct precedence
  • All statement types: remember, when/otherwise, repeat, attempt safely
  • Pattern matching with decide based on
  • Emote tags, consent blocks, gratitude declarations

AST (src/ast/):

  • Complete type definitions for all language constructs
  • Spanned nodes for error reporting

Interpreter (src/interpreter/):

  • Tree-walking interpreter
  • Scoped environments for variables
  • Built-in functions: print, len, toString, toInt
  • Consent system with interactive prompts
  • Pattern matching evaluation
  • All operators (arithmetic, comparison, logical)

CLI (src/main.rs):

  • woke <file.woke> - run program
  • woke --tokenize - show tokens
  • woke --parse - show AST

Examples:

  • examples/hello.woke - feature showcase
  • examples/demo.woke - runnable demo

Complete implementation of WokeLang with:

Lexer (src/lexer/):
- Token definitions for all keywords, operators, literals
- Uses logos for fast tokenization
- Handles comments, strings with escapes, numbers

Parser (src/parser/):
- Recursive descent parser
- Full expression parsing with correct precedence
- All statement types: remember, when/otherwise, repeat, attempt safely
- Pattern matching with decide based on
- Emote tags, consent blocks, gratitude declarations

AST (src/ast/):
- Complete type definitions for all language constructs
- Spanned nodes for error reporting

Interpreter (src/interpreter/):
- Tree-walking interpreter
- Scoped environments for variables
- Built-in functions: print, len, toString, toInt
- Consent system with interactive prompts
- Pattern matching evaluation
- All operators (arithmetic, comparison, logical)

CLI (src/main.rs):
- woke <file.woke> - run program
- woke --tokenize <file> - show tokens
- woke --parse <file> - show AST

Examples:
- examples/hello.woke - feature showcase
- examples/demo.woke - runnable demo
@hyperpolymath hyperpolymath merged commit 62f6b69 into main Dec 16, 2025
1 check failed
@hyperpolymath hyperpolymath deleted the claude/wokelang-ebnf-grammar-QoeVv branch December 16, 2025 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants