All 12 sections are now fully defined. Removed incremental-progress
markers (Status: defined), updated intro and outline preamble, and
fixed two missing cases in the assigns() function (struct literals and
parenthesised expressions).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Grammar: update pointer_type to support optional mut keyword;
LL(1) verified (56 named rules, no conflicts)
- AST: update Type enum with mutable: bool field for Pointer and
OpaquePointer variants
- Parser: consume optional mut token in parse_type; update all
existing pointer tests; add 4 new mut pointer tests (85 pass)
- VSCode extension: add *mut capture-group pattern for syntax
highlighting; update SYNTAX.md with pointer mutability table
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add compound assignment operators (+=, -=, *=, /=, %=, &=, |=, ^=,
<<=, >>=) and shift operators (<<, >>) to the tmLanguage syntax
highlighting grammar. Patterns are ordered longest-first to prevent
shorter tokens from shadowing multi-character operators. Also update
fibonacci example to use += compound assignment.
Extracts all argument-parsing and help logic into cli.rs:
- -h / --help: colored usage and options summary
- -V / --version: print version from Cargo.toml
- Unknown flags produce a styled error with a hint
- At least one file required; missing-file error is styled
- Multiple files accepted; exit code 1 if any file has parse errors
Introduces fluxc/src/diagnostics.rs with Level (Critical, Error,
Warning, Note), Label (Primary/Secondary with optional message), and
Diagnostic types. Diagnostic::render(src, filename) produces
rustc-style output: colored header, --> file:line:col pointer, source
line with gutter, and ^ / - underlines aligned to the offending span.
Replaces the flat ParseError struct in the parser; all five error
sites now emit Diagnostic values with source-pointing labels.
Compound assignment: +=, -=, *=, /=, %=, &=, |=, ^=, <<=, >>=
Shift: <<, >>
Each compound assignment token parses at the same precedence as `=`
(right-associative, lowest) and produces ExprKind::CompoundAssign.
Shifts parse between additive and multiplicative precedence.
GRAMMAR.ebnf and SYNTAX.md updated accordingly.
`=` was missing from the Pratt table, causing `a = b;` to fail with
"expected `;`, found `=`". Assignment is now BinaryOp::Assign with
binding power (2, 2) — lowest precedence, right-associative — so
`a = b = c` parses as `a = (b = c)`.
- ast.rs: Param, FieldDef, FuncDef, StructDef, TopLevelDef,
TopLevelDefKind, Program
- parser.rs: parse_program, parse_top_level_def, parse_func_def,
parse_struct_def with param/field list helpers;
synchronize_top_level for recovery; 14 new tests (76 total)
- main.rs: parse source file as a Program and print the AST
- ast.rs: add Type, Block, ElseBranch, Stmt, StmtKind
- parser.rs: parse_type, parse_block, parse_stmt and all sub-parsers;
missing-token insertion via expect(), synchronize() for panic-mode
recovery on non-startable tokens; 26 new tests (62 total)
- main.rs: REPL now parses statements instead of bare expressions
Introduces the fluxc Rust crate with the first two compiler stages:
- token.rs: define_tokens! macro generates TokenKind enum and its
Display impl from a single table covering all Flux tokens
(literals, keywords, operators, punctuation, Eof/Unknown).
Span (half-open u32 byte range) and Token<'src> (kind + span +
zero-copy text slice) round out the module.
- lexer.rs: Lexer<'src> produces Token<'src> from a source &str.
Skips whitespace, // line comments, and /* */ block comments.
Handles all integer bases (decimal, hex, octal, binary with _
separators), floats (fractional + exponent), string/char literals
with escape sequences, and Unicode identifiers via unicode-xid.
Implements Iterator<Item = Token> and includes 17 unit tests.
Also adds .gitignore (ignores fluxc/target) and expands
examples/fibonacci.flx with an iterative variant.
Adds the vscode-flux extension with TextMate grammar covering keywords,
types, literals, operators, comments, and function/struct name highlighting.
Supports .flux and .flx file extensions.
Add the LL(1) context-free grammar (GRAMMAR.ebnf), token and syntax
reference (SYNTAX.md), LL(1) verification tool (ll1_check.py), and a
fibonacci example demonstrating the language.