1 [INACTIVE] Optional semicolons for statement termination
3 Derived from N8 Gray's patch:
5 http://sourceforge.net/tracker/?func=detail&atid=311005&aid=1185506&group_id=11005
6 [ 1185506 ] Optional semicolons for statement termination
8 The Enhancements to NEdit macro parsing patch includes this change.
12 source/parse.y | 14 +++++++++-----
13 1 files changed, 9 insertions(+), 5 deletions(-)
15 diff --quilt old/source/parse.y new/source/parse.y
16 --- old/source/parse.y
17 +++ new/source/parse.y
18 @@ -71,10 +71,11 @@ static int nextSymIsField = 0;
25 %nonassoc SYMBOL ARG_LOOKUP
26 %right '=' ADDEQ SUBEQ MULEQ DIVEQ MODEQ ANDEQ OREQ
30 @@ -111,11 +112,14 @@ block: '{' blank stmts '}' blank
36 -stmt: simpstmt '\n' blank
40 + | simpstmt stmtend blank
41 | IF '(' cond ')' blank block %prec IF_NO_ELSE {
42 SET_BR_OFF($3, GetPC());
44 | IF '(' cond ')' blank block else blank block %prec ELSE {
45 SET_BR_OFF($3, ($7+1)); SET_BR_OFF($7, GetPC());
46 @@ -137,26 +141,26 @@ stmt: simpstmt '\n' blank
48 ADD_OP(OP_BRANCH); ADD_BR_OFF($5+2);
49 SET_BR_OFF($5+5, GetPC());
50 FillLoopAddrs(GetPC(), $5+2);
52 - | BREAK '\n' blank {
53 + | BREAK stmtend blank {
54 ADD_OP(OP_BRANCH); ADD_BR_OFF(0);
55 if (AddBreakAddr(GetPC()-1)) {
56 yyerror("break outside loop"); YYERROR;
59 - | CONTINUE '\n' blank {
60 + | CONTINUE stmtend blank {
61 ADD_OP(OP_BRANCH); ADD_BR_OFF(0);
62 if (AddContinueAddr(GetPC()-1)) {
63 yyerror("continue outside loop"); YYERROR;
66 - | RETURN expr '\n' blank {
67 + | RETURN expr stmtend blank {
70 - | RETURN '\n' blank {
71 + | RETURN stmtend blank {
72 ADD_OP(OP_RETURN_NO_VAL);
75 simpstmt: SYMBOL '=' expr {
76 ADD_OP(OP_ASSIGN); ADD_SYM($1);