Changeset 1195
- Timestamp:
- 06/22/08 14:10:19 (2 months ago)
- Files:
-
- trunk/descent.core/src/descent/core/Flags.java (modified) (1 diff)
- trunk/descent.core/src/descent/core/Signature.java (modified) (4 diffs)
- trunk/descent.core/src/descent/core/dom/ASTConverter.java (modified) (1 diff)
- trunk/descent.core/src/descent/internal/codeassist/CompletionEngine.java (modified) (5 diffs)
- trunk/descent.core/src/descent/internal/codeassist/SelectionEngine.java (modified) (2 diffs)
- trunk/descent.core/src/descent/internal/codeassist/complete/CompletionParser.java (modified) (3 diffs)
- trunk/descent.core/src/descent/internal/compiler/parser/FuncDeclaration.java (modified) (1 diff)
- trunk/descent.core/src/descent/internal/compiler/parser/Parser.java (modified) (5 diffs)
- trunk/descent.core/src/descent/internal/compiler/parser/TemplateInstance.java (modified) (1 diff)
- trunk/descent.core/src/descent/internal/compiler/parser/Token.java (modified) (1 diff)
- trunk/descent.core/src/descent/internal/core/CompilationUnitStructureRequestor.java (modified) (1 diff)
- trunk/descent.core/src/descent/internal/formatter/CodeFormatterVisitor.java (modified) (1 diff)
- trunk/descent.tests/AllNonWorkbenchTests.java (modified) (3 diffs)
- trunk/descent.tests/descent/tests/assist/EnumMemberProposal_Test.java (modified) (1 diff)
- trunk/descent.tests/descent/tests/assist/FieldProposal_Test.java (modified) (6 diffs)
- trunk/descent.tests/descent/tests/assist/FunctionCallProposal_Test.java (modified) (1 diff)
- trunk/descent.tests/descent/tests/assist/TemplateProposal_Test.java (modified) (1 diff)
- trunk/descent.tests/descent/tests/assist/TemplatedAggregateProposal_Test.java (modified) (1 diff)
- trunk/descent.tests/descent/tests/assist/TemplatedFunctionProposal_Test.java (modified) (1 diff)
- trunk/descent.tests/descent/tests/assist/TypeProposal_Test.java (modified) (1 diff)
- trunk/descent.tests/descent/tests/binding/BindingExpression_Test.java (modified) (2 diffs)
- trunk/descent.tests/descent/tests/format/FormatEnumDeclaration_Test.java (modified) (1 diff)
- trunk/descent.tests/descent/tests/lookup/Lookup_Test.java (modified) (2 diffs)
- trunk/descent.tests/descent/tests/mangling/SignatureToCharArray_Test.java (modified) (2 diffs)
- trunk/descent.tests/descent/tests/mars/Comment_Test.java (modified) (1 diff)
- trunk/descent.tests/descent/tests/mars/ScannerTests.java (modified) (1 diff)
- trunk/descent.tests/descent/tests/model/HierarchyTest.java (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/descent.core/src/descent/core/Flags.java
r1171 r1195 220 220 * @since 2.0 221 221 */ 222 public static final int AccPostBlit = 0x00 100000;222 public static final int AccPostBlit = 0x00200000; // 0x00100000 is already taken by AccTemplate 223 223 224 224 // Extensions for fields (can reuse flags) trunk/descent.core/src/descent/core/Signature.java
r1191 r1195 1020 1020 sb.append(C_STATIC_ARRAY); 1021 1021 sb.append(type); 1022 sb.append(C_STATIC_ARRAY );1022 sb.append(C_STATIC_ARRAY2); 1023 1023 sb.append(dimension.length()); 1024 1024 sb.append(C_STATIC_ARRAY); … … 1040 1040 ret[0] = C_STATIC_ARRAY; 1041 1041 System.arraycopy(type, 0, ret, 1, type.length); 1042 ret[type.length + 1] = C_STATIC_ARRAY ;1042 ret[type.length + 1] = C_STATIC_ARRAY2; 1043 1043 copyNumber(dimensionLength, dimensionLengthStringLength, ret, 2 + type.length); 1044 1044 ret[2 + type.length + dimensionLengthStringLength] = C_STATIC_ARRAY; … … 1143 1143 sb.append(C_SLICE); 1144 1144 sb.append(type); 1145 sb.append(C_SLICE );1145 sb.append(C_SLICE2); 1146 1146 sb.append(lower.length()); 1147 1147 sb.append(C_SLICE); … … 1170 1170 ret[0] = C_SLICE; 1171 1171 System.arraycopy(type, 0, ret, 1, type.length); 1172 ret[type.length + 1] = C_SLICE ;1172 ret[type.length + 1] = C_SLICE2; 1173 1173 1174 1174 copyNumber(lowerLength, lowerLengthStringLength, ret, 2 + type.length); trunk/descent.core/src/descent/core/dom/ASTConverter.java
r1168 r1195 1473 1473 IdentifierExp name = a.names.get(i); 1474 1474 SelectiveImport selective = new SelectiveImport(ast); 1475 selective.setName((SimpleName) convert(name)); 1475 if (name != null && name.ident != null) { 1476 selective.setName((SimpleName) convert(name)); 1477 } 1476 1478 if (alias == null) { 1477 1479 setSourceRange(selective, name.start, name.length); trunk/descent.core/src/descent/internal/codeassist/CompletionEngine.java
r1192 r1195 272 272 273 273 Scope rootScope; 274 275 int INCLUDE_TYPES = 1; 276 int INCLUDE_VARIABLES = 2; 277 int INCLUDE_FUNCTIONS = 4; 278 int INCLUDE_CONSTRUCTORS = 8; 279 int INCLUDE_OPCALL = 16; 280 int INCLUDE_IMPORTS = 32; 281 int INCLUDE_ALL = INCLUDE_TYPES | INCLUDE_VARIABLES | INCLUDE_FUNCTIONS | INCLUDE_IMPORTS; 274 int includesFilter; 275 276 private final static int INCLUDE_TYPES = 1; 277 private final static int INCLUDE_VARIABLES = 2; 278 private final static int INCLUDE_FUNCTIONS = 4; 279 private final static int INCLUDE_CONSTRUCTORS = 8; 280 private final static int INCLUDE_OPCALL = 16; 281 private final static int INCLUDE_IMPORTS = 32; 282 private final static int INCLUDE_ALL = INCLUDE_TYPES | INCLUDE_VARIABLES | INCLUDE_FUNCTIONS | INCLUDE_IMPORTS; 282 283 283 284 /** … … 1370 1371 endPosition = actualCompletionPosition; 1371 1372 1373 includesFilter = INCLUDE_VARIABLES; 1372 1374 completeScope(rootScope, INCLUDE_ALL); 1375 includesFilter = 0; 1373 1376 1374 1377 if (wantOverrides) { … … 1411 1414 } 1412 1415 } else { 1416 includesFilter = INCLUDE_VARIABLES; 1413 1417 completeNode(node.baseclasses.get(baseClassIndex).type); 1418 includesFilter = 0; 1414 1419 } 1415 1420 } … … 2004 2009 2005 2010 private void suggestMember(Dsymbol member, char[] ident, boolean onlyStatics, long flags, HashtableOfCharArrayAndObject funcSignatures, int includes, boolean isAliased) { 2011 if (includesFilter != 0) { 2012 includes &= ~includesFilter; 2013 } 2014 2006 2015 // The member may not have it's semantic pass done 2007 2016 member.consumeRestStructure(); … … 2358 2367 } 2359 2368 2360 if (! parser.inNewExp && (includes & INCLUDE_FUNCTIONS) != 0 ||2369 if (!isCompletingTypeIdentifier && !parser.inNewExp && (includes & INCLUDE_FUNCTIONS) != 0 || 2361 2370 ((includes & (INCLUDE_CONSTRUCTORS | INCLUDE_OPCALL)) != 0 && wantConstructorsAndOpCall)) { 2362 2371 // See if it's a function trunk/descent.core/src/descent/internal/codeassist/SelectionEngine.java
r1171 r1195 44 44 import descent.internal.compiler.parser.Token; 45 45 import descent.internal.compiler.parser.Type; 46 import descent.internal.compiler.parser.TypeClass; 46 47 import descent.internal.compiler.parser.TypeExp; 47 48 import descent.internal.compiler.parser.TypedefDeclaration; … … 439 440 addBinarySearch(ctor); 440 441 } 442 } else if (node.newtype != null) { 443 if (node.newtype.getJavaElement() != null) { 444 addJavaElement(node.newtype.getJavaElement()); 445 } else if (node.newtype instanceof TypeClass){ 446 addBinarySearch(((TypeClass) node.newtype).sym); 447 } 441 448 } 442 449 return false; trunk/descent.core/src/descent/internal/codeassist/complete/CompletionParser.java
r1192 r1195 468 468 @Override 469 469 protected DotIdExp newDotIdExp(Loc loc, Expression e, IdentifierExp id) { 470 Token pivot; 470 471 if (prevToken.ptr <= cursorLocation && cursorLocation <= prevToken.ptr + prevToken.sourceLen) { 471 if (cursorLocation <= id.start) { 472 assistNode = new CompletionOnDotIdExp(loc, e, new IdentifierExp(CharOperation.NO_CHAR)); 473 return (DotIdExp) assistNode; 474 } else { 475 completionTokenStart = prevToken.ptr; 476 completionTokenEnd = prevToken.ptr + prevToken.sourceLen; 477 completionToken = CharOperation.subarray(input, completionTokenStart, cursorLocation); 478 479 assistNode = new CompletionOnDotIdExp(loc, e, id); 480 return (DotIdExp) assistNode; 481 } 472 pivot = prevToken; 473 } else if (token.ptr <= cursorLocation && cursorLocation <= token.ptr + token.sourceLen) { 474 pivot = token; 482 475 } else { 483 476 return super.newDotIdExp(loc, e, id); 477 } 478 479 if (cursorLocation <= id.start) { 480 assistNode = new CompletionOnDotIdExp(loc, e, new IdentifierExp(CharOperation.NO_CHAR)); 481 return (DotIdExp) assistNode; 482 } else { 483 completionTokenStart = pivot.ptr; 484 completionTokenEnd = pivot.ptr + pivot.sourceLen; 485 completionToken = CharOperation.subarray(input, completionTokenStart, cursorLocation); 486 487 assistNode = new CompletionOnDotIdExp(loc, e, id); 488 return (DotIdExp) assistNode; 484 489 } 485 490 } … … 869 874 } 870 875 876 // If it's class NOT_IDENTIFIER and the cursor is after class, we don't want assist 877 if (prevToken.value == TOK.TOKclass && token.value != TOK.TOKidentifier) { 878 this.wantAssist = false; 879 this.wantKeywords = false; 880 return super.newClassDeclaration(loc, id, baseClasses); 881 } 882 871 883 if (baseClasses != null) { 872 884 int i = 0; … … 913 925 } 914 926 927 // If it's interface NOT_IDENTIFIER and the cursor is after class, we don't want assist 928 if (prevToken.value == TOK.TOKinterface && token.value != TOK.TOKidentifier) { 929 this.wantAssist = false; 930 this.wantKeywords = false; 931 return super.newClassDeclaration(loc, id, baseClasses); 932 } 933 915 934 if (baseClasses != null) { 916 935 int i = 0; trunk/descent.core/src/descent/internal/compiler/parser/FuncDeclaration.java
r1189 r1195 1808 1808 // Descent: for binding resolution 1809 1809 arg.var = v; 1810 if (type instanceof TypeFunction) { 1811 TypeFunction tf = (TypeFunction) type; 1812 if (tf.parameters != null && i < tf.parameters.size()) { 1813 tf.parameters.get(i).var = v; 1814 } 1815 } 1816 if (sourceType instanceof TypeFunction) { 1817 TypeFunction tf = (TypeFunction) sourceType; 1818 if (tf.parameters != null && i < tf.parameters.size()) { 1819 tf.parameters.get(i).var = v; 1820 } 1821 } 1810 1822 1811 1823 v.storage_class |= STCparameter; trunk/descent.core/src/descent/internal/compiler/parser/Parser.java
r1194 r1195 2208 2208 2209 2209 // Get array of TemplateParameters 2210 if ((apiLevel < D2 && token.value != TOKrparen) || (apiLevel == D2 && flag != 0 && token.value != TOKrparen)) {2210 if ((apiLevel < D2 && token.value != TOKrparen) || (apiLevel == D2 && (flag != 0 || token.value != TOKrparen))) { 2211 2211 2212 2212 boolean isvariadic = false; … … 2646 2646 } 2647 2647 s = addImportAlias(s, name, alias); 2648 decldefs.add(s);2649 2648 s.setSourceRange(sStart, prevToken.ptr + prevToken.sourceLen - sStart); 2650 2649 } while (token.value == TOKcomma); 2650 2651 decldefs.add(s); 2652 2651 2653 break; // no comma-separated imports of this form 2652 2654 } else { … … 7673 7675 return tok; 7674 7676 } 7677 7678 @Override 7679 public Token peek(Token ct) { 7680 Token tok = super.peek(ct); 7681 while(tok != null && 7682 (tok.value == TOK.TOKlinecomment || tok.value == TOK.TOKblockcomment || tok.value == TOKpluscomment || 7683 tok.value == TOK.TOKdoclinecomment || tok.value == TOK.TOKdocblockcomment || tok.value == TOKdocpluscomment)) { 7684 tok = super.peek(tok); 7685 } 7686 return tok; 7687 } 7675 7688 7676 7689 @Override … … 7687 7700 7688 7701 private void attachCommentToCurrentToken(Comment comment) { 7689 if ((!appendLeadingComments 7690 // || 7691 // //!comment.isDDocComment() || 7692 // (prevToken.value != TOKsemicolon && 7693 // prevToken.value != TOKrcurly && 7694 // prevToken.value != TOKcomma && 7695 // prevToken.value != TOKidentifier)) 7696 )) { 7702 if (!appendLeadingComments || prevToken.value == null || 7703 prevToken.value == TOK.TOKlcurly) { 7697 7704 return; 7698 7705 } … … 7961 7968 7962 7969 protected Import addImportAlias(Import s, IdentifierExp name, IdentifierExp alias) { 7963 if (name != null &&alias != null) {7970 if (name != null || alias != null) { 7964 7971 s.addAlias(name, alias); 7965 7972 } trunk/descent.core/src/descent/internal/compiler/parser/TemplateInstance.java
r1189 r1195 45 45 this.loc = loc; 46 46 this.name = id; 47 this.name.templateInstance = this; 47 if (this.name != null) { 48 this.name.templateInstance = this; 49 } 48 50 this.encoder = encoder; 49 51 } trunk/descent.core/src/descent/internal/compiler/parser/Token.java
r1160 r1195 76 76 77 77 public void setString(char[] input, int start, int length) { 78 if (start + length >= input.length) { 79 length = input.length - start; 80 } 81 78 82 this.sourceString = new char[length]; 79 83 System.arraycopy(input, start, this.sourceString, 0, length); trunk/descent.core/src/descent/internal/core/CompilationUnitStructureRequestor.java
r1194 r1195 444 444 parameterNames[i] = manager.intern(parameterNames[i]); 445 445 info.setArgumentNames(parameterNames); 446 char[] returnType = methodInfo.returnType == null ? new char[]{'v' , 'o','i', 'd'} : methodInfo.returnType;446 char[] returnType = methodInfo.returnType == null ? new char[]{'v'} : methodInfo.returnType; 447 447 info.setReturnType(manager.intern(returnType)); 448 448 info.setParameterDefaultValues(methodInfo.parameterDefaultValues); trunk/descent.core/src/descent/internal/formatter/CodeFormatterVisitor.java
r1073 r1195 78 78 } catch (AbortFormatting e) 79 79 { 80 e.printStackTrace(); 80 81 return failedToFormat(e); 81 82 } trunk/descent.tests/AllNonWorkbenchTests.java
r1124 r1195 74 74 import descent.tests.mars.Recovery_Tests; 75 75 import descent.tests.mars.ScannerTests; 76 import descent.tests.mars.SourceElementParserTest;77 76 import descent.tests.mars.Statement_Test; 78 77 import descent.tests.mars.Struct_Test; … … 131 130 | LEXER_PARSER 132 131 | SIGNATURE 133 | REWRITE132 // | REWRITE 134 133 | TRACE 135 134 ; … … 213 212 suite.addTestSuite(ScannerTests.class); 214 213 // suite.addTestSuite(Semantic1_Test.class); 215 suite.addTestSuite(SourceElementParserTest.class);216 214 suite.addTestSuite(Statement_Test.class); 217 215 suite.addTestSuite(Struct_Test.class); trunk/descent.tests/descent/tests/assist/EnumMemberProposal_Test.java
r1105 r1195 2 2 3 3 public class EnumMemberProposal_Test extends AbstractCompletionTest { 4 5 public void test() throws Exception { 6 7 } 4 8 5 9 } trunk/descent.tests/descent/tests/assist/FieldProposal_Test.java
r1124 r1195 12 12 assertCompletions(null, "test.d", s, pos, CompletionProposal.FIELD_REF, 13 13 new int[] { SIGNATURE, TYPE_SIGNATURE, DECLARATION_SIGNATURE, LABEL }, 14 "wxyz", pos, pos, "@4test /4wxyz", "i", "@4test", "wxyz int - test");14 "wxyz", pos, pos, "@4testB4wxyz", "i", "@4test", "wxyz int - test"); 15 15 } 16 16 … … 24 24 assertCompletions(null, "test.d", s, pos, CompletionProposal.FIELD_REF, 25 25 new int[] { SIGNATURE, TYPE_SIGNATURE, DECLARATION_SIGNATURE, LABEL }, 26 "wxyz", pos, pos, "@3one3two5three /4wxyz", "i", "@3one3two5three", "wxyz int - one.two.three");26 "wxyz", pos, pos, "@3one3two5threeB4wxyz", "i", "@3one3two5three", "wxyz int - one.two.three"); 27 27 } 28 28 … … 34 34 assertCompletions(null, "test.d", s, pos, CompletionProposal.FIELD_REF, 35 35 new int[] { SIGNATURE, TYPE_SIGNATURE, DECLARATION_SIGNATURE, LABEL }, 36 "wxyz", pos - 1, pos, "@4test /4wxyz", "i", "@4test", "wxyz int - test");36 "wxyz", pos - 1, pos, "@4testB4wxyz", "i", "@4test", "wxyz int - test"); 37 37 } 38 38 … … 44 44 assertCompletions(null, "test.d", s, pos, CompletionProposal.FIELD_REF, 45 45 new int[] { SIGNATURE, TYPE_SIGNATURE, DECLARATION_SIGNATURE, LABEL }, 46 "wxyz", pos, pos, "@4test /4wxyz", "@4testC9SomeClass", "@4test", "wxyz SomeClass - test");46 "wxyz", pos, pos, "@4testB4wxyz", "@4testC9SomeClass", "@4test", "wxyz SomeClass - test"); 47 47 } 48 48 … … 70 70 assertCompletions(null, "test.d", s, pos, CompletionProposal.FIELD_REF, 71 71 new int[] { SIGNATURE, TYPE_SIGNATURE, DECLARATION_SIGNATURE, LABEL }, 72 "wxyz", pos - 1, pos, "@4testC9SomeClass /4wxyz", "i", "@4testC9SomeClass", "wxyz int - SomeClass"72 "wxyz", pos - 1, pos, "@4testC9SomeClassB4wxyz", "i", "@4testC9SomeClass", "wxyz int - SomeClass" 73 73 ); 74 74 } … … 117 117 assertCompletions(null, "test.d", s, pos, CompletionProposal.FIELD_REF, 118 118 new int[] { SIGNATURE, TYPE_SIGNATURE, DECLARATION_SIGNATURE, LABEL }, 119 "wxyz", pos, pos, "@4test /4wxyz", "@4test<9SomeClass#'!^i'", "@4test", "wxyz SomeClass!(int) - test");119 "wxyz", pos, pos, "@4testB4wxyz", "@4test<9SomeClass#'!^i'", "@4test", "wxyz SomeClass!(int) - test"); 120 120 } 121 121 trunk/descent.tests/descent/tests/assist/FunctionCallProposal_Test.java
r1105 r1195 2 2 3 3 public class FunctionCallProposal_Test extends AbstractCompletionTest { 4 5 public void test() throws Exception { 6 7 } 4 8 5 9 } trunk/descent.tests/descent/tests/assist/TemplateProposal_Test.java
r1105 r1195 2 2 3 3 public class TemplateProposal_Test extends AbstractCompletionTest { 4 5 public void test() throws Exception { 6 7 } 4 8 5 9 } trunk/descent.tests/descent/tests/assist/TemplatedAggregateProposal_Test.java
r1105 r1195 2 2 3 3 public class TemplatedAggregateProposal_Test extends AbstractCompletionTest { 4 5 public void test() throws Exception { 6 7 } 4 8 5 9 } trunk/descent.tests/descent/tests/assist/TemplatedFunctionProposal_Test.java
r1105 r1195 2 2 3 3 public class TemplatedFunctionProposal_Test extends AbstractCompletionTest { 4 5 public void test() throws Exception { 6 7 } 4 8 5 9 } trunk/descent.tests/descent/tests/assist/TypeProposal_Test.java
r1105 r1195 2 2 3 3 public class TypeProposal_Test extends AbstractCompletionTest { 4 5 public void test() throws Exception { 6 7 } 4 8 5 9 } trunk/descent.tests/descent/tests/binding/BindingExpression_Test.java
r1096 r1195 11 11 12 12 13 public class BindingExpression_Test extends AbstractBinding_Test {13 public class BindingExpression_Test extends AbstractBinding_Test { 14 14 15 15 public void testExpression(String expString, String expectedSignature) throws Exception { … … 47 47 48 48 public void testString() throws Exception { 49 testExpression("\"hey\"", "Ga G1G3");49 testExpression("\"hey\"", "Ga&1G3"); 50 50 } 51 51 52 52 public void testStrings() throws Exception { 53 testExpression("\"hey\" \"you\"", "Ga G1G6");53 testExpression("\"hey\" \"you\"", "Ga&1G6"); 54 54 } 55 55 trunk/descent.tests/descent/tests/format/FormatEnumDeclaration_Test.java
r456 r1195 101 101 "\ty, // comment\r\n" + 102 102 "\tz // comment\r\n" + 103 "}", 103 "}", 104 104 105 105 "/*\r\n" + trunk/descent.tests/descent/tests/lookup/Lookup_Test.java
r1124 r1195 1 1 package descent.tests.lookup; 2 3 import java.util.Hashtable; 4 5 import descent.core.JavaCore; 2 6 3 7 /* … … 6 10 */ 7 11 public class Lookup_Test extends AbstractLookupTest { 12 13 @Override 14 protected void setUp() throws Exception { 15 Hashtable opts = JavaCore.getOptions(); 16 opts.put(JavaCore.COMPILER_SHOW_SEMANTIC_ERRORS, "2"); 17 JavaCore.setOptions(opts); 18 19 super.setUp(); 20 } 8 21 9 22 public void testExtern() throws Exception { trunk/descent.tests/descent/tests/mangling/SignatureToCharArray_Test.java
r1126 r1195 58 58 59 59 public void testIdentifier() { 60 tca("B ar.Buzz", IDENTIFIER + "3Bar4Buzz");60 tca("Buzz", IDENTIFIER + "3Bar4Buzz"); 61 61 } 62 62 … … 142 142 143 143 public void testTemplateInstance() { 144 tca("B ar.Buzz!()", IDENTIFIER + "3Bar4Buzz" + TEMPLATE_INSTANCE + TEMPLATE_PARAMETERS_BREAK);144 tca("Buzz!()", IDENTIFIER + "3Bar4Buzz" + TEMPLATE_INSTANCE + TEMPLATE_PARAMETERS_BREAK); 145 145 } 146 146 147 147 public void testTemplateInstanceSymbol() { 148 tca("B ar.Buzz!(int)", IDENTIFIER + "3Bar4Buzz" + TEMPLATE_INSTANCE + TEMPLATE_INSTANCE_SYMBOL + i + TEMPLATE_PARAMETERS_BREAK);148 tca("Buzz!(int)", IDENTIFIER + "3Bar4Buzz" + TEMPLATE_INSTANCE + TEMPLATE_INSTANCE_SYMBOL + i + TEMPLATE_PARAMETERS_BREAK); 149 149 } 150 150 151 151 public void testTemplateInstanceType() { 152 tca("B ar.Buzz!(int)", IDENTIFIER + "3Bar4Buzz" + TEMPLATE_INSTANCE + TEMPLATE_INSTANCE_TYPE + i + TEMPLATE_PARAMETERS_BREAK);152 tca("Buzz!(int)", IDENTIFIER + "3Bar4Buzz" + TEMPLATE_INSTANCE + TEMPLATE_INSTANCE_TYPE + i + TEMPLATE_PARAMETERS_BREAK); 153 153 } 154 154 155 155 public void testTemplateInstanceValue() { 156 tca("B ar.Buzz!(3)", IDENTIFIER + "3Bar4Buzz" + TEMPLATE_INSTANCE + TEMPLATE_INSTANCE_VALUE + '1' + TEMPLATE_INSTANCE_VALUE + '3' + i + TEMPLATE_PARAMETERS_BREAK);156 tca("Buzz!(3)", IDENTIFIER + "3Bar4Buzz" + TEMPLATE_INSTANCE + TEMPLATE_INSTANCE_VALUE + '1' + TEMPLATE_INSTANCE_VALUE + '3' + i + TEMPLATE_PARAMETERS_BREAK); 157 157 } 158 158 159 159 public void testTemplateInstanceManyTypes() { 160 tca("B ar.Buzz!(int, char)", IDENTIFIER + "3Bar4Buzz" + TEMPLATE_INSTANCE + TEMPLATE_INSTANCE_TYPE + i + TEMPLATE_INSTANCE_TYPE + a + TEMPLATE_PARAMETERS_BREAK);160 tca("Buzz!(int, char)", IDENTIFIER + "3Bar4Buzz" + TEMPLATE_INSTANCE + TEMPLATE_INSTANCE_TYPE + i + TEMPLATE_INSTANCE_TYPE + a + TEMPLATE_PARAMETERS_BREAK); 161 161 } 162 162 trunk/descent.tests/descent/tests/mars/Comment_Test.java
r1095 r1195 5 5 import descent.core.dom.AggregateDeclaration; 6 6 import descent.core.dom.AliasDeclaration; 7 import descent.core.dom.CompilationUnit; 7 8 import descent.core.dom.DDocComment; 8 import descent.core.dom.CompilationUnit;9 9 import descent.core.dom.Declaration; 10 10 import descent.core.dom.ModuleDeclaration; 11 11 import descent.core.dom.TypedefDeclaration; 12 12 import descent.core.dom.VariableDeclaration; 13 import descent.internal.compiler.parser.VarDeclaration;14 13 15 14 public class Comment_Test extends Parser_Test { trunk/descent.tests/descent/tests/mars/ScannerTests.java
r1116 r1195 75 75 case TOKarraylength: 76 76 case TOKblit: 77 case TOKtls: 78 case TOKline: 79 case TOKfile: 77 80 continue; 78 81 } trunk/descent.tests/descent/tests/model/HierarchyTest.java
r1021 r1195 66 66 67 67 imp = (IImportDeclaration) imports[0]; 68 assertEquals(" foo =one", imp.getElementName());68 assertEquals("one", imp.getElementName()); 69 69 assertEquals("import foo = one", imp.getSource()); 70 70 assertEquals(1, imp.getSourceRange().getOffset()); … … 72 72 73 73 imp = (IImportDeclaration) imports[1]; 74 assertEquals("two : three", imp.getElementName());74 assertEquals("two", imp.getElementName()); 75 75 assertEquals("two : three;", imp.getSource()); 76 76 assertEquals(19, imp.getSourceRange().getOffset()); … … 127 127 assertFalse(type.isStruct()); 128 128 assertFalse(type.isUnion()); 129 assert False(type.isTemplate());129 assertTrue(type.isTemplate()); 130 130 assertEquals("Clazz1", type.getElementName()); 131 131 assertEquals(1, type.getSourceRange().getOffset()); … … 249 249 assertFalse(method.isNew()); 250 250 assertFalse(method.isDelete()); 251 assertTrue(method.isTemplate()); 251 252 assertEquals(16, method.getSourceRange().getOffset()); 252 253 assertEquals(34, method.getSourceRange().getLength()); … … 341 342 assertEquals(16, method.getJavadocRanges()[0].getOffset()); 342 343 assertEquals(11, method.getJavadocRanges()[0].getLength()); 343 assertEquals(" ", method.getElementName());344 assertEquals("new", method.getElementName()); 344 345 assertEquals(1, method.getNumberOfParameters()); 345 346 assertEquals(1, method.getParameterNames().length); … … 371 372 assertEquals(16, method.getJavadocRanges()[0].getOffset()); 372 373 assertEquals(11, method.getJavadocRanges()[0].getLength()); 373 assertEquals(" ", method.getElementName());374 assertEquals("delete", method.getElementName()); 374 375 assertEquals(1, method.getNumberOfParameters()); 375 376 assertEquals(1, method.getParameterNames().length);
