Commit Briefs
Add integration tests for v0.1 (main)
Test suite covering all language features: arithmetic, strings, variables, if/else, while, for/range, functions with implicit/explicit return, type mismatch errors, and all CLI subcommands (run, tokenize, parse, compile).
Add type checking and contextual error messages
Compiler infers types and validates type annotations at compile time (e.g. let x: int = "hello" is an error). Span gains line_col() for mapping byte offsets to line:column. Errors now render with source context showing the exact location and underline.
Add function calls with call stack
Each function compiles to its own Chunk with name and arity. VM uses CallFrame stack for nested calls. Parameters are first locals in each frame. Supports implicit return (last expression without semicolon) and explicit return statements.
Add control flow with if/else and while loops
New opcodes for comparison (Equal, NotEqual, Less, LessEqual, Greater, GreaterEqual), logical Not, and jumps (JumpIfFalse, Jump, Loop). Compiler uses jump patching for if/else branches and backward jumps for while loops.
Add variable support with let/let mut
New opcodes GetLocal and SetLocal for stack-slot based variables. Compiler resolves variable names to slot indices and checks mutability at compile time. Immutable variables (let) cannot be reassigned.
Add bytecode compiler and stack-based VM
Compile AST to bytecode with opcodes for constants, arithmetic, print, and return. Stack-based VM with dispatch loop executes bytecode. First programs running end-to-end: source -> lexer -> parser -> compiler -> VM -> output.
Add full parser with statements and functions
Parse complete programs: FnDecl, let/let mut, if/else/else if, while, for..in range(), return, print, assignments. Semicolons terminate statements, last expression without semicolon is implicit return.
Add expression parser with operator precedence
Recursive-descent parser for expressions with proper precedence: equality > comparison > addition > multiplication > unary > call > primary. Supports literals, binary/unary ops, function calls, and parenthesized grouping.
Extend lexer with strings, keywords and identifiers
Add support for string literals with escapes, float literals, identifiers, keywords (let, fn, if, etc), two-char tokens (==, !=, ->, <=, >=), comments (#), and line/column tracking for error messages.
Add basic lexer with tokenize command
Lexer tokenizes numbers, arithmetic operators, parentheses and semicolons. CLI tokenize subcommand reads .ol files and prints token stream.
Add span and error types
Span tracks byte positions in source code for error reporting. OlangError carries a message and span.
Init project scaffolding
Setup Cargo.toml, Makefile, LICENSE, README and initial main.rs for the olang programming language.
