Commit Graph
62 Commits
Author SHA1 Message Date
milner eec988b452 feat(ast): model statements, blocks and nested conditionals
Keeps written order, so a later branch can observe the result of a check that
appeared earlier in the file.
2022-05-29 08:59:55 +00:00
milner 125376f53f feat(lexer): tokenise build files with a span on every token
Words, strings, braces and comments, each carrying its source range, so an
error points at the offending token rather than the whole line.
2022-05-27 13:59:46 +00:00
milner a864f5e7a8 feat(types): define resolved project, target and rule records
Targets carry sources, includes, flags and uses; rule instances carry resolved
inputs and outputs. This is the shape every later stage consumes.
2022-05-26 00:17:18 +00:00
milner d182750a9f feat(suggest): rank near-miss names by edit distance
Levenshtein with a cutoff, returning the closest valid name at a position, or
nothing when no candidate is close enough.
2022-05-25 15:17:54 +00:00
milner 4040f5a404 feat(json): emit JSON with correct control-character escaping
So generated output survives paths containing spaces, quotes or backslashes.
2022-05-23 21:14:56 +00:00
milner 9f4871b1e5 feat(glob): expand source patterns without shelling out
Matches *, ? and ** against directory entries directly, so src/**/*.c
resolves identically regardless of the shell.
2022-05-21 21:37:43 +00:00
milner e9f7f2c7dd feat(fs): add recursive mkdir, whole-file IO and mtime reads
Path joining, read, write, is_dir and mtime, used by every later stage that
touches disk.
2022-05-21 12:14:44 +00:00
milner 14377f6794 feat(ident): normalise names into C macro identifiers
Uppercases, replaces non-alphanumerics with underscores, and derives the
HAVE_X and SIZEOF_X forms the generated header uses.
2022-05-20 03:45:44 +00:00
milner e26d8344da feat(diag): render errors with a caret and the offending line
Formats file:line:col, re-reads the source to print the line, underlines the
span and leaves a slot for a suggestion.
2022-05-18 08:54:32 +00:00
milner 003a707af0 feat(style): gate ANSI colour on tty detection
One wrapper per colour plus a padding helper, all no-ops when stdout is not a
terminal, so piped output and CI logs stay readable.
2022-05-17 19:36:28 +00:00
milner 0377287c1e feat(span): track byte ranges so errors can point into source
Span.t carries file, offset and length, with join to merge two spans and a
none sentinel for synthesised nodes. Every token and node gets one.
2022-05-17 08:50:46 +00:00
milner 223b5e2bd7 build: add dune project skeleton and library stanza
The meow library against unix, plus ignore rules for _build, generated
sources and the meowc symlink.
2022-05-16 09:42:00 +00:00