Commit 18911aa
fix(parse): map Token.EXTERN in the Parse.parse_file token bridge (#219)
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 18911aa
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
| |||
0 commit comments