Skip to content

Commit 1f4b9a5

Browse files
hyperpolymathclaude
andcommitted
fix(parse): map Token.EXTERN in the Parse.parse_file token bridge
parse.ml's Token->Parser match (next_token) was missing the EXTERN case. lib/dune demotes partial-match (warning 8) from error, so the non-exhaustive match compiled but raised Match_failure at RUNTIME the moment any `extern` token reached Parse.parse_file — i.e. on every FFI-heavy file (all of stdlib/Deno, Vscode, Network, Sqlite, Crypto, ... use `extern fn`/`extern type`). Parser.EXTERN already existed; this just wires the one missing arm. Effect: Parse.parse_file (the public string/file parse API) now handles extern-bearing sources instead of crashing. Verified the previously-crashing stdlib/Deno|Vscode|Network now parse OK; full dune gate green (257/257), zero regression. Surfaced by the affinescript#218 record-migration codemod, which relies on Parse.parse_file and was blocked on stdlib by this. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent a45b021 commit 1f4b9a5

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

lib/parse.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ let next_token state () =
8585
| Token.PUB -> Parser.PUB
8686
| Token.AS -> Parser.AS
8787
| Token.UNSAFE -> Parser.UNSAFE
88+
| Token.EXTERN -> Parser.EXTERN
8889
| Token.ASSUME -> Parser.ASSUME
8990
| Token.SELF_KW -> Parser.SELF_KW
9091
| Token.TRANSMUTE -> Parser.TRANSMUTE

0 commit comments

Comments
 (0)