shithub: scc

Download patch

ref: c821608f58c35cdcd45433f0173ab1ad84ba8093
parent: 026e7301f8e481ff1702f0287d577981801889e6
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Sat Aug 25 14:09:20 EDT 2012

Changed name of parsing functions for statement

These functions had a do_* name in order to avoid reserver words (for
example while, for, goto ...), but names were a bit ugly (do_do for example
...), so best solution is using a _ solution.

--- a/flow.c
+++ b/flow.c
@@ -8,7 +8,7 @@
 static struct node *stmt(void);
 
 static struct node *
-do_goto(void)
+_goto(void)
 {
 	expect(GOTO);
 	expect(IDEN);
@@ -16,7 +16,7 @@
 }
 
 static struct node *
-do_while(void)
+_while(void)
 {
 	register struct node *cond;
 
@@ -28,7 +28,7 @@
 }
 
 static struct node *
-do_do(void)
+_do(void)
 {
 	register struct node *cond, *body;
 
@@ -44,7 +44,7 @@
 }
 
 static struct node *
-do_for(void)
+_for(void)
 {
 	register struct node *exp1, *exp2, *exp3;
 
@@ -61,7 +61,7 @@
 }
 
 static struct node *
-do_if(void)
+_if(void)
 {
 	register struct node *cond, *body;
 
@@ -75,7 +75,7 @@
 }
 
 static struct node *
-do_switch(void)
+_switch(void)
 {
 	register struct node *cond;
 
@@ -93,15 +93,15 @@
 
 	switch (yytoken) {
 	case '{':      return compound();
-	case SWITCH:   return do_switch();
-	case IF:       return do_if();
-	case FOR:      return do_for();
-	case DO:       return do_do();
-	case WHILE:    return do_while();
+	case SWITCH:   return _switch();
+	case IF:       return _if();
+	case FOR:      return _for();
+	case DO:       return _do();
+	case WHILE:    return _while();
 	case CONTINUE:
 	case BREAK:
 	case RETURN:
-	case GOTO:     return do_goto();
+	case GOTO:     return _goto();
 	case CASE:     /* TODO */
 	case DEFAULT:  /* TODO */
 	case IDEN:     /* TODO: check if it can be a label */;