Changeset 907
- Timestamp:
- 11/09/07 19:25:07 (1 year ago)
- Files:
-
- trunk/descent.core/src/descent/core/dom/CompilationUnitResolver.java (modified) (1 diff)
- trunk/descent.core/src/descent/internal/compiler/parser/Lexer.java (modified) (1 diff)
- trunk/descent.core/src/descent/internal/compiler/parser/Parser.java (modified) (2 diffs)
- trunk/descent.tests/descent/tests/dstress/DstressTestGeneratorBase.java (modified) (1 diff)
- trunk/descent.tests/descent/tests/mars/Bugs_Test.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/descent.core/src/descent/core/dom/CompilationUnitResolver.java
r902 r907 37 37 public class CompilationUnitResolver extends descent.internal.compiler.Compiler { 38 38 39 private final static boolean RESOLVE = false;39 private final static boolean RESOLVE = true; 40 40 private final static boolean SYSOUT = false; 41 41 trunk/descent.core/src/descent/internal/compiler/parser/Lexer.java
r887 r907 5079 5079 int result = Character.codePointAt(input, p); 5080 5080 // increase p with the count of chars for the decoded codepoint. 5081 p = Character.offsetByCodePoints(input, 0, input.length, p, 1) ;5081 p = Character.offsetByCodePoints(input, 0, input.length, p, 1) - 1; 5082 5082 return result; 5083 5083 } catch (Exception e) { trunk/descent.core/src/descent/internal/compiler/parser/Parser.java
r902 r907 6910 6910 // TODO improve performance 6911 6911 StringTokenizer st = new StringTokenizer(new String(token.sourceString).substring(1)); 6912 if (st.countTokens() != 3) { 6912 int count = st.countTokens(); 6913 if (count <= 1 || count >= 4) { 6913 6914 error(IProblem.InvalidPragmaSyntax, token); 6914 6915 setMalformed(pragma); … … 6921 6922 value = st.nextToken(); 6922 6923 try { 6923 int num = Integer.parseInt(value); 6924 if (num <= 0) throw new NumberFormatException(); 6924 if (!"__LINE__".equals(value)) { 6925 int num = Integer.parseInt(value); 6926 if (num < 0) throw new NumberFormatException(); 6927 } 6925 6928 6926 value = st.nextToken(); 6927 if (!"__FILE__".equals(value)) { 6928 if (value.length() < 2 || value.charAt(0) != '"' || value.charAt(value.length() - 1) != '"') { 6929 error(IProblem.InvalidPragmaSyntax, token); 6930 setMalformed(pragma); 6929 if (st.hasMoreTokens()) { 6930 value = st.nextToken(); 6931 if (!"__FILE__".equals(value)) { 6932 if (value.length() < 2 || value.charAt(0) != '"' || value.charAt(value.length() - 1) != '"') { 6933 error(IProblem.InvalidPragmaSyntax, token); 6934 setMalformed(pragma); 6935 } 6931 6936 } 6932 6937 } trunk/descent.tests/descent/tests/dstress/DstressTestGeneratorBase.java
r890 r907 1503 1503 failures.add("typeof_17_C.d"); 1504 1504 1505 // These ones deals with encoding, but Eclipse already do that 1506 // for us... just ignore them, they work 1507 failures.add("encoding_utf_16be_bom.d"); 1508 failures.add("encoding_utf_16le.d"); 1509 failures.add("encoding_utf_16le_bom.d"); 1510 failures.add("encoding_utf_32le.d"); 1511 failures.add("encoding_utf_32le_bom.d"); 1512 failures.add("encoding_utf_8.d"); 1513 failures.add("encoding_utf_8_bom.d"); 1514 for(int i = 0; i <= 7; i++) { 1515 failures.add("unicode_0" + i + ".d"); 1516 } 1517 failures.add("eol_comment_07.d"); 1518 failures.add("eol_comment_08.d"); 1519 failures.add("eol_comment_09.d"); 1520 failures.add("eol_01.d"); 1521 failures.add("eol_02.d"); 1522 failures.add("eol_03.d"); 1505 1523 1506 1524 // Although they are not failures, Descent dies because of trunk/descent.tests/descent/tests/mars/Bugs_Test.java
r900 r907 325 325 } 326 326 327 public void testTicket25() { 328 String s; 329 330 s = "char[] s = \"°a\";"; 331 assertEquals(0, getCompilationUnit(s).problems.size()); 332 333 s = "char[] s = \"a°\";"; 334 assertEquals(0, getCompilationUnit(s).problems.size()); 335 } 336 327 337 public void testTypeSArray1() { 328 338 String s = "bool[2][4] b;";
