Skip to content

Commit 9700b1a

Browse files
committed
Make sure coqdep does not misinterpret "Importfoo" (fix #20984).
1 parent cf707b4 commit 9700b1a

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

tools/coqdep/lib/lexer.mll

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,9 @@ and extra_dep_rule from = parse
132132
and require_modifiers from = parse
133133
| "(*"
134134
{ comment lexbuf; require_modifiers from lexbuf }
135-
| "Import" space*
136-
{ require_file from lexbuf }
137-
| "Export" space*
138-
{ require_file from lexbuf }
135+
| ("Import" | "Export") space* ("-" space*)? ((space | "(") as p)
136+
{ if p = '(' then skip_parenthesized lexbuf;
137+
require_file from lexbuf }
139138
| space+
140139
{ require_modifiers from lexbuf }
141140
| eof
@@ -200,8 +199,6 @@ and load_file = parse
200199
and require_file from = parse
201200
| "(*"
202201
{ comment lexbuf; require_file from lexbuf }
203-
| ("-" space*)? "("
204-
{ skip_parenthesized lexbuf; require_file from lexbuf }
205202
| space+
206203
{ require_file from lexbuf }
207204
| coq_ident

0 commit comments

Comments
 (0)