first step to get rid of nil in the AST
This commit is contained in:
parent
134f24f579
commit
27dc54cbda
17 changed files with 505 additions and 436 deletions
391
rod/msgs.nim
391
rod/msgs.nim
|
|
@ -62,7 +62,7 @@ type
|
|||
errImplOfXexpected, errNoSymbolToBorrowFromFound, errDiscardValue,
|
||||
errInvalidDiscard, errIllegalConvFromXtoY, errCannotBindXTwice,
|
||||
errInvalidOrderInArrayConstructor,
|
||||
errInvalidOrderInEnumX, errEnumXHasWholes, errExceptExpected, errInvalidTry,
|
||||
errInvalidOrderInEnumX, errEnumXHasHoles, errExceptExpected, errInvalidTry,
|
||||
errOptionExpected, errXisNoLabel, errNotAllCasesCovered,
|
||||
errUnkownSubstitionVar, errComplexStmtRequiresInd, errXisNotCallable,
|
||||
errNoPragmasAllowedForX, errNoGenericParamsAllowedForX,
|
||||
|
|
@ -96,154 +96,245 @@ type
|
|||
hintProcessing, hintCodeBegin, hintCodeEnd, hintConf, hintPath, hintUser
|
||||
|
||||
const
|
||||
MsgKindToStr*: array[TMsgKind, string] = ["unknown error",
|
||||
"illformed AST: $1", "cannot open \'$1\'", "internal error: $1", "$1",
|
||||
"\'$1\' compiler does not support C++", "string literal expected",
|
||||
"integer literal expected", "invalid character constant",
|
||||
"closing \"\"\" expected, but end of file reached", "closing \" expected",
|
||||
"tabulators are not allowed", "invalid token: $1", "line too long",
|
||||
"$1 is not a valid number", "number $1 out of valid range",
|
||||
"\\n not allowed in character literal",
|
||||
"closing \']\' expected, but end of file reached", "missing final \'",
|
||||
"identifier expected, but found \'$1\'",
|
||||
"operator expected, but found \'$1\'", "\'$1\' expected",
|
||||
"string after \'include\' expected", "recursive dependency: \'$1\'",
|
||||
"\'on\' or \'off\' expected", "\'none\', \'speed\' or \'size\' expected",
|
||||
"invalid pragma", "unknown pragma: \'$1\'", "invalid directive: \'$1\'",
|
||||
"\'pop\' without a \'push\' pragma", "empty asm statement",
|
||||
"invalid indentation", "exception expected", "exception already handled",
|
||||
"\'yield\' only allowed in a loop of an iterator",
|
||||
"invalid number of \'yield\' expresions",
|
||||
"current routine cannot return an expression", "attempt to redefine \'$1\'",
|
||||
"statement not allowed after \'return\', \'break\' or \'raise\'",
|
||||
"statement expected", "\'$1\' is no label",
|
||||
"invalid command line option: \'$1\'",
|
||||
"argument for command line option expected: \'$1\'",
|
||||
"invalid argument for command line option: \'$1\'",
|
||||
"invalid variable substitution in \'$1\'", "unknown variable: \'$1\'",
|
||||
"unknown C compiler: \'$1\'",
|
||||
"\'on\' or \'off\' expected, but \'$1\' found",
|
||||
"\'none\', \'boehm\' or \'refc\' expected, but \'$1\' found",
|
||||
"\'none\', \'speed\' or \'size\' expected, but \'$1\' found",
|
||||
"\'gui\', \'console\' or \'lib\' expected, but \'$1\' found",
|
||||
"unknown OS: \'$1\'", "unknown CPU: \'$1\'",
|
||||
"\'c\', \'c++\' or \'yaml\' expected, but \'$1\' found",
|
||||
"arguments can only be given if the \'--run\' option is selected",
|
||||
"multiple assignment is not allowed",
|
||||
"\':\' or \'=\' expected, but found \'$1\'",
|
||||
"expression expected, but found \'$1\'", "undeclared identifier: \'$1\'",
|
||||
"ambiguous identifier: \'$1\' -- use a qualifier", "type expected",
|
||||
"system module needs \'$1\'", "execution of an external program failed",
|
||||
"overloaded \'$1\' leads to ambiguous calls", "invalid argument for \'$1\'",
|
||||
"statement has no effect", "\'$1\' expects a type or value",
|
||||
"\'$1\' expects an array type",
|
||||
"\'$1\' cannot be instantiated because its body has not been compiled yet",
|
||||
"expression \'$1\' ambiguous in this context", "constant division by zero",
|
||||
"ordinal type expected", "ordinal or float type expected",
|
||||
"over- or underflow",
|
||||
"cannot evalutate \'$1\' because type is not defined completely",
|
||||
"\'chr\' expects an int in the range 0..255",
|
||||
"\'dynlib\' requires \'exportc\'", "undeclared field: \'$1\'",
|
||||
"attempt to access a nil address", "index out of bounds",
|
||||
"index types do not match", "\'[]\' operator invalid for this type",
|
||||
"value out of set bounds", "field initialized twice: \'$1\'",
|
||||
"field \'$1\' not initialized", "expression \'$1\' cannot be called",
|
||||
"expression has no type", "expression \'$1\' has no type (or is ambiguous)",
|
||||
"\'cast\' not allowed in safe mode", "expression cannot be casted to $1",
|
||||
"\',\' or \')\' expected", "\'{\' or \'(\' expected",
|
||||
"section (\'type\', \'proc\', etc.) expected", "range expected",
|
||||
"attempt to redefine \'$1\'", "\'magic\' only allowed in system module",
|
||||
"power of two expected", "string literal may not be empty",
|
||||
"calling convention expected",
|
||||
"a proc can only have one calling convention",
|
||||
"symbol must be imported if \'lib\' pragma is used",
|
||||
"expression must be of type \'bool\'", "constant expression expected",
|
||||
"duplicate case label", "range is empty",
|
||||
"selector must be of an ordinal type, real or string",
|
||||
"selector must be of an ordinal type", "ord($1) must not be negative",
|
||||
"len($1) must be less than 32768", "wrong number of variables",
|
||||
"only objects can be raised", "\'break\' only allowed in loop construct",
|
||||
"type \'$1\' has unknown size",
|
||||
"a constant can only be initialized with a constant expression",
|
||||
"a constant needs a value", "the result type cannot be on open array",
|
||||
"computing the type\'s size produced an overflow", "set is too large",
|
||||
"base type of a set must be an ordinal",
|
||||
"inheritance only works with non-final objects",
|
||||
"inheritance only works with an enum", "illegal recursion in type \'$1\'",
|
||||
"cannot instantiate: \'$1\'", "expression has no address",
|
||||
"for a \'var\' type a variable needs to be passed", "type mismatch",
|
||||
"type mismatch: got (", "but expected one of: ", "but expected \'$1\'",
|
||||
"ambiguous call; both $1 and $2 match for: $3", "wrong number of arguments",
|
||||
"\'$1\' cannot be passed to a procvar",
|
||||
"$1 cannot be declared in parameter declaration",
|
||||
"pragmas are only in the header of a proc allowed",
|
||||
"implementation of \'$1\' is not allowed",
|
||||
"implementation of \'$1\' expected", "no symbol to borrow from found",
|
||||
"value returned by statement has to be discarded",
|
||||
"statement returns no value that can be discarded",
|
||||
"conversion from $1 to $2 is invalid", "cannot bind parameter \'$1\' twice",
|
||||
"invalid order in array constructor",
|
||||
"invalid order in enum \'$1\'", "enum \'$1\' has wholes",
|
||||
"\'except\' or \'finally\' expected",
|
||||
"after catch all \'except\' or \'finally\' no section may follow",
|
||||
"option expected, but found \'$1\'", "\'$1\' is not a label",
|
||||
"not all cases are covered", "unknown substitution variable: \'$1\'",
|
||||
"complex statement requires indentation", "\'$1\' is not callable",
|
||||
"no pragmas allowed for $1", "no generic parameters allowed for $1",
|
||||
"invalid param kind: \'$1\'", "default argument invalid",
|
||||
"named parameter has to be an identifier", "no return type for $1 allowed",
|
||||
"a type conversion needs exactly one argument", "invalid pragma: $1",
|
||||
"$1 not allowed here", "invalid control flow: $1", "a type has no value",
|
||||
"invalid type: \'$1\'", "\'^\' needs a pointer or reference type",
|
||||
"invalid expression", "invalid expression: \'$1\'",
|
||||
"enum has no value \'$1\'", "named expression expected",
|
||||
"named expression not allowed here", "\'$1\' expects one type parameter",
|
||||
"array expects two type parameters", "invalid visibility: \'$1\'",
|
||||
"initialization not allowed here", "\'$1\' cannot be assigned to",
|
||||
"iterators can only be defined at the module\'s top level",
|
||||
"$1 needs a return type", "invalid command: \'$1\'",
|
||||
"\'$1\' is only allowed at top level",
|
||||
"'$1' needs a parameter that has an object type",
|
||||
"template/macro instantiation too nested", "instantiation from here",
|
||||
"invalid index value for tuple subscript",
|
||||
"command expects a filename argument", "\'$1\' expected",
|
||||
"invalid section start", "grid table is not implemented",
|
||||
"general parse error", "new section expected",
|
||||
"whitespace expected, got \'$1\'", "\'$1\' is no valid index file",
|
||||
"cannot render reStructuredText element \'$1\'",
|
||||
"type \'var var\' is not allowed", "\'is\' expects two arguments",
|
||||
"\'is\' expects object types", "\'$1\' can never be of this subtype",
|
||||
"interpretation requires too many iterations",
|
||||
"cannot interpret node kind \'$1\'", "field \'$1\' cannot be found",
|
||||
"invalid conversion from type \'$1\'", "assertion failed",
|
||||
"cannot generate code for \'$1\'", "$1 requires one parameter",
|
||||
"unhandled exception: $1", "macro returned a cyclic abstract syntax tree",
|
||||
"\'$1\' is no macro or template", "\'$1\' can have side effects",
|
||||
"iterator within for loop context expected", "$1",
|
||||
"cannot open \'$1\' [CannotOpenFile]", "octal escape sequences do not exist; leading zero is ignored [OctalEscape]",
|
||||
"\'$1\' is never read [XIsNeverRead]",
|
||||
"\'$1\' might not have been initialized [XmightNotBeenInit]",
|
||||
"cannot write file \'$1\' [CannotWriteMO2]",
|
||||
"cannot read file \'$1\' [CannotReadMO2]",
|
||||
"\'$1\' is deprecated [Deprecated]", "\'l\' should not be used as an identifier; may look like \'1\' (one) [SmallLshouldNotBeUsed]",
|
||||
"unknown magic \'$1\' might crash the compiler [UnknownMagic]",
|
||||
"redefinition of label \'$1\' [RedefinitionOfLabel]",
|
||||
"unknown substitution \'$1\' [UnknownSubstitutionX]",
|
||||
"language \'$1\' not supported [LanguageXNotSupported]",
|
||||
"comment \'$1\' ignored [CommentXIgnored]",
|
||||
"\'$1\' is passed to a procvar; deprecated [XisPassedToProcVar]",
|
||||
"$1 [User]", "operation successful [Success]",
|
||||
"operation successful ($1 lines compiled; $2 sec total) [SuccessX]",
|
||||
"line too long [LineTooLong]",
|
||||
"\'$1\' is declared but not used [XDeclaredButNotUsed]",
|
||||
"conversion to base object is not needed [ConvToBaseNotNeeded]",
|
||||
"conversion from $1 to itself is pointless [ConvFromXtoItselfNotNeeded]",
|
||||
"expression evaluates always to \'$1\' [ExprAlwaysX]",
|
||||
"quit() called [QuitCalled]", "$1 [Processing]",
|
||||
"generated code listing: [CodeBegin]", "end of listing [CodeEnd]",
|
||||
"used config file \'$1\' [Conf]",
|
||||
"added path: '$1' [Path]",
|
||||
"$1 [User]"]
|
||||
MsgKindToStr*: array[TMsgKind, string] = [
|
||||
errUnknown: "unknown error",
|
||||
errIllFormedAstX: "illformed AST: $1",
|
||||
errCannotOpenFile: "cannot open \'$1\'",
|
||||
errInternal: "internal error: $1",
|
||||
errGenerated: "$1",
|
||||
errXCompilerDoesNotSupportCpp: "\'$1\' compiler does not support C++",
|
||||
errStringLiteralExpected: "string literal expected",
|
||||
errIntLiteralExpected: "integer literal expected",
|
||||
errInvalidCharacterConstant: "invalid character constant",
|
||||
errClosingTripleQuoteExpected: "closing \"\"\" expected, but end of file reached",
|
||||
errClosingQuoteExpected: "closing \" expected",
|
||||
errTabulatorsAreNotAllowed: "tabulators are not allowed",
|
||||
errInvalidToken: "invalid token: $1",
|
||||
errLineTooLong: "line too long",
|
||||
errInvalidNumber: "$1 is not a valid number",
|
||||
errNumberOutOfRange: "number $1 out of valid range",
|
||||
errNnotAllowedInCharacter: "\\n not allowed in character literal",
|
||||
errClosingBracketExpected: "closing ']' expected, but end of file reached",
|
||||
errMissingFinalQuote: "missing final \'",
|
||||
errIdentifierExpected: "identifier expected, but found \'$1\'",
|
||||
errOperatorExpected: "operator expected, but found \'$1\'",
|
||||
errTokenExpected: "\'$1\' expected",
|
||||
errStringAfterIncludeExpected: "string after \'include\' expected",
|
||||
errRecursiveDependencyX: "recursive dependency: \'$1\'",
|
||||
errOnOrOffExpected: "\'on\' or \'off\' expected",
|
||||
errNoneSpeedOrSizeExpected: "\'none\', \'speed\' or \'size\' expected",
|
||||
errInvalidPragma: "invalid pragma",
|
||||
errUnknownPragma: "unknown pragma: \'$1\'",
|
||||
errInvalidDirectiveX: "invalid directive: \'$1\'",
|
||||
errAtPopWithoutPush: "\'pop\' without a \'push\' pragma",
|
||||
errEmptyAsm: "empty asm statement",
|
||||
errInvalidIndentation: "invalid indentation",
|
||||
errExceptionExpected: "exception expected",
|
||||
errExceptionAlreadyHandled: "exception already handled",
|
||||
errYieldNotAllowedHere: "\'yield\' only allowed in a loop of an iterator",
|
||||
errInvalidNumberOfYieldExpr: "invalid number of \'yield\' expresions",
|
||||
errCannotReturnExpr: "current routine cannot return an expression",
|
||||
errAttemptToRedefine: "attempt to redefine \'$1\'",
|
||||
errStmtInvalidAfterReturn: "statement not allowed after \'return\', \'break\' or \'raise\'",
|
||||
errStmtExpected: "statement expected",
|
||||
errInvalidLabel: "\'$1\' is no label",
|
||||
errInvalidCmdLineOption: "invalid command line option: \'$1\'",
|
||||
errCmdLineArgExpected: "argument for command line option expected: \'$1\'",
|
||||
errCmdLineNoArgExpected: "invalid argument for command line option: \'$1\'",
|
||||
errInvalidVarSubstitution: "invalid variable substitution in \'$1\'",
|
||||
errUnknownVar: "unknown variable: \'$1\'",
|
||||
errUnknownCcompiler: "unknown C compiler: \'$1\'",
|
||||
errOnOrOffExpectedButXFound: "\'on\' or \'off\' expected, but \'$1\' found",
|
||||
errNoneBoehmRefcExpectedButXFound: "'none', 'boehm' or 'refc' expected, but '$1' found",
|
||||
errNoneSpeedOrSizeExpectedButXFound: "'none', 'speed' or 'size' expected, but '$1' found",
|
||||
errGuiConsoleOrLibExpectedButXFound: "'gui', 'console' or 'lib' expected, but '$1' found",
|
||||
errUnknownOS: "unknown OS: '$1'",
|
||||
errUnknownCPU: "unknown CPU: '$1'",
|
||||
errGenOutExpectedButXFound: "'c', 'c++' or 'yaml' expected, but '$1' found",
|
||||
errArgsNeedRunOption: "arguments can only be given if the '--run' option is selected",
|
||||
errInvalidMultipleAsgn: "multiple assignment is not allowed",
|
||||
errColonOrEqualsExpected: "\':\' or \'=\' expected, but found \'$1\'",
|
||||
errExprExpected: "expression expected, but found \'$1\'",
|
||||
errUndeclaredIdentifier: "undeclared identifier: \'$1\'",
|
||||
errUseQualifier: "ambiguous identifier: \'$1\' -- use a qualifier",
|
||||
errTypeExpected: "type expected",
|
||||
errSystemNeeds: "system module needs \'$1\'",
|
||||
errExecutionOfProgramFailed: "execution of an external program failed",
|
||||
errNotOverloadable: "overloaded \'$1\' leads to ambiguous calls",
|
||||
errInvalidArgForX: "invalid argument for \'$1\'",
|
||||
errStmtHasNoEffect: "statement has no effect",
|
||||
errXExpectsTypeOrValue: "\'$1\' expects a type or value",
|
||||
errXExpectsArrayType: "\'$1\' expects an array type",
|
||||
errIteratorCannotBeInstantiated: "'$1' cannot be instantiated because its body has not been compiled yet",
|
||||
errExprXAmbiguous: "expression '$1' ambiguous in this context",
|
||||
errConstantDivisionByZero: "constant division by zero",
|
||||
errOrdinalTypeExpected: "ordinal type expected",
|
||||
errOrdinalOrFloatTypeExpected: "ordinal or float type expected",
|
||||
errOverOrUnderflow: "over- or underflow",
|
||||
errCannotEvalXBecauseIncompletelyDefined: "cannot evalutate '$1' because type is not defined completely",
|
||||
errChrExpectsRange0_255: "\'chr\' expects an int in the range 0..255",
|
||||
errDynlibRequiresExportc: "\'dynlib\' requires \'exportc\'",
|
||||
errUndeclaredFieldX: "undeclared field: \'$1\'",
|
||||
errNilAccess: "attempt to access a nil address",
|
||||
errIndexOutOfBounds: "index out of bounds",
|
||||
errIndexTypesDoNotMatch: "index types do not match",
|
||||
errBracketsInvalidForType: "\'[]\' operator invalid for this type",
|
||||
errValueOutOfSetBounds: "value out of set bounds",
|
||||
errFieldInitTwice: "field initialized twice: \'$1\'",
|
||||
errFieldNotInit: "field \'$1\' not initialized",
|
||||
errExprXCannotBeCalled: "expression \'$1\' cannot be called",
|
||||
errExprHasNoType: "expression has no type",
|
||||
errExprXHasNoType: "expression \'$1\' has no type (or is ambiguous)",
|
||||
errCastNotInSafeMode: "\'cast\' not allowed in safe mode",
|
||||
errExprCannotBeCastedToX: "expression cannot be casted to $1",
|
||||
errCommaOrParRiExpected: "',' or ')' expected",
|
||||
errCurlyLeOrParLeExpected: "\'{\' or \'(\' expected",
|
||||
errSectionExpected: "section (\'type\', \'proc\', etc.) expected",
|
||||
errRangeExpected: "range expected",
|
||||
errAttemptToRedefineX: "attempt to redefine \'$1\'",
|
||||
errMagicOnlyInSystem: "\'magic\' only allowed in system module",
|
||||
errPowerOfTwoExpected: "power of two expected",
|
||||
errStringMayNotBeEmpty: "string literal may not be empty",
|
||||
errCallConvExpected: "calling convention expected",
|
||||
errProcOnlyOneCallConv: "a proc can only have one calling convention",
|
||||
errSymbolMustBeImported: "symbol must be imported if 'lib' pragma is used",
|
||||
errExprMustBeBool: "expression must be of type 'bool'",
|
||||
errConstExprExpected: "constant expression expected",
|
||||
errDuplicateCaseLabel: "duplicate case label",
|
||||
errRangeIsEmpty: "range is empty",
|
||||
errSelectorMustBeOfCertainTypes: "selector must be of an ordinal type, float or string",
|
||||
errSelectorMustBeOrdinal: "selector must be of an ordinal type",
|
||||
errOrdXMustNotBeNegative: "ord($1) must not be negative",
|
||||
errLenXinvalid: "len($1) must be less than 32768",
|
||||
errWrongNumberOfVariables: "wrong number of variables",
|
||||
errExprCannotBeRaised: "only objects can be raised",
|
||||
errBreakOnlyInLoop: "'break' only allowed in loop construct",
|
||||
errTypeXhasUnknownSize: "type \'$1\' has unknown size",
|
||||
errConstNeedsConstExpr: "a constant can only be initialized with a constant expression",
|
||||
errConstNeedsValue: "a constant needs a value",
|
||||
errResultCannotBeOpenArray: "the result type cannot be on open array",
|
||||
errSizeTooBig: "computing the type\'s size produced an overflow",
|
||||
errSetTooBig: "set is too large",
|
||||
errBaseTypeMustBeOrdinal: "base type of a set must be an ordinal",
|
||||
errInheritanceOnlyWithNonFinalObjects: "inheritance only works with non-final objects",
|
||||
errInheritanceOnlyWithEnums: "inheritance only works with an enum",
|
||||
errIllegalRecursionInTypeX: "illegal recursion in type \'$1\'",
|
||||
errCannotInstantiateX: "cannot instantiate: \'$1\'",
|
||||
errExprHasNoAddress: "expression has no address",
|
||||
errVarForOutParamNeeded: "for a \'var\' type a variable needs to be passed",
|
||||
errPureTypeMismatch: "type mismatch",
|
||||
errTypeMismatch: "type mismatch: got (",
|
||||
errButExpected: "but expected one of: ",
|
||||
errButExpectedX: "but expected \'$1\'",
|
||||
errAmbiguousCallXYZ: "ambiguous call; both $1 and $2 match for: $3",
|
||||
errWrongNumberOfArguments: "wrong number of arguments",
|
||||
errXCannotBePassedToProcVar: "\'$1\' cannot be passed to a procvar",
|
||||
errXCannotBeInParamDecl: "$1 cannot be declared in parameter declaration",
|
||||
errPragmaOnlyInHeaderOfProc: "pragmas are only in the header of a proc allowed",
|
||||
errImplOfXNotAllowed: "implementation of \'$1\' is not allowed",
|
||||
errImplOfXexpected: "implementation of \'$1\' expected",
|
||||
errNoSymbolToBorrowFromFound: "no symbol to borrow from found",
|
||||
errDiscardValue: "value returned by statement has to be discarded",
|
||||
errInvalidDiscard: "statement returns no value that can be discarded",
|
||||
errIllegalConvFromXtoY: "conversion from $1 to $2 is invalid",
|
||||
errCannotBindXTwice: "cannot bind parameter \'$1\' twice",
|
||||
errInvalidOrderInArrayConstructor: "invalid order in array constructor",
|
||||
errInvalidOrderInEnumX: "invalid order in enum \'$1\'",
|
||||
errEnumXHasHoles: "enum \'$1\' has holes",
|
||||
errExceptExpected: "\'except\' or \'finally\' expected",
|
||||
errInvalidTry: "after catch all \'except\' or \'finally\' no section may follow",
|
||||
errOptionExpected: "option expected, but found \'$1\'",
|
||||
errXisNoLabel: "\'$1\' is not a label",
|
||||
errNotAllCasesCovered: "not all cases are covered",
|
||||
errUnkownSubstitionVar: "unknown substitution variable: \'$1\'",
|
||||
errComplexStmtRequiresInd: "complex statement requires indentation",
|
||||
errXisNotCallable: "\'$1\' is not callable",
|
||||
errNoPragmasAllowedForX: "no pragmas allowed for $1",
|
||||
errNoGenericParamsAllowedForX: "no generic parameters allowed for $1",
|
||||
errInvalidParamKindX: "invalid param kind: \'$1\'",
|
||||
errDefaultArgumentInvalid: "default argument invalid",
|
||||
errNamedParamHasToBeIdent: "named parameter has to be an identifier",
|
||||
errNoReturnTypeForX: "no return type for $1 allowed",
|
||||
errConvNeedsOneArg: "a type conversion needs exactly one argument",
|
||||
errInvalidPragmaX: "invalid pragma: $1",
|
||||
errXNotAllowedHere: "$1 not allowed here",
|
||||
errInvalidControlFlowX: "invalid control flow: $1",
|
||||
errATypeHasNoValue: "a type has no value",
|
||||
errXisNoType: "invalid type: \'$1\'",
|
||||
errCircumNeedsPointer: "\'^\' needs a pointer or reference type",
|
||||
errInvalidExpression: "invalid expression",
|
||||
errInvalidExpressionX: "invalid expression: \'$1\'",
|
||||
errEnumHasNoValueX: "enum has no value \'$1\'",
|
||||
errNamedExprExpected: "named expression expected",
|
||||
errNamedExprNotAllowed: "named expression not allowed here",
|
||||
errXExpectsOneTypeParam: "\'$1\' expects one type parameter",
|
||||
errArrayExpectsTwoTypeParams: "array expects two type parameters",
|
||||
errInvalidVisibilityX: "invalid visibility: \'$1\'",
|
||||
errInitHereNotAllowed: "initialization not allowed here",
|
||||
errXCannotBeAssignedTo: "\'$1\' cannot be assigned to",
|
||||
errIteratorNotAllowed: "iterators can only be defined at the module\'s top level",
|
||||
errXNeedsReturnType: "$1 needs a return type",
|
||||
errInvalidCommandX: "invalid command: \'$1\'",
|
||||
errXOnlyAtModuleScope: "\'$1\' is only allowed at top level",
|
||||
errXNeedsParamObjectType: "'$1' needs a parameter that has an object type",
|
||||
errTemplateInstantiationTooNested: "template/macro instantiation too nested",
|
||||
errInstantiationFrom: "instantiation from here",
|
||||
errInvalidIndexValueForTuple: "invalid index value for tuple subscript",
|
||||
errCommandExpectsFilename: "command expects a filename argument",
|
||||
errXExpected: "\'$1\' expected",
|
||||
errInvalidSectionStart: "invalid section start",
|
||||
errGridTableNotImplemented: "grid table is not implemented",
|
||||
errGeneralParseError: "general parse error",
|
||||
errNewSectionExpected: "new section expected",
|
||||
errWhitespaceExpected: "whitespace expected, got \'$1\'",
|
||||
errXisNoValidIndexFile: "\'$1\' is no valid index file",
|
||||
errCannotRenderX: "cannot render reStructuredText element \'$1\'",
|
||||
errVarVarTypeNotAllowed: "type \'var var\' is not allowed",
|
||||
errIsExpectsTwoArguments: "\'is\' expects two arguments",
|
||||
errIsExpectsObjectTypes: "\'is\' expects object types",
|
||||
errXcanNeverBeOfThisSubtype: "\'$1\' can never be of this subtype",
|
||||
errTooManyIterations: "interpretation requires too many iterations",
|
||||
errCannotInterpretNodeX: "cannot interpret node kind \'$1\'",
|
||||
errFieldXNotFound: "field \'$1\' cannot be found",
|
||||
errInvalidConversionFromTypeX: "invalid conversion from type \'$1\'",
|
||||
errAssertionFailed: "assertion failed",
|
||||
errCannotGenerateCodeForX: "cannot generate code for \'$1\'",
|
||||
errXRequiresOneArgument: "$1 requires one parameter",
|
||||
errUnhandledExceptionX: "unhandled exception: $1",
|
||||
errCyclicTree: "macro returned a cyclic abstract syntax tree",
|
||||
errXisNoMacroOrTemplate: "\'$1\' is no macro or template",
|
||||
errXhasSideEffects: "\'$1\' can have side effects",
|
||||
errIteratorExpected: "iterator within for loop context expected",
|
||||
errUser: "$1",
|
||||
warnCannotOpenFile: "cannot open \'$1\' [CannotOpenFile]",
|
||||
warnOctalEscape: "octal escape sequences do not exist; leading zero is ignored [OctalEscape]",
|
||||
warnXIsNeverRead: "\'$1\' is never read [XIsNeverRead]",
|
||||
warnXmightNotBeenInit: "\'$1\' might not have been initialized [XmightNotBeenInit]",
|
||||
warnCannotWriteMO2: "cannot write file \'$1\' [CannotWriteMO2]",
|
||||
warnCannotReadMO2: "cannot read file \'$1\' [CannotReadMO2]",
|
||||
warnDeprecated: "\'$1\' is deprecated [Deprecated]",
|
||||
warnSmallLshouldNotBeUsed: "\'l\' should not be used as an identifier; may look like \'1\' (one) [SmallLshouldNotBeUsed]",
|
||||
warnUnknownMagic: "unknown magic \'$1\' might crash the compiler [UnknownMagic]",
|
||||
warnRedefinitionOfLabel: "redefinition of label \'$1\' [RedefinitionOfLabel]",
|
||||
warnUnknownSubstitutionX: "unknown substitution \'$1\' [UnknownSubstitutionX]",
|
||||
warnLanguageXNotSupported: "language \'$1\' not supported [LanguageXNotSupported]",
|
||||
warnCommentXIgnored: "comment \'$1\' ignored [CommentXIgnored]",
|
||||
warnXisPassedToProcVar: "\'$1\' is passed to a procvar; deprecated [XisPassedToProcVar]",
|
||||
warnUser: "$1 [User]",
|
||||
hintSuccess: "operation successful [Success]",
|
||||
hintSuccessX: "operation successful ($1 lines compiled; $2 sec total) [SuccessX]",
|
||||
hintLineTooLong: "line too long [LineTooLong]",
|
||||
hintXDeclaredButNotUsed: "\'$1\' is declared but not used [XDeclaredButNotUsed]",
|
||||
hintConvToBaseNotNeeded: "conversion to base object is not needed [ConvToBaseNotNeeded]",
|
||||
hintConvFromXtoItselfNotNeeded: "conversion from $1 to itself is pointless [ConvFromXtoItselfNotNeeded]",
|
||||
hintExprAlwaysX: "expression evaluates always to \'$1\' [ExprAlwaysX]",
|
||||
hintQuitCalled: "quit() called [QuitCalled]",
|
||||
hintProcessing: "$1 [Processing]",
|
||||
hintCodeBegin: "generated code listing: [CodeBegin]",
|
||||
hintCodeEnd: "end of listing [CodeEnd]",
|
||||
hintConf: "used config file \'$1\' [Conf]",
|
||||
hintPath: "added path: '$1' [Path]",
|
||||
hintUser: "$1 [User]"]
|
||||
|
||||
const
|
||||
WarningsToStr*: array[0..14, string] = ["CannotOpenFile", "OctalEscape",
|
||||
|
|
@ -353,7 +444,7 @@ proc checkpoint(info: TLineInfo, filename: string, line: int): bool =
|
|||
(ChangeFileExt(extractFilename(filenames[info.fileIndex]), "") ==
|
||||
filename)
|
||||
|
||||
var checkPoints: seq[TLineInfo] = @ []
|
||||
var checkPoints: seq[TLineInfo] = @[]
|
||||
|
||||
proc addCheckpoint(info: TLineInfo) =
|
||||
var length: int
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue