Crafter.Build/tests
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jorijn van der Graaf 5fa9c8a816 Merge branch 'lint-ast': libclang token layer for the linter
Replaces the linter's hand-rolled character scanning with clang's lexer.

StripComments could not see raw string literals, which was documented as a
v1 limitation but was worse than that: an odd number of quotes inside a raw
string desynchronised it for the rest of the file, hiding real code and
leaving the contents of later literals standing as if they were code. There
are 33 raw strings across 6 files here, including the two largest.

The reflow guards had the same class of bug from the other direction. They
were substring probes, so Line(n).contains("//") fired on // inside a string
literal and contains("R\"") fired on the characters R" inside a literal while
missing raw strings opened on an earlier line. Both misfire on this repo:
"MARKER" ends in R". They are now LineHasComment() and
LineHasMultiLineToken(), and two wrapped call sites in tests/Lint that had
been silently unjoinable join as a result.

libclang is dlopen'd rather than linked, so the mingw and MSVC cross-builds
keep linking and the release tarballs stay self-contained. Tokens need no
PCMs, no build flags and no prior build, and they cover preprocessor branches
that are inactive for the host — which is why the layout rules belong on
tokens rather than on an AST that would only ever see one platform's slice.

No rule behaviour was intended to change beyond the two guard fixes; lint
over this repo produced byte-identical output across the CommentStripped
swap.
2026-07-30 22:57:10 +02:00
..
CleanProject fix: key the host PCM cache on source content, add clean, hash project args 2026-07-30 17:43:09 +00:00
ConcurrentCacheRace linting 2026-07-23 01:24:42 +02:00
ConcurrentDependencyReset linting 2026-07-23 01:24:42 +02:00
DependencyLink linting 2026-07-23 01:24:42 +02:00
HelloWorld linting 2026-07-23 01:24:42 +02:00
HostCacheSourceStamp fix: key the host PCM cache on source content, add clean, hash project args 2026-07-30 17:43:09 +00:00
HouseRules fix(lint): make the reflow guards token-accurate instead of textual 2026-07-27 03:08:06 +02:00
IncrementalInterfaceChange fix: re-resolve module imports before checking staleness 2026-07-30 17:12:24 +00:00
Lint fix(lint): make the reflow guards token-accurate instead of textual 2026-07-27 03:08:06 +02:00
ModuleInterface linting 2026-07-23 01:24:42 +02:00
RunSingleTestExit linting 2026-07-23 01:24:42 +02:00
ShaderCompile linting 2026-07-23 01:24:42 +02:00
StandardArgs fix: key the host PCM cache on source content, add clean, hash project args 2026-07-30 17:43:09 +00:00
StaticLib linting 2026-07-23 01:24:42 +02:00
TestRunnerSpec linting 2026-07-23 01:24:42 +02:00
TransitiveInterfaceChange fix: track what a primary module interface imports 2026-07-30 18:19:04 +00:00
VariantId fix: key the host PCM cache on source content, add clean, hash project args 2026-07-30 17:43:09 +00:00
WasiBrowserRuntime linting 2026-07-23 01:24:42 +02:00
WasmVariants linting 2026-07-23 01:24:42 +02:00