Changeset 1157

Show
Ignore:
Timestamp:
05/06/08 18:43:35 (4 months ago)
Author:
asterite
Message:

expression.c ported to DMD 1.028.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/descent.core/src/descent/core/JavaCore.java

    r1029 r1157  
    9292import org.eclipse.core.runtime.IPath; 
    9393import org.eclipse.core.runtime.IProgressMonitor; 
     94import org.eclipse.core.runtime.OperationCanceledException; 
    9495import org.eclipse.core.runtime.Platform; 
    9596import org.eclipse.core.runtime.Plugin; 
     
    101102 
    102103import descent.core.compiler.CharOperation; 
     104import descent.core.search.IJavaSearchConstants; 
     105import descent.core.search.IJavaSearchScope; 
     106import descent.core.search.SearchEngine; 
     107import descent.core.search.SearchPattern; 
     108import descent.core.search.TypeNameRequestor; 
    103109import descent.internal.compiler.util.SuffixConstants; 
    104110import descent.internal.core.BatchOperation; 
     
    28942900        try { 
    28952901            if (monitor != null) monitor.beginTask(Messages.javamodel_initialization, 100); 
    2896             /* TODO JDT search 
    28972902            // dummy query for waiting until the indexes are ready and classpath containers/variables are initialized 
    28982903            SearchEngine engine = new SearchEngine(); 
     
    29062911                    scope,  
    29072912                    new TypeNameRequestor() { 
    2908                         public void acceptType( 
    2909                             int modifiers, 
    2910                             char[] packageName, 
    2911                             char[] simpleTypeName, 
    2912                             char[][] enclosingTypeNames, 
    2913                             String path) { 
     2913                        @Override 
     2914                        public void acceptType(long modifiers, char[] packageName, char[] simpleTypeName, char[][] enclosingTypeNames, String path) { 
    29142915                            // no type to accept 
    29152916                        } 
     
    29272928                // else indexes were not ready: catch the exception so that jars are still refreshed 
    29282929            } 
    2929             */ 
    29302930             
    29312931            // check if the build state version number has changed since last session 
  • trunk/descent.core/src/descent/core/compiler/IProblem.java

    r1155 r1157  
    481481    int CalledWithArgumentTypesMatchesBoth = 270; 
    482482    int SymbolIsNotAnArithmeticType = 271; 
    483     int CannotPerformModuloComplexArithmetic = 272; 
    484     int OperatorNotAllowedOnBoolExpression = 273; 
    485     int ForeachKeyTypeMustBeIntOrUint = 274; 
    486     int ForeachKeyCannotBeOutOrRef = 275; 
    487     int NoReverseIterationOnAssociativeArrays = 276; 
    488     int OnlyOneOrTwoArgumentsForAssociativeArrayForeach = 277; 
    489     int OnlyOneOrTwoArgumentsForArrayForeach = 278; 
    490     int ForeachTargetIsNotAnArrayOf = 279; 
    491     int ForeachValueCannotBeOutAndTypeBit = 280; 
    492     int ForeachKeyCannotBeInout = 281; 
    493     int ForeachValueOfUTFConversionCannotBeInout = 282; 
    494     int CannotInferTypeForSymbol = 283; 
    495     int CannotInferTypeFromInitializer = 284; 
    496     int NoStorageClassForSymbol = 285; 
    497     int OnlyOneValueOrTwoKeyValueArgumentsForTupleForeach = 286; 
    498     int CannotUniquelyInferForeachArgumentTypes = 287; 
    499     int InvalidForeachAggregate = 288; 
    500     int NotAnAssociativeArrayInitializer = 289; 
    501     int ArrayInitializersAsExpressionsNotAllowed = 290; 
    502     int IftypeConditionCannotBeAtGlobalScope = 291; 
    503     int SymbolIsNotAFieldOfSymbol = 292; 
    504     int RecursiveTemplateExpansion = 293; 
    505     int RecursiveTemplateExpansionForTemplateArgument = 294; 
    506     int IndexIsNotATypeOrExpression = 295; 
    507     int CannotHavePointerToSymbol = 296; 
    508     int SizeOfTypeIsNotKnown = 297; 
    509     int CanOnlySliceTupleTypes = 298; 
    510     int NoPropertyForTuple = 299; 
    511     int CannotResolveDotProperty = 300; 
    512     int CannotTakeAddressOfBitInArray = 301; 
    513     int OnlyOneIndexAllowedToIndex = 302; 
    514     int NoOpIndexOperatorOverloadForType = 303; 
    515     int ArrayDimensionOverflow = 304; 
    516     int OperatorAssignmentOverloadWithOpIndexIllegal = 305; 
    517     int CannotHaveOutOrInoutArgumentOfBitInArray = 306; 
    518     int SymbolIsAliasedToAFunction = 307; 
    519     int LinkageDoesNotMatchInterfaceFunction = 308; 
    520     int InterfaceFunctionIsNotImplemented = 309; 
    521     int ExpectedKeyAsArgumentToRemove = 310; 
    522     int CyclicConstructorCall = 311; 
    523     int MissingOrCurruptObjectDotD = 312; 
    524     int CannotContinueOutOfFinallyBlock = 313; 
    525     int ForwardDeclaration = 314; 
    526     int CannotFormDelegateDueToCovariantReturnType = 315; 
    527     int ForeachRangeKeyCannotHaveStorageClass = 316; 
    528     int MultipleOverridesOfSameFunction = 317; 
    529     int IdentityAssignmentOperatorOverloadIsIllegal = 318; 
    530     int LiteralsCannotBeClassMembers = 319; 
    531     int NoMatchForImplicitSuperCallInConstructor = 320; 
    532     int NoReturnAtEndOfFunction = 321; 
    533     int CanOnlyDeclareTypeAliasesWithinStaticIfConditionals = 322; 
    534     int PackageAndModuleHaveTheSameName = 323; 
    535     int StringLiteralsAreImmutable = 324; 
    536     int ExpressionDotNewIsOnlyForAllocatingNestedClasses = 325; 
    537     int TooManyArgumentsForArray = 326; 
    538     int ReturnExpressionExpected = 327; 
    539     int ReturnWithoutCallingConstructor = 328; 
    540     int ModuleIsInMultiplePackages = 329; 
    541     int ModuleIsInMultipleDefined = 330; 
    542     int NeedUpperAndLowerBoundToSlicePointer = 331; 
    543     int NeedUpperAndLowerBoundToSliceTuple = 332; 
    544     int CannotConvertStringLiteralToVoidPointer = 333; 
    545     int SymbolIsNotAPreInstanceInitializableField = 334; 
    546     int NoCaseStatementFollowingGoto = 335; 
    547     int SwitchStatementHasNoDefault = 336; 
    548     int SymbolIsNotAFunctionTemplate = 337; 
    549     int TupleIsNotAValidTemplateValueArgument = 338; 
    550     int IncompatibleArgumentsForTemplateInstantiation = 339; 
    551     int ThrowStatementsCannotBeInContracts = 340; 
    552     int CanOnlyThrowClassObjects = 341; 
    553     int StringExpectedAsSecondArgument = 342; 
    554     int WrongNumberOfArguments = 343; 
    555     int StringMustBeChars = 344; 
    556     int InvalidFirstArgument = 345; 
    557     int FirstArgumentIsNotAClass = 346; 
    558     int ArgumentHasNoMembers = 347; 
    559     int SymbolHasNoMembers = 348; 
    560     int KindSymbolHasNoMembers = 349; 
    561     int DotOffsetDeprecated = 350; 
    562     int NoClassInfoForComInterfaceObjects = 351; 
    563     int CannotMakeReferenceToABit = 352; 
    564     int CannotFormTupleOfTuples = 353; 
    565     int MissingInitializerInStaticConstructorForConstVariable = 354; 
    566     int GlobalsStaticsFieldsRefAndAutoParametersCannotBeAuto = 355; 
    567     int ReferenceToScopeClassMustBeScope = 356; 
    568     int NumberOfKeysMustMatchNumberOfValues = 357; 
    569     int ExpectedNumberArguments = 358; 
    570     int ArraySliceIfOutOfBounds = 359; 
    571     int InvalidUCS32Char = 360; 
    572     int TupleIndexExceedsBounds = 361; 
    573     int SliceIsOutOfRange = 362; 
    574     int CannotTakeAddressOf = 363; 
    575     int VariableIsUsedBeforeInitialization = 364; 
    576     int EscapingReferenceToLocal = 365; 
    577     int EscapingReferenceToAutoLocal = 366; 
    578     int EscapingReferenceToLocalVariable = 367; 
    579     int EscapingReferenceToVariadicParameter = 368; 
    580     int CanOnlyCatchClassObjects = 369; 
    581     int BaseClassIsForwardReferenced = 370; 
    582     int BaseIsForwardReferenced = 371; 
    583     int CannotInheritFromFinalClass = 372; 
    584     int StaticClassCannotInheritFromNestedClass = 373; 
    585     int SuperClassIsNestedWithin = 374; 
    586     int ArrayComparisonTypeMismatch = 375; 
    587     int ConditionalExpressionIsNotAModifiableLvalue = 376; 
    588     int CannotCastSymbolToSymbol = 377; 
    589     int CannotDeleteInstanceOfComInterface = 378; 
    590     int TemplateIsNotAMemberOf = 379; 
    591     int TemplateIdentifierIsNotAMemberOf = 380; 
    592     int CanOnlyInitiailizeConstMemberInsideConstructor = 381; 
    593     int SymbolIsNotAMember = 382; 
    594     int SymbolIsNotATemplate = 383; 
    595     int DSymbolHasNoSize = 384; 
    596     int ExpressionOfTypeDoesNotHaveABooleanValue = 385; 
    597     int ImplicitConversionCanCauseLossOfData = 386; 
    598     int ForwardReferenceToType = 387; 
    599     int FloatingPointConstantExpressionExpected = 388; 
    600     int ExpressionIsNotAValidTemplateValueArgument = 389; 
    601     int InvalidRangeLowerBound = 390; 
    602     int InvalidRangeUpperBound = 391; 
    603     int SymbolIsNotAScalarType = 392; 
    604     int ForeachIndexMustBeType = 393; 
    605     int ForeachValueMustBeType = 394; 
    606     int OpApplyFunctionMustReturnAnInt = 395; 
    607     int FunctionOfTypeOverridesButIsNotCovariant = 396; 
    608     int CannotOverrideFinalFunction = 397; 
    609     int IncompatibleCovariantTypes = 398; 
    610     int CannotUseTemplateToAddVirtualFunctionToClass = 399; 
    611     int OutResultIsAlreadyDefined = 400; 
    612     int MissingInitializerForConstField = 401; 
    613     int ImportNotFound = 402; 
    614     int SymbolMustBeAnArrayOfPointerType = 403; 
    615     int RvalueOfInExpressionMustBeAnAssociativeArray = 404; 
    616     int InterfaceInheritsFromDuplicateInterface = 405; 
    617     int LabelIsAlreadyDefined = 406; 
    618     int CannotSubtractPointerFromSymbol = 407; 
    619     int ThisForNestedClassMustBeAClassType = 408; 
    620     int CanOnlyDereferenceAPointer = 409; 
    621     int OuterClassThisNeededToNewNestedClass = 410; 
    622     int ThisForNestedClassMustBeOfType = 411; 
    623     int NoConstructorForSymbol = 412; 
    624     int NoAllocatorForSymbol = 413; 
    625     int NegativeArrayIndex = 414; 
    626     int NewCanOnlyCreateStructsDynamicArraysAndClassObjects = 415; 
    627     int MismatchedFunctionReturnTypeInference = 416; 
    628     int ShiftLeftExceeds = 417; 
    629     int SymbolCannotBeSlicedWithBrackets = 418; 
    630     int SliceExpressionIsNotAModifiableLvalue = 419; 
    631     int SymbolIsNotAMemberOf = 420; 
    632     int MoreInitiailizersThanFields = 421; 
    633     int OverlappingInitiailization = 422; 
    634     int CannotMakeExpressionOutOfInitializer = 423; 
    635     int NoDefaultOrCaseInSwitchStatement = 424; 
    636     int SymbolIsNotASymbol = 425; 
    637     int ForwardReferenceToTemplate = 426; 
    638     int ForwardReferenceToTemplateDeclaration = 427; 
    639     int SpecializationNotAllowedForDeducedParameter = 428; 
    640     int CannotDeclareTemplateAtFunctionScope = 429; 
    641     int TemplateHasNoValue = 430; 
    642     int CannotUseLocalAsTemplateParameter = 431; 
    643     int NoSizeForType = 432; 
    644     int SymbolDotSymbolIsNotADeclaration = 433; 
    645     int ThisIsRequiredButIsNotABaseClassOf = 434; 
    646     int ForwardReferenceToSymbol = 435; 
    647     int IdentifierOfSymbolIsNotDefined = 436; 
    648     int StructIsForwardReferenced = 437; 
    649     int CannotUseTemplateToAddFieldToAggregate = 438; 
    650     int CannotModifyFinalVariable = 439; 
    651     int InvalidUtf8Sequence2 = 440; 
    652     int Utf16HighValuePastEndOfString = 441; 
    653     int Utf16LowValueOutOfRange = 442; 
    654     int UnpairedUtf16Value = 443; 
    655     int IllegalUtf16Value = 444; 
    656     int StaticConstructorCanOnlyBePartOfStructClassModule = 445; 
    657     int ShiftAssignIsOutsideTheRange = 446; 
    658     int TemplateTupleParameterMustBeLastOne = 447; 
    659     int SymbolIsNestedInBoth = 448; 
     483    int SymbolIsNotAnArithmeticTypeItIs = 272; 
     484    int CannotPerformModuloComplexArithmetic = 273; 
     485    int OperatorNotAllowedOnBoolExpression = 274; 
     486    int ForeachKeyTypeMustBeIntOrUint = 275; 
     487    int ForeachKeyCannotBeOutOrRef = 276; 
     488    int NoReverseIterationOnAssociativeArrays = 277; 
     489    int OnlyOneOrTwoArgumentsForAssociativeArrayForeach = 278; 
     490    int OnlyOneOrTwoArgumentsForArrayForeach = 279; 
     491    int ForeachTargetIsNotAnArrayOf = 280; 
     492    int ForeachValueCannotBeOutAndTypeBit = 281; 
     493    int ForeachKeyCannotBeInout = 282; 
     494    int ForeachValueOfUTFConversionCannotBeInout = 283; 
     495    int CannotInferTypeForSymbol = 284; 
     496    int CannotInferTypeFromInitializer = 285; 
     497    int NoStorageClassForSymbol = 286; 
     498    int OnlyOneValueOrTwoKeyValueArgumentsForTupleForeach = 287; 
     499    int CannotUniquelyInferForeachArgumentTypes = 288; 
     500    int InvalidForeachAggregate = 289; 
     501    int NotAnAssociativeArrayInitializer = 290; 
     502    int ArrayInitializersAsExpressionsNotAllowed = 291; 
     503    int IftypeConditionCannotBeAtGlobalScope = 292; 
     504    int SymbolIsNotAFieldOfSymbol = 293; 
     505    int RecursiveTemplateExpansion = 294; 
     506    int RecursiveTemplateExpansionForTemplateArgument = 295; 
     507    int IndexIsNotATypeOrExpression = 296; 
     508    int CannotHavePointerToSymbol = 297; 
     509    int SizeOfTypeIsNotKnown = 298; 
     510    int CanOnlySliceTupleTypes = 299; 
     511    int NoPropertyForTuple = 300; 
     512    int CannotResolveDotProperty = 301; 
     513    int CannotTakeAddressOfBitInArray = 302; 
     514    int OnlyOneIndexAllowedToIndex = 303; 
     515    int NoOpIndexOperatorOverloadForType = 304; 
     516    int ArrayDimensionOverflow = 305; 
     517    int OperatorAssignmentOverloadWithOpIndexIllegal = 306; 
     518    int CannotHaveOutOrInoutArgumentOfBitInArray = 307; 
     519    int SymbolIsAliasedToAFunction = 308; 
     520    int LinkageDoesNotMatchInterfaceFunction = 309; 
     521    int InterfaceFunctionIsNotImplemented = 310; 
     522    int ExpectedKeyAsArgumentToRemove = 311; 
     523    int CyclicConstructorCall = 312; 
     524    int MissingOrCurruptObjectDotD = 313; 
     525    int CannotContinueOutOfFinallyBlock = 314; 
     526    int ForwardDeclaration = 315; 
     527    int CannotFormDelegateDueToCovariantReturnType = 316; 
     528    int ForeachRangeKeyCannotHaveStorageClass = 317; 
     529    int MultipleOverridesOfSameFunction = 318; 
     530    int IdentityAssignmentOperatorOverloadIsIllegal = 319; 
     531    int LiteralsCannotBeClassMembers = 320; 
     532    int NoMatchForImplicitSuperCallInConstructor = 321; 
     533    int NoReturnAtEndOfFunction = 322; 
     534    int CanOnlyDeclareTypeAliasesWithinStaticIfConditionals = 323; 
     535    int PackageAndModuleHaveTheSameName = 324; 
     536    int StringLiteralsAreImmutable = 325; 
     537    int ExpressionDotNewIsOnlyForAllocatingNestedClasses = 326; 
     538    int TooManyArgumentsForArray = 327; 
     539    int ReturnExpressionExpected = 328; 
     540    int ReturnWithoutCallingConstructor = 329; 
     541    int ModuleIsInMultiplePackages = 330; 
     542    int ModuleIsInMultipleDefined = 331; 
     543    int NeedUpperAndLowerBoundToSlicePointer = 332; 
     544    int NeedUpperAndLowerBoundToSliceTuple = 333; 
     545    int CannotConvertStringLiteralToVoidPointer = 334; 
     546    int SymbolIsNotAPreInstanceInitializableField = 335; 
     547    int NoCaseStatementFollowingGoto = 336; 
     548    int SwitchStatementHasNoDefault = 337; 
     549    int SymbolIsNotAFunctionTemplate = 338; 
     550    int TupleIsNotAValidTemplateValueArgument = 339; 
     551    int IncompatibleArgumentsForTemplateInstantiation = 340; 
     552    int ThrowStatementsCannotBeInContracts = 341; 
     553    int CanOnlyThrowClassObjects = 342; 
     554    int StringExpectedAsSecondArgument = 343; 
     555    int WrongNumberOfArguments = 344; 
     556    int StringMustBeChars = 345; 
     557    int InvalidFirstArgument = 346; 
     558    int FirstArgumentIsNotAClass = 347; 
     559    int ArgumentHasNoMembers = 348; 
     560    int SymbolHasNoMembers = 349; 
     561    int KindSymbolHasNoMembers = 350; 
     562    int DotOffsetDeprecated = 351; 
     563    int NoClassInfoForComInterfaceObjects = 352; 
     564    int CannotMakeReferenceToABit = 353; 
     565    int CannotFormTupleOfTuples = 354; 
     566    int MissingInitializerInStaticConstructorForConstVariable = 355; 
     567    int GlobalsStaticsFieldsRefAndAutoParametersCannotBeAuto = 356; 
     568    int ReferenceToScopeClassMustBeScope = 357; 
     569    int NumberOfKeysMustMatchNumberOfValues = 358; 
     570    int ExpectedNumberArguments = 359; 
     571    int ArraySliceIfOutOfBounds = 360; 
     572    int InvalidUCS32Char = 361; 
     573    int TupleIndexExceedsBounds = 362; 
     574    int SliceIsOutOfRange = 363; 
     575    int CannotTakeAddressOf = 364; 
     576    int VariableIsUsedBeforeInitialization = 365; 
     577    int EscapingReferenceToLocal = 366; 
     578    int EscapingReferenceToAutoLocal = 367; 
     579    int EscapingReferenceToLocalVariable = 368; 
     580    int EscapingReferenceToVariadicParameter = 369; 
     581    int CanOnlyCatchClassObjects = 370; 
     582    int BaseClassIsForwardReferenced = 371; 
     583    int BaseIsForwardReferenced = 372; 
     584    int CannotInheritFromFinalClass = 373; 
     585    int StaticClassCannotInheritFromNestedClass = 374; 
     586    int SuperClassIsNestedWithin = 375; 
     587    int ArrayComparisonTypeMismatch = 376; 
     588    int ConditionalExpressionIsNotAModifiableLvalue = 377; 
     589    int CannotCastSymbolToSymbol = 378; 
     590    int CannotDeleteInstanceOfComInterface = 379; 
     591    int TemplateIsNotAMemberOf = 380; 
     592    int TemplateIdentifierIsNotAMemberOf = 381; 
     593    int CanOnlyInitiailizeConstMemberInsideConstructor = 382; 
     594    int SymbolIsNotAMember = 383; 
     595    int SymbolIsNotATemplate = 384; 
     596    int DSymbolHasNoSize = 385; 
     597    int ExpressionOfTypeDoesNotHaveABooleanValue = 386; 
     598    int ImplicitConversionCanCauseLossOfData = 387; 
     599    int ForwardReferenceToType = 388; 
     600    int FloatingPointConstantExpressionExpected = 389; 
     601    int ExpressionIsNotAValidTemplateValueArgument = 390; 
     602    int InvalidRangeLowerBound = 391; 
     603    int InvalidRangeUpperBound = 392; 
     604    int SymbolIsNotAScalarType = 393; 
     605    int ForeachIndexMustBeType = 394; 
     606    int ForeachValueMustBeType = 395; 
     607    int OpApplyFunctionMustReturnAnInt = 396; 
     608    int FunctionOfTypeOverridesButIsNotCovariant = 397; 
     609    int CannotOverrideFinalFunction = 398; 
     610    int IncompatibleCovariantTypes = 399; 
     611    int CannotUseTemplateToAddVirtualFunctionToClass = 400; 
     612    int OutResultIsAlreadyDefined = 401; 
     613    int MissingInitializerForConstField = 402; 
     614    int ImportNotFound = 403; 
     615    int SymbolMustBeAnArrayOfPointerType = 404; 
     616    int RvalueOfInExpressionMustBeAnAssociativeArray = 405; 
     617    int InterfaceInheritsFromDuplicateInterface = 406; 
     618    int LabelIsAlreadyDefined = 407; 
     619    int CannotSubtractPointerFromSymbol = 408; 
     620    int ThisForNestedClassMustBeAClassType = 409; 
     621    int CanOnlyDereferenceAPointer = 410; 
     622    int OuterClassThisNeededToNewNestedClass = 411; 
     623    int ThisForNestedClassMustBeOfType = 412; 
     624    int NoConstructorForSymbol = 413; 
     625    int NoAllocatorForSymbol = 414; 
     626    int NegativeArrayIndex = 415; 
     627    int NewCanOnlyCreateStructsDynamicArraysAndClassObjects = 416; 
     628    int MismatchedFunctionReturnTypeInference = 417; 
     629    int ShiftLeftExceeds = 418; 
     630    int SymbolCannotBeSlicedWithBrackets = 419; 
     631    int SliceExpressionIsNotAModifiableLvalue = 420; 
     632    int SymbolIsNotAMemberOf = 421; 
     633    int MoreInitiailizersThanFields = 422; 
     634    int OverlappingInitiailization = 423; 
     635    int CannotMakeExpressionOutOfInitializer = 424; 
     636    int NoDefaultOrCaseInSwitchStatement = 425; 
     637    int SymbolIsNotASymbol = 426; 
     638    int ForwardReferenceToTemplate = 427; 
     639    int ForwardReferenceToTemplateDeclaration = 428; 
     640    int SpecializationNotAllowedForDeducedParameter = 429; 
     641    int CannotDeclareTemplateAtFunctionScope = 430; 
     642    int TemplateHasNoValue = 431; 
     643    int CannotUseLocalAsTemplateParameter = 432; 
     644    int NoSizeForType = 433; 
     645    int SymbolDotSymbolIsNotADeclaration = 434; 
     646    int ThisIsRequiredButIsNotABaseClassOf = 435; 
     647    int ForwardReferenceToSymbol = 436; 
     648    int IdentifierOfSymbolIsNotDefined = 437; 
     649    int StructIsForwardReferenced = 438; 
     650    int CannotUseTemplateToAddFieldToAggregate = 439; 
     651    int CannotModifyFinalVariable = 440; 
     652    int InvalidUtf8Sequence2 = 441; 
     653    int Utf16HighValuePastEndOfString = 442; 
     654    int Utf16LowValueOutOfRange = 443; 
     655    int UnpairedUtf16Value = 444; 
     656    int IllegalUtf16Value = 445; 
     657    int StaticConstructorCanOnlyBePartOfStructClassModule = 446; 
     658    int ShiftAssignIsOutsideTheRange = 447; 
     659    int TemplateTupleParameterMustBeLastOne = 448; 
     660    int SymbolIsNestedInBoth = 449; 
     661    int FunctionIsAbstract = 450; 
     662    int KindSymbolDoesNotOverload = 451; 
     663    int MismatchedTupleLengths = 452; 
     664    int DoNotUseNullWhenComparingClassTypes = 453; 
     665    int UseTokenInsteadOfTokenWhenComparingWithNull = 454; 
    660666 
    661667} 
  • trunk/descent.core/src/descent/internal/compiler/parser/ASTDmdNode.java

    r1155 r1157  
    621621            SemanticContext context) { 
    622622        if (e == null) { 
    623             if (d.prot() == PROTprivate && d.getModule() != sc.module 
    624                     || d.prot() == PROTpackage && !hasPackageAccess(sc, d)) { 
    625                 if (context.acceptsProblems()) { 
    626                     context.acceptProblem(Problem.newSemanticTypeError(IProblem.SymbolIsNotAccessible, this, new String[] { d.kind(), d 
    627                             .getModule().toChars(context), d.toChars(context), 
    628                             sc.module.toChars(context) })); 
    629                 } 
     623            if (context.acceptsProblems() &&  
     624                    (d.prot() == PROTprivate && d.getModule() != sc.module 
     625                    || d.prot() == PROTpackage && !hasPackageAccess(sc, d))) { 
     626                context.acceptProblem(Problem.newSemanticTypeError(IProblem.SymbolIsNotAccessible, this, new String[] { d.kind(), d 
     627                        .getModule().toChars(context), d.toChars(context), 
     628                        sc.module.toChars(context) })); 
    630629            } 
    631630        } else if (e.type.ty == Tclass) { // Do access check 
     
    676675                } 
    677676                argbuf.reset(); 
    678                 arg.type.toCBuffer2(argbuf, null, hgs, context); 
     677                arg.type.toCBuffer2(argbuf, hgs, 0, context); 
    679678                buf.write(argbuf); 
    680679            } 
     
    687686            for (int i = 0; i < arguments.size(); i++) { 
    688687                Expression arg = arguments.get(i); 
    689  
    690                 if (i != 0) { 
    691                     buf.writeByte(','); 
    692                 } 
    693                 expToCBuffer(buf, hgs, arg, PREC.PREC_assign, context); 
     688                 
     689                if (arg != null) { 
     690                    if (i != 0) { 
     691                        buf.writeByte(','); 
     692                    } 
     693                    expToCBuffer(buf, hgs, arg, PREC.PREC_assign, context); 
     694                } 
    694695            } 
    695696        } 
     
    902903                    // 'invariant' 
    903904                    // BUG: assignments to inout should also be type 'invariant' 
    904                     arg = arg.modifiableLvalue(sc, null, context); 
     905                    arg = arg.modifiableLvalue(sc, arg, context); 
    905906 
    906907                    // if (arg.op == TOKslice) 
     
    908909 
    909910                    // Don't have a way yet to do a pointer to a bit in array 
    910                     if (arg.op == TOKarray 
    911                             && arg.type.toBasetype(context).ty == Tbit) { 
    912                         if (context.acceptsProblems()) { 
    913                             context.acceptProblem(Problem.newSemanticTypeError( 
    914                                     IProblem.CannotHaveOutOrInoutArgumentOfBitInArray, this)); 
    915                         } 
     911                    if (context.acceptsProblems() && 
     912                            arg.op == TOKarray &&  
     913                            arg.type.toBasetype(context).ty == Tbit) { 
     914                        context.acceptProblem(Problem.newSemanticTypeError( 
     915                                IProblem.CannotHaveOutOrInoutArgumentOfBitInArray, this)); 
    916916                    } 
    917917                } 
     
    18721872     
    18731873    public void errorOnModifier(int problemId, TOK tok, SemanticContext context) { 
     1874        if (context.acceptsProblems()) { 
     1875            return; 
     1876        } 
     1877         
    18741878        boolean reported = false; 
    18751879         
     
    18771881            for (Modifier modifier : modifiers) { 
    18781882                if (modifier.tok == tok) { 
    1879                     if (context.acceptsProblems()) { 
    1880                         context.acceptProblem(Problem.newSemanticTypeError( 
    1881                                 problemId, modifier)); 
    1882                     } 
     1883                    context.acceptProblem(Problem.newSemanticTypeError( 
     1884                            problemId, modifier)); 
    18831885                    reported = true; 
    18841886                } 
     
    18891891            for (Modifier modifier : extraModifiers) { 
    18901892                if (modifier.tok == tok) { 
    1891                     if (context.acceptsProblems()) { 
    1892                         context.acceptProblem(Problem.newSemanticTypeError( 
    1893                                 problemId, modifier)); 
    1894                     } 
     1893                    context.acceptProblem(Problem.newSemanticTypeError( 
     1894                            problemId, modifier)); 
    18951895                    reported = true; 
    18961896                } 
     
    18991899         
    19001900        if (!reported) { 
    1901             if (context.acceptsProblems()) { 
    1902                 context.acceptProblem(Problem.newSemanticTypeErrorLoc( 
    1903                         problemId, this)); 
    1904             } 
     1901            context.acceptProblem(Problem.newSemanticTypeErrorLoc( 
     1902                    problemId, this)); 
    19051903        } 
    19061904    } 
  • trunk/descent.core/src/descent/internal/compiler/parser/AddAssignExp.java

    r964 r1157  
    5555        } 
    5656 
    57         e1 = e1.modifiableLvalue(sc, null, context); 
     57        e1 = e1.modifiableLvalue(sc, e1, context); 
    5858 
    5959        Type tb1 = e1.type.toBasetype(context); 
  • trunk/descent.core/src/descent/internal/compiler/parser/AddrExp.java

    r1154 r1157  
    137137                    TypeSArray ts = (TypeSArray) ve.type; 
    138138                    integer_t dim = ts.dim.toInteger(context); 
    139                     if (index.compareTo(0) < 0 || index.compareTo(dim) >= 0) { 
     139                    if (context.acceptsProblems() && (index.compareTo(0) < 0 || index.compareTo(dim) >= 0)) { 
    140140                        // PERHAPS test this error 
    141                         if (context.acceptsProblems()) { 
    142                             context.acceptProblem(Problem.newSemanticTypeError( 
    143                                     IProblem.ArrayIndexOutOfBounds, 
    144                                     this, 
    145                                     new String[] { 
    146                                         String.valueOf(index), 
    147                                         String.valueOf(dim), 
    148                                     })); 
    149                         } 
     141                        context.acceptProblem(Problem.newSemanticTypeError( 
     142                                IProblem.ArrayIndexOutOfBounds, 
     143                                this, 
     144                                new String[] { 
     145                                    String.valueOf(index), 
     146                                    String.valueOf(dim), 
     147                                })); 
    150148                    } 
    151149                    e = new SymOffExp(loc, ve.var, index.multiply(ts.next 
  • trunk/descent.core/src/descent/internal/compiler/parser/AndAndExp.java

    r1154 r1157  
    123123        } else { 
    124124            e2 = e2.optimize(WANTflags | (result & WANTinterpret), context); 
    125             if (result > 0 && e2.type.toBasetype(context).ty == Tvoid 
     125            if (context.acceptsProblems() && 
     126                    result > 0 && e2.type.toBasetype(context).ty == Tvoid 
    126127                    && context.global.errors <= 0) { 
    127                 if (context.acceptsProblems()) { 
    128                     context.acceptProblem(Problem.newSemanticTypeError( 
    129                             IProblem.SymbolHasNoValue, this, 
    130                             new String[] { "void" })); 
    131                 } 
     128                context.acceptProblem(Problem.newSemanticTypeError( 
     129                        IProblem.SymbolHasNoValue, this, 
     130                        new String[] { "void" })); 
    132131            } 
    133132            if (e1.isConst()) { 
  • trunk/descent.core/src/descent/internal/compiler/parser/ArrayExp.java

    r1154 r1157  
    109109    @Override 
    110110    public Expression toLvalue(Scope sc, Expression e, SemanticContext context) { 
    111         if ((type != null) && (type.toBasetype(context).ty == TY.Tvoid)) { 
    112             if (context.acceptsProblems()) { 
    113                 context.acceptProblem(Problem.newSemanticTypeError( 
    114                         IProblem.VoidsHaveNoValue, this)); 
    115             } 
     111        if (context.acceptsProblems() && 
     112                (type != null) && (type.toBasetype(context).ty == TY.Tvoid)) { 
     113            context.acceptProblem(Problem.newSemanticTypeError( 
     114                    IProblem.VoidsHaveNoValue, this)); 
    116115        } 
    117116        return this; 
  • trunk/descent.core/src/descent/internal/compiler/parser/ArrayInitializer.java

    r1154 r1157  
    136136            } 
    137137        } 
    138         if (new integer_t(dim).multiply(t.next.size(context)).compareTo(amax) >= 0) { 
    139             if (context.acceptsProblems()) { 
    140                 context.acceptProblem(Problem.newSemanticTypeError(IProblem.ArrayDimensionExceedsMax, this, new String[] { String.valueOf(dim), amax.divide(t.next.size(context)).toString() })); 
    141             } 
     138        if (context.acceptsProblems() &&  
     139                new integer_t(dim).multiply(t.next.size(context)).compareTo(amax) >= 0) { 
     140            context.acceptProblem(Problem.newSemanticTypeError(IProblem.ArrayDimensionExceedsMax, this, new String[] { String.valueOf(dim), amax.divide(t.next.size(context)).toString() })); 
    142141        } 
    143142        return this; 
  • trunk/descent.core/src/descent/internal/compiler/parser/ArrayLiteralExp.java

    r1154 r1157  
    133133        Expression e; 
    134134        Type t0 = null; 
     135         
     136        if (type != null) { 
     137            return this; 
     138        } 
    135139 
    136140        // Run semantic() on each element 
  • trunk/descent.core/src/descent/internal/compiler/parser/AssignExp.java

    r1154 r1157  
    44import descent.core.compiler.IProblem; 
    55import descent.internal.compiler.parser.ast.IASTVisitor; 
     6 
     7import static descent.internal.compiler.parser.TOK.*; 
    68 
    79// DMD 1.020 
     
    150152        e2 = resolveProperties(sc, e2, context); 
    151153        assert (null != e1.type); 
     154         
     155        /* Rewrite tuple assignment as a tuple of assignments. 
     156         */ 
     157        if (e1.op == TOKtuple && e2.op == TOKtuple) 
     158        {   TupleExp tup1 = (TupleExp)e1; 
     159        TupleExp tup2 = (TupleExp) e2; 
     160        int dim = size(tup1.exps); 
     161        if (dim != size(tup2.exps)) 
     162        { 
     163            if (context.acceptsProblems()) { 
     164                context.acceptProblem(Problem.newSemanticTypeError(IProblem.MismatchedTupleLengths, this, new String[] { String.valueOf(dim), String.valueOf(size(tup2.exps)) })); 
     165            } 
     166        } 
     167        else 
     168        {   Expressions exps = new Expressions(); 
     169            exps.setDim(dim); 
     170 
     171            for (int i = 0; i < dim; i++) 
     172            {    
     173                Expression ex1 = (Expression) tup1.exps.get(i); 
     174                Expression ex2 = (Expression) tup2.exps.get(i); 
     175                exps.set(i, new AssignExp(loc, ex1, ex2)); 
     176            } 
     177            Expression e = new TupleExp(loc, exps); 
     178            e = e.semantic(sc, context); 
     179            return e; 
     180        } 
     181        } 
     182 
    152183 
    153184        t1 = e1.type.toBasetype(context); 
     
    178209            // e1 is not an lvalue, but we let code generator handle it 
    179210            ArrayLengthExp ale = (ArrayLengthExp) e1; 
    180             ale.e1 = ale.e1.modifiableLvalue(sc, null, context); 
     211            ale.e1 = ale.e1.modifiableLvalue(sc, e1, context); 
    181212        } else if (e1.op == TOK.TOKslice) { 
    182213            ; 
     
    187218        } 
    188219 
    189         if (e1.op == TOK.TOKslice && null != t1.next 
    190                 && !(t1.next.equals(e2.type.next))) { // memset 
     220        if (e1.op == TOK.TOKslice &&  
     221                null != t1.nextOf() &&  
     222                e2.implicitConvTo(t1.nextOf(), context) != MATCH.MATCHnomatch && 
     223                !(t1.nextOf().equals(e2.type.nextOf()))) {  
     224            // memset 
     225            ismemset = true;    // make it easy for back end to tell what this is 
    191226            e2 = e2.implicitCastTo(sc, t1.next, context); 
    192227        } else if (t1.ty == TY.Tsarray) { 
  • trunk/descent.core/src/descent/internal/compiler/parser/BinExp.java

    r1154 r1157  
    1919import static descent.internal.compiler.parser.TOK.TOKassign; 
    2020import static descent.internal.compiler.parser.TOK.TOKassocarrayliteral; 
     21import static descent.internal.compiler.parser.TOK.TOKblit; 
    2122import static descent.internal.compiler.parser.TOK.TOKcast; 
    2223import static descent.internal.compiler.parser.TOK.TOKcatass; 
     24import static descent.internal.compiler.parser.TOK.TOKconstruct; 
    2325import static descent.internal.compiler.parser.TOK.TOKdivass; 
    2426import static descent.internal.compiler.parser.TOK.TOKequal; 
     
    109111    public int checkSideEffect(int flag, SemanticContext context) { 
    110112        if (op == TOKplusplus || op == TOKminusminus || op == TOKassign 
     113                || op == TOKconstruct || op == TOKblit 
    111114                || op == TOKaddass || op == TOKminass || op == TOKcatass 
    112115                || op == TOKmulass || op == TOKdivass || op == TOKmodass 
     
    132135            } 
    133136 
    134             e1 = e1.modifiableLvalue(sc, null, context); 
     137            e1 = e1.modifiableLvalue(sc, e1, context); 
    135138            e1.checkScalar(context); 
    136139            type = e1.type; 
     
    159162            } 
    160163 
    161             e1 = e1.modifiableLvalue(sc, null, context); 
     164            e1 = e1.modifiableLvalue(sc, e1, context); 
    162165            e1.checkScalar(context); 
    163166            type = e1.type; 
    164             if (type.toBasetype(context).ty == Tbool) { 
    165                 if (context.acceptsProblems()) { 
    166                     context.acceptProblem(Problem.newSemanticTypeError( 
    167                             IProblem.OperatorNotAllowedOnBoolExpression, this, new String[] { toChars(context) })); 
    168                 } 
     167            if (context.acceptsProblems() && type.toBasetype(context).ty == Tbool) { 
     168                context.acceptProblem(Problem.newSemanticTypeError( 
     169                        IProblem.OperatorNotAllowedOnBoolExpression, this, new String[] { toChars(context) })); 
    169170            } 
    170171            typeCombine(sc, context); 
  • trunk/descent.core/src/descent/internal/compiler/parser/CallExp.java

    r1154 r1157  
    2525import static descent.internal.compiler.parser.TOK.TOKtemplate; 
    2626import static descent.internal.compiler.parser.TOK.TOKthis; 
    27 import static descent.internal.compiler.parser.TOK.TOKvar
     27import static descent.internal.compiler.parser.TOK.*
    2828 
    2929import static descent.internal.compiler.parser.TY.Taarray; 
     
    307307                        sourceE1.setResolvedSymbol(opCall); 
    308308                         
    309                         // goto L1; // overload of opCall, therefore it's a call 
    310                         // Rewrite as e1.call(arguments) 
    311                         Expression e = new DotIdExp(loc, e1, new IdentifierExp( 
    312                                 Id.call)); 
    313                         e = new CallExp(loc, e, arguments); 
    314                         e = e.semantic(sc, context); 
    315                         return e; 
     309                        // goto L1;  
     310                        return semantic_L1(sc, context); 
     311                    } 
     312                     
     313                    if (e1.op != TOKtype) { 
     314                        if (context.acceptsProblems()) { 
     315                            context.acceptProblem(Problem.newSemanticTypeError(IProblem.KindSymbolDoesNotOverload, this, new String[] { ad.kind(), ad.toChars(context) })); 
     316                        } 
    316317                    } 
    317318                     
     
    321322                            (StructDeclaration) ad, arguments); 
    322323                    e = e.semantic(sc, context); 
     324                    e.type = e1.type; // in case e1.type was a typedef 
    323325                    return e; 
    324326                } else if (t1.ty == Tclass) { 
    325327                    ad = ((TypeClass) t1).sym; 
    326328                    // goto L1;&n