We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TOperators
TSyntaxNodeType
If I add a new operator and mix up the definition for TOperators, DelphiAST will not complain.
A simple fix solves this issue, forcing the two structures to be in sync.
const OperatorsInfo: array [ntAddr..ntIs] of TOperatorInfo = //1: use A TSyntaxNodeType as the index. ((Typ: ntAddr; Priority: 1; Kind: okUnary; AssocType: atRight), (Typ: ntDoubleAddr; Priority: 1; Kind: okUnary; AssocType: atRight), (Typ: ntDeref; Priority: 1; Kind: okUnary; AssocType: atLeft), ... class function TOperators.GetItem(Typ: TSyntaxNodeType): TOperatorInfo; begin Assert(Typ = OperatorsInfo[Typ].Typ); //2: force the Typ's to match. if (Typ in [ntAddr..ntIs]) then Exit(OperatorsInfo[Typ]) else Assert(false); //do not allow buffer overruns. end;
The text was updated successfully, but these errors were encountered:
RomanYankovsky#258 type safe TOperators. RomanYankovsky#217 fix cor…
1e3101d
…ruption of childnode list.
RomanYankovsky#258 minor tweak
3f8415e
No branches or pull requests
If I add a new operator and mix up the definition for
TOperators
, DelphiAST will not complain.A simple fix solves this issue, forcing the two structures to be in sync.
The text was updated successfully, but these errors were encountered: