urnathan added a comment.
Looks right to me -- I also implemented such a state machine in GCC's parser.
There are a bunch of formatting issues to fix of course.
================
Comment at: clang/include/clang/Basic/DiagnosticParseKinds.td:1543
+def err_import_not_allowed_here : Error<
+ "imports must be contiguous and immediately follow the module declaration">;
+def err_import_in_global_fragment : Error<
----------------
"imports must immediately follow a module declaration"? (the contiguous isn't
adding anything IMHO)
================
Comment at: clang/include/clang/Basic/DiagnosticParseKinds.td:1544-1547
+def err_import_in_global_fragment : Error<
+ "module%select{| partition}0 imports cannot be in the global module
fragment">;
+def err_import_in_private_fragment : Error<
+ "module%select{| partition}0 imports cannot be in the private module
fragment">;
----------------
You could I suppose have a single diagnostuc and select between global &
private?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D118893/new/
https://reviews.llvm.org/D118893
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits