JCF: Support for "enumerator" operator. Patch from Julian Puhl.

git-svn-id: trunk@46973 -
This commit is contained in:
juha 2014-11-23 16:24:58 +00:00
parent 5aecba92a0
commit a739015b9c
2 changed files with 16 additions and 4 deletions

View File

@ -2330,7 +2330,7 @@ const
OperatorTokens: TTokenTypeSet = [ttPlus, ttMinus, ttTimes, ttFloatDiv, ttExponent,
ttEquals, ttGreaterThan, ttLessThan, ttGreaterThanOrEqual, ttLessThanOrEqual,
ttAssign, ttPlusAssign, ttMinusAssign, ttTimesAssign, ttFloatDivAssign, ttXor,
ttAnd, ttOr];
ttAnd, ttOr, ttEnumerator];
begin
Recognise(OperatorTokens);
end;
@ -3960,6 +3960,11 @@ begin
Recognise(ttMessage);
RecogniseConstantExpression;
end;
ttEnumerator:
begin
Recognise(ttEnumerator);
RecogniseIdentifier(False, idStrict);
end
else
Recognise(ProcedureDirectives);
end;
@ -5325,7 +5330,7 @@ const
for non-array properties it is followed by an identifier
}
PropertyDirectives = [ttDefault, ttNoDefault, ttStored];
PropertyDirectives = [ttDefault, ttNoDefault, ttStored, ttEnumerator];
begin
if ((fcTokenList.FirstSolidTokenType = ttSemicolon) and
(fcTokenList.SolidTokenType(2) in PropertyDirectives)) or
@ -5355,6 +5360,11 @@ begin
if fcTokenList.FirstSolidTokenType <> ttSemicolon then
RecogniseConstantExpression;
end;
ttEnumerator:
begin
Recognise(ttEnumerator);
RecogniseIdentifier(False, idStrict);
end;
end;
PopNode;

View File

@ -101,6 +101,7 @@ type
ttDownto,
ttElse,
ttEnd,
ttEnumerator,
ttExcept,
ttExports,
ttFile,
@ -350,7 +351,7 @@ const
ttVirtual, ttCdecl, ttMessage, ttName, ttRegister, ttDispId,
ttNear, ttDynamic, ttExport, ttOverride, ttResident, ttLocal,
ttOverload, ttReintroduce,
ttDeprecated, ttLibrary, ttPlatform, ttStatic, ttFinal, ttVarArgs, ttUnsafe];
ttDeprecated, ttLibrary, ttPlatform, ttStatic, ttFinal, ttVarArgs, ttUnsafe, ttEnumerator];
ClassDirectives: TTokenTypeSet =
[ttPrivate, ttProtected, ttPublic, ttPublished, ttAutomated, ttStrict];
@ -382,7 +383,7 @@ const
VariantTypes: TTokenTypeSet = [ttVariant, ttOleVariant];
Operators: TTokenTypeSet = [ttAnd .. ttNotEqual];
Operators: TTokenTypeSet = [ttAnd .. ttNotEqual, ttEnumerator];
{ these words are
- operators
@ -578,6 +579,7 @@ begin
AddKeyword('downto', wtReservedWord, ttDownTo);
AddKeyword('else', wtReservedWord, ttElse);
AddKeyword('end', wtReservedWord, ttEnd);
AddKeyword('enumerator', wtReservedWord, ttEnumerator);
AddKeyword('except', wtReservedWord, ttExcept);
AddKeyword('exports', wtReservedWord, ttExports);
AddKeyword('file', wtReservedWord, ttFile);