Introduction
Krueger is an Elm-dialect parser and compiler toolchain for Scala. It parses Elm source into a Concrete Syntax Tree (CST) and a lowered Abstract Syntax Tree (AST), and exposes a tree-sitter-inspired query DSL for static analysis over either tree.
Features
Section titled “Features”- Full Elm lexer and parser built with Parsley parser combinators.
- Concrete Syntax Tree with cursor-based traversal and a visitor pattern.
- Abstract Syntax Tree with cursor-based traversal and a visitor pattern.
- CST-to-AST lowering.
- Query DSL via
krueger.treesover a genericQueryableTree[T]typeclass. - Cross-platform: JVM, Scala.js, and Scala Native.
When to use it
Section titled “When to use it”Reach for Krueger when you need to programmatically read or transform Elm source from Scala — for example, linters, codegen pipelines, formatters, migration scripts, or editor tooling.
See Tooling across platforms for JVM vs browser surfaces,
the published playgrounds, and the Krueger JS facade used by the WASM site.