pkgsrc/devel/ruby-byaccr/patches/patch-ag
taca 424f8e0a4e Importing ruby-byaccr, ruby-byaccr-0.1 package.
byaccr is a parser generator for ruby based on 'Berkeley Yacc' and
'Berkeley Yacc for Java'.
2001-07-01 14:39:15 +00:00

60 lines
1.5 KiB
Text

$NetBSD: patch-ag,v 1.1.1.1 2001/07/01 14:39:15 taca Exp $
--- reader.c.orig Thu Nov 2 01:29:07 2000
+++ reader.c
@@ -35,8 +35,8 @@
int name_pool_size;
char *name_pool;
-char line_format[] = "#line %d \"%s\"\n";
-char jline_format[] = "#line %d \"%s\"\n";
+const char *line_format = "#line %d \"%s\"\n";
+const char *jline_format = "#line %d \"%s\"\n";
void cachec(int c)
@@ -315,11 +315,12 @@
if (line == 0)
unterminated_text(t_lineno, t_line, t_cptr);
}
- if (!lflag)/*rwj*/
+ if (!lflag) { /*rwj*/
if (jflag)
fprintf(f, jline_format, lineno, input_file_name);
else
fprintf(f, line_format, lineno, input_file_name);
+ }
loop:
c = *cptr++;
@@ -446,11 +447,12 @@
if (unionized) over_unionized(cptr - 6);
unionized = 1;
- if (!lflag)
+ if (!lflag) {
if (jflag)
fprintf(text_file, jline_format, lineno, input_file_name);
else
fprintf(text_file, line_format, lineno, input_file_name);
+ }
fprintf(text_file, "typedef union");
if (dflag) fprintf(union_file, "typedef union");
@@ -1190,7 +1192,7 @@
insert_empty_rule();
last_was_action = 1;
- if (!lflag)/*rwj*/
+ if (!lflag)/*rwj*/ {
if (jflag){
fprintf(f, "when %d\n", nrules - 2);
fprintf(f, jline_format, lineno, input_file_name);
@@ -1199,6 +1201,7 @@
fprintf(f, "%d:\n", nrules - 2);
fprintf(f, line_format, lineno, input_file_name);
};
+ }
if (*cptr == '=') ++cptr;