Merge pull request #5130 from jlp765/casted

Gramma change: casted or Casted to cast or Cast respectively
This commit is contained in:
Andreas Rumpf 2016-12-17 10:13:13 +01:00 • committed by GitHub
commit f8a9382819
2 changed files with 4 additions and 4 deletions

View file

@ -48,7 +48,7 @@ type
errIndexOutOfBounds, errIndexTypesDoNotMatch, errBracketsInvalidForType, errIndexOutOfBounds, errIndexTypesDoNotMatch, errBracketsInvalidForType,
errValueOutOfSetBounds, errFieldInitTwice, errFieldNotInit, errValueOutOfSetBounds, errFieldInitTwice, errFieldNotInit,
errExprXCannotBeCalled, errExprHasNoType, errExprXHasNoType, errExprXCannotBeCalled, errExprHasNoType, errExprXHasNoType,
errCastNotInSafeMode, errExprCannotBeCastedToX, errCommaOrParRiExpected, errCastNotInSafeMode, errExprCannotBeCastToX, errCommaOrParRiExpected,
errCurlyLeOrParLeExpected, errSectionExpected, errRangeExpected, errCurlyLeOrParLeExpected, errSectionExpected, errRangeExpected,
errMagicOnlyInSystem, errPowerOfTwoExpected, errMagicOnlyInSystem, errPowerOfTwoExpected,
errStringMayNotBeEmpty, errCallConvExpected, errProcOnlyOneCallConv, errStringMayNotBeEmpty, errCallConvExpected, errProcOnlyOneCallConv,
@ -229,7 +229,7 @@ const
errExprHasNoType: "expression has no type", errExprHasNoType: "expression has no type",
errExprXHasNoType: "expression \'$1\' has no type (or is ambiguous)", errExprXHasNoType: "expression \'$1\' has no type (or is ambiguous)",
errCastNotInSafeMode: "\'cast\' not allowed in safe mode", errCastNotInSafeMode: "\'cast\' not allowed in safe mode",
errExprCannotBeCastedToX: "expression cannot be casted to $1", errExprCannotBeCastToX: "expression cannot be cast to $1",
errCommaOrParRiExpected: "',' or ')' expected", errCommaOrParRiExpected: "',' or ')' expected",
errCurlyLeOrParLeExpected: "\'{\' or \'(\' expected", errCurlyLeOrParLeExpected: "\'{\' or \'(\' expected",
errSectionExpected: "section (\'type\', \'proc\', etc.) expected", errSectionExpected: "section (\'type\', \'proc\', etc.) expected",

View file

@ -127,7 +127,7 @@ proc checkConvertible(c: PContext, castDest, src: PType): TConvStatus =
discard discard
proc isCastable(dst, src: PType): bool = proc isCastable(dst, src: PType): bool =
## Checks whether the source type can be casted to the destination type. ## Checks whether the source type can be cast to the destination type.
## Casting is very unrestrictive; casts are allowed as long as ## Casting is very unrestrictive; casts are allowed as long as
## castDest.size >= src.size, and typeAllowed(dst, skParam) ## castDest.size >= src.size, and typeAllowed(dst, skParam)
#const #const
@ -223,7 +223,7 @@ proc semCast(c: PContext, n: PNode): PNode =
addSon(result, copyTree(n.sons[0])) addSon(result, copyTree(n.sons[0]))
addSon(result, semExprWithType(c, n.sons[1])) addSon(result, semExprWithType(c, n.sons[1]))
if not isCastable(result.typ, result.sons[1].typ): if not isCastable(result.typ, result.sons[1].typ):
localError(result.info, errExprCannotBeCastedToX, localError(result.info, errExprCannotBeCastToX,
typeToString(result.typ)) typeToString(result.typ))
proc semLowHigh(c: PContext, n: PNode, m: TMagic): PNode = proc semLowHigh(c: PContext, n: PNode, m: TMagic): PNode =