feature(parser): empty decl (#69)

This commit is contained in:
Xenxo Espasandín 2023-02-14 20:53:53 +01:00 committed by GitHub
parent 5fbb0cea7d
commit c1cfa44631
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1364 additions and 1337 deletions

View File

@ -276,12 +276,16 @@ root
; ;
program program
: program inline : program SEMICOLON
{ $$ = std::move($1); }
| program inline
{ $$ = std::move($1); } { $$ = std::move($1); }
| program include | program include
{ $$ = std::move($1); $$->includes.push_back(std::move($2)); } { $$ = std::move($1); $$->includes.push_back(std::move($2)); }
| program declaration | program declaration
{ $$ = std::move($1); $$->declarations.push_back(std::move($2)); } { $$ = std::move($1); $$->declarations.push_back(std::move($2)); }
| SEMICOLON
{ $$ = make_program(@$); }
| inline | inline
{ $$ = make_program(@$); } { $$ = make_program(@$); }
| include | include

File diff suppressed because it is too large Load Diff

View File

@ -5008,9 +5008,9 @@ switch (yykind)
/// Constants. /// Constants.
enum enum
{ {
yylast_ = 2334, ///< Last index in yytable_. yylast_ = 2375, ///< Last index in yytable_.
yynnts_ = 92, ///< Number of nonterminal symbols. yynnts_ = 92, ///< Number of nonterminal symbols.
yyfinal_ = 22 ///< Termination state number. yyfinal_ = 23 ///< Termination state number.
}; };