aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lua.stx31
1 files changed, 21 insertions, 10 deletions
diff --git a/lua.stx b/lua.stx
index e32686c6..f8bdb9d7 100644
--- a/lua.stx
+++ b/lua.stx
@@ -1,6 +1,6 @@
1%{ 1%{
2 2
3char *rcs_luastx = "$Id: lua.stx,v 3.17 1995/01/13 22:11:12 roberto Exp celes $"; 3char *rcs_luastx = "$Id: lua.stx,v 3.18 1995/04/11 17:56:30 celes Exp roberto $";
4 4
5#include <stdio.h> 5#include <stdio.h>
6#include <stdlib.h> 6#include <stdlib.h>
@@ -398,8 +398,8 @@ void lua_parse (Byte **code)
398%type <vLong> PrepJump 398%type <vLong> PrepJump
399%type <vInt> expr, exprlist, exprlist1, varlist1, funcParams, funcvalue 399%type <vInt> expr, exprlist, exprlist1, varlist1, funcParams, funcvalue
400%type <vInt> fieldlist, localdeclist, decinit 400%type <vInt> fieldlist, localdeclist, decinit
401%type <vInt> ffieldlist1 401%type <vInt> ffieldlist, ffieldlist1, semicolonpart
402%type <vInt> lfieldlist1 402%type <vInt> lfieldlist, lfieldlist1
403%type <vLong> var, singlevar 403%type <vLong> var, singlevar
404%type <pByte> body 404%type <pByte> body
405 405
@@ -648,21 +648,28 @@ parlist1 : NAME
648 } 648 }
649 ; 649 ;
650 650
651fieldlist : /* empty */ { $$ = 0; } 651fieldlist : lfieldlist
652 | lfieldlist1 lastcomma 652 { flush_list($1/FIELDS_PER_FLUSH, $1%FIELDS_PER_FLUSH); }
653 { $$ = $1; flush_list($1/FIELDS_PER_FLUSH, $1%FIELDS_PER_FLUSH); } 653 semicolonpart
654 { $$ = $1+$3; }
654 | ffieldlist1 lastcomma 655 | ffieldlist1 lastcomma
655 { $$ = $1; flush_record($1%FIELDS_PER_FLUSH); } 656 { $$ = $1; flush_record($1%FIELDS_PER_FLUSH); }
656 | lfieldlist1 ';'
657 { flush_list($1/FIELDS_PER_FLUSH, $1%FIELDS_PER_FLUSH); }
658 ffieldlist1 lastcomma
659 { $$ = $1+$4; flush_record($4%FIELDS_PER_FLUSH); }
660 ; 657 ;
661 658
659semicolonpart : /* empty */
660 { $$ = 0; }
661 | ';' ffieldlist
662 { $$ = $2; flush_record($2%FIELDS_PER_FLUSH); }
663 ;
664
662lastcomma : /* empty */ 665lastcomma : /* empty */
663 | ',' 666 | ','
664 ; 667 ;
665 668
669ffieldlist : /* empty */ { $$ = 0; }
670 | ffieldlist1 lastcomma { $$ = $1; }
671 ;
672
666ffieldlist1 : ffield {$$=1;} 673ffieldlist1 : ffield {$$=1;}
667 | ffieldlist1 ',' ffield 674 | ffieldlist1 ',' ffield
668 { 675 {
@@ -677,6 +684,10 @@ ffield : NAME '=' expr1
677 } 684 }
678 ; 685 ;
679 686
687lfieldlist : /* empty */ { $$ = 0; }
688 | lfieldlist1 lastcomma { $$ = $1; }
689 ;
690
680lfieldlist1 : expr1 {$$=1;} 691lfieldlist1 : expr1 {$$=1;}
681 | lfieldlist1 ',' expr1 692 | lfieldlist1 ',' expr1
682 { 693 {