Skip to content

Add Lateralus lexer - #1249

Merged
alecthomas merged 1 commit into
alecthomas:masterfrom
bad-antics:add-lateralus
Apr 25, 2026
Merged

alecthomas merged 1 commit into
alecthomas:masterfrom
bad-antics:add-lateralus

Conversation

@bad-antics

Copy link
Copy Markdown
Contributor

Adds a lexer for Lateralus, a statically typed, pipeline-oriented programming language with algebraic data types, pattern matching, and first-class effect capabilities.

Language info

What's included

  • lexers/embedded/lateralus.xml — XML lexer config covering keywords, builtin types and functions, attribute decorators (@memo), capability annotations (#[caps(io, net)]), nested block comments, raw/byte/interpolated strings, numeric literals with type suffixes (42u64, 3.14f32, 0xFF_i32), module paths (foo::bar), ADT variants, and the signature pipeline operator |>.
  • lexers/testdata/lateralus.actual — real example from the Lateralus reference implementation's examples/ directory (MIT licensed).
  • lexers/testdata/lateralus.expected — golden output generated via RECORD=true go test.

Tests

  • go test ./lexers/ -run TestLexers/Lateralus → PASS
  • go test ./lexers/ -run 'TestCompileAllRegexes|TestGlobs|TestAliases' → PASS
  • Sample produces zero Error tokens.

Sample license

The fibonacci.ltl sample is copied verbatim from the Lateralus reference implementation under MIT; happy to relicense for inclusion if preferred.

Adds a chroma lexer for the Lateralus programming language, a statically
typed, pipeline-oriented language with algebraic data types, pattern
matching, and first-class effect capabilities.

- File extension: .ltl
- Aliases: lateralus, ltl
- Homepage: https://lateralus.dev

Includes testdata/lateralus.actual and .expected generated via RECORD=true.
Produces zero Error tokens on the sample.
@alecthomas
alecthomas merged commit ce43442 into alecthomas:master Apr 25, 2026
2 checks passed
@alecthomas

Copy link
Copy Markdown
Owner

Thanks!

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

⌂ 换网址