Package: jlex / 1.2.6-4

rename-assert.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Description: Rename assert, which clashed with Java 1.4
Author: Colin Watson <cjwatson@debian.org>
Bug-Debian: http://bugs.debian.org/261949
Forwarded: no
Last-Update: 2010-03-02

Index: b/sample.lex
===================================================================
--- a/sample.lex
+++ b/sample.lex
@@ -10,7 +10,7 @@
 }
 
 class Utility {
-  public static void assert
+  public static void ASSERT
     (
      boolean expr
      )
@@ -120,7 +120,7 @@
 <COMMENT> "/*" { comment_count = comment_count + 1; }
 <COMMENT> "*/" { 
 	comment_count = comment_count - 1; 
-	Utility.assert(comment_count >= 0);
+	Utility.ASSERT(comment_count >= 0);
 	if (comment_count == 0) {
     		yybegin(YYINITIAL);
 	}
@@ -130,14 +130,14 @@
 <YYINITIAL> \"{STRING_TEXT}\" {
 	String str =  yytext().substring(1,yytext().length() - 1);
 	
-	Utility.assert(str.length() == yytext().length() - 2);
+	Utility.ASSERT(str.length() == yytext().length() - 2);
 	return (new Yytoken(40,str,yyline,yychar,yychar + str.length()));
 }
 <YYINITIAL> \"{STRING_TEXT} {
 	String str =  yytext().substring(1,yytext().length());
 
 	Utility.error(Utility.E_UNCLOSEDSTR);
-	Utility.assert(str.length() == yytext().length() - 1);
+	Utility.ASSERT(str.length() == yytext().length() - 1);
 	return (new Yytoken(41,str,yyline,yychar,yychar + str.length()));
 } 
 <YYINITIAL> {DIGIT}+ {