88 LABEL LABELTAB START TABSTART
99 STARTCHAR CONTCHAR COMMENTCHAR BANGCHAR PRECHAR
1010 StartChar ContChar CommentChar BangChar PreChar NoChar Eol OptWS
11- File Line
11+ BlankLine CommentLine Continuation FollowLine PreprocessLine Stmt
12+ InitialComment StmtBlock File
1213
1314 context-free start-symbols
1415
@@ -87,25 +88,34 @@ exports
8788
8889 context-free syntax
8990
90- Line* -> File {cons("File")}
91+ InitialComment* StmtBlock* -> File {cons("File")}
9192
92- OptWS Eol -> Line {cons("BlankLine")}
93+ BlankLine -> InitialComment
94+ CommentLine -> InitialComment
95+ PreprocessLine -> InitialComment
9396
94- PreChar CHARS Eol -> Line {cons("Preprocess")}
97+ BlankLine -> FollowLine
98+ CommentLine -> FollowLine
99+ Continuation -> FollowLine
100+ PreprocessLine -> FollowLine
95101
96- CommentChar CHARS Eol -> Line {cons("Comment")}
102+ PreChar CHARS Eol -> PreprocessLine {cons("Preprocess")}
103+ OptWS Eol -> BlankLine {cons("BlankLine")}
104+ CommentChar CHARS Eol -> CommentLine {cons("Comment")}
105+ WS BangChar CHARS Eol -> CommentLine {cons("FreeFormComment")}
97106
98- WS BangChar CHARS Eol -> Line {cons("FreeFormComment ")}
107+ START ContChar CHARS Eol -> Continuation {cons("Continuation ")}
99108
100- START StartChar CHARS Eol -> Line {cons("Stmt")}
101- TABSTART NoChar CHARS Eol -> Line {cons("Stmt")}
109+ START StartChar CHARS Eol -> Stmt {cons("Stmt")}
110+ TABSTART NoChar CHARS Eol -> Stmt {cons("Stmt")}
102111
103- LABEL StartChar CHARS Eol -> Line {cons("LabeledStmt")}
104- LABELTAB NoChar CHARS Eol -> Line {cons("LabeledStmt")}
112+ LABEL StartChar CHARS Eol -> Stmt {cons("LabeledStmt")}
113+ LABELTAB NoChar CHARS Eol -> Stmt {cons("LabeledStmt")}
105114
106- START ContChar CHARS Eol -> Line {cons("Continuation ")}
115+ Stmt FollowLine* -> StmtBlock {cons("StmtBlock ")}
107116
108- EOL -> Eol {cons("eol")}
117+
118+ EOL -> Eol {cons("eol")}
109119
110120 BANGCHAR -> BangChar {cons("comchar")}
111121 COMMENTCHAR -> CommentChar {cons("comchar")}
@@ -115,5 +125,5 @@ exports
115125
116126 % empty % -> NoChar {cons("no-char")}
117127
118- WS -> OptWS {cons("ws")}
119- % empty % -> OptWS {cons("no-ws")}
128+ WS -> OptWS {cons("ws")}
129+ % empty % -> OptWS {cons("no-ws")}
0 commit comments