From 9700b1a23d48487fd304fd551f22638dfd8c6260 Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Sun, 10 Aug 2025 09:51:23 +0200 Subject: [PATCH] Make sure coqdep does not misinterpret "Importfoo" (fix #20984). --- tools/coqdep/lib/lexer.mll | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tools/coqdep/lib/lexer.mll b/tools/coqdep/lib/lexer.mll index c3b7f8b3bbca..c4336d96730c 100644 --- a/tools/coqdep/lib/lexer.mll +++ b/tools/coqdep/lib/lexer.mll @@ -132,10 +132,9 @@ and extra_dep_rule from = parse and require_modifiers from = parse | "(*" { comment lexbuf; require_modifiers from lexbuf } - | "Import" space* - { require_file from lexbuf } - | "Export" space* - { require_file from lexbuf } + | ("Import" | "Export") space* ("-" space*)? ((space | "(") as p) + { if p = '(' then skip_parenthesized lexbuf; + require_file from lexbuf } | space+ { require_modifiers from lexbuf } | eof @@ -200,8 +199,6 @@ and load_file = parse and require_file from = parse | "(*" { comment lexbuf; require_file from lexbuf } - | ("-" space*)? "(" - { skip_parenthesized lexbuf; require_file from lexbuf } | space+ { require_file from lexbuf } | coq_ident