Commit Graph

4 Commits

Author SHA1 Message Date
becc7a2d34 Add expression AST and Pratt parser with REPL
- ast.rs: Expr/ExprKind with UnaryOp, BinaryOp, StructField
- parser.rs: Pratt expression parser with allow_struct_literals flag,
  error recovery via dummy tokens, and 19 unit tests
- main.rs: interactive expression REPL (prints parsed AST)
2026-03-10 17:40:52 +01:00
4f80de51b2 Add fluxc compiler skeleton: token definitions and lexer
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.
2026-03-10 17:20:17 +01:00
0e08640f59 Add VSCode syntax highlighting extension for Flux
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.
2026-03-10 14:42:46 +01:00
73e36fac71 Initial Flux language specification
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.
2026-03-10 14:41:54 +01:00