You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The record constants are not recorded.
In addition the ntField nodes are constructed different from ntField nodes elsewhere.
All ntField should be constructed the same, so that we don't need different code to decode them
depending on the context.
The fix:
procedureTPasSyntaxTreeBuilder.RecordConstant;
begin
FStack.Push(ntRecordConstant);
tryinherited;
finally
FStack.Pop;
end;
end;
procedureTPasSyntaxTreeBuilder.RecordFieldConstant;
var
Node: TSyntaxNode;
begin//A field in a record constant should have exactly the same layout//as a field in a class.//ntField (class)//+-- ntName (anName = name)//+-- ntType//Recordconstant//ntField (recordconstant)//+-- ntName//+-- ntExpression.
FStack.Push(ntField).AddChild(ntName).Attribute[anName]:= Lexer.Token;
tryinherited;
finally
FStack.Pop;
end;
end;
The text was updated successfully, but these errors were encountered:
JBontes
changed the title
Record constants are not recorded correctly + fields in record constants or recorded differently from other ntField nodes.
Record constants are not recorded correctly + fields in record constants are recorded differently from other ntField nodes.
Oct 15, 2017
JBontes
pushed a commit
to JBontes/DelphiAST
that referenced
this issue
Oct 15, 2017
This is esp. evident in the following example:
const
OperatorsInfo: array [0..2] of TOperatorInfo =
((Typ: ntAddr; AssocType: atRight),
(Typ: ntDeref; AssocType: atLeft),
(Typ: ntGeneric; AssocType: atRight));
All constants are incorrectly listed as one long list, instead of as separate records.
Consider the following example:
The record constants are not recorded.
In addition the
ntField
nodes are constructed different fromntField
nodes elsewhere.All
ntField
should be constructed the same, so that we don't need different code to decode themdepending on the context.
The fix:
The text was updated successfully, but these errors were encountered: