From aa9cd3bf805e63c40b4a4fa9fc8fdeef8eac844f Mon Sep 17 00:00:00 2001 From: Himbeer Date: Sun, 15 Sep 2024 17:54:11 +0200 Subject: Fix non-initial import statements being valid according to grammar Import statements are only allowed at the beginning of a file. No further imports are allowed after the first non-import statement. --- doc/grammar.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/grammar.txt b/doc/grammar.txt index 7532af7..398f137 100644 --- a/doc/grammar.txt +++ b/doc/grammar.txt @@ -1,5 +1,5 @@ -root := toplevel* -toplevel := import* ( externfunc | function | constant ) +root := import* toplevel* +toplevel := externfunc | function | constant import := "import" path [ NAME ] ";" -- cgit v1.2.3