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
To be able to process the AST outside of Go, for example to visualize it in an AST explorer, or use it for pretty-printing, the JSON representation must be improved:
Type information is necessary, e.g. to distinguish a boolean from a nil expression
Position information must be eagerly included. The internal representation computes it sometimes from child elements
Definition of Done
Implement and test json.MarshalJSON for the following types, adding a Type property where the element is polymorphic (e.g. expressions), and position information as StartPos and EndPos properties:
Access
Argument
Block
FunctionBlock
Condition
CompositeDeclaration
FieldDeclaration
ConditionKind
BoolExpression
NilExpression
StringExpression
IntegerExpression
FixedPointExpression
ArrayExpression
DictionaryExpression
IdentifierExpression
InvocationExpression
MemberExpression
IndexExpression
ConditionalExpression
UnaryExpression
BinaryExpression
FunctionExpression
CastingExpression
CreateExpression
DestroyExpression
ReferenceExpression
ForceExpression
PathExpression
FunctionDeclaration
SpecialFunctionDeclaration
ImportDeclaration
Identifier
IdentifierLocation
StringLocation
AddressLocation
InterfaceDeclaration
Members
Operation
Parameter
ParameterList
Program
ReturnStatement
BreakStatement
ContinueStatement
IfStatement
WhileStatement
ForStatement
EmitStatement
AssignmentStatement
SwapStatement
ExpressionStatement
TransactionDeclaration
Transfer
TransferOperation
TypeAnnotation
NominalType
OptionalType
VariableSizedType
ConstantSizedType
DictionaryType
FunctionType
ReferenceType
RestrictedType
InstantiationType
VariableDeclaration
VariableKind
DeclarationKind
CompositeKind
PragmaDeclaration
The text was updated successfully, but these errors were encountered:
Context
To be able to process the AST outside of Go, for example to visualize it in an AST explorer, or use it for pretty-printing, the JSON representation must be improved:
Definition of Done
Implement and test
json.MarshalJSON
for the following types, adding aType
property where the element is polymorphic (e.g. expressions), and position information asStartPos
andEndPos
properties:Access
Argument
Block
FunctionBlock
Condition
CompositeDeclaration
FieldDeclaration
ConditionKind
BoolExpression
NilExpression
StringExpression
IntegerExpression
FixedPointExpression
ArrayExpression
DictionaryExpression
IdentifierExpression
InvocationExpression
MemberExpression
IndexExpression
ConditionalExpression
UnaryExpression
BinaryExpression
FunctionExpression
CastingExpression
CreateExpression
DestroyExpression
ReferenceExpression
ForceExpression
PathExpression
FunctionDeclaration
SpecialFunctionDeclaration
ImportDeclaration
Identifier
IdentifierLocation
StringLocation
AddressLocation
InterfaceDeclaration
Members
Operation
Parameter
ParameterList
Program
ReturnStatement
BreakStatement
ContinueStatement
IfStatement
WhileStatement
ForStatement
EmitStatement
AssignmentStatement
SwapStatement
ExpressionStatement
TransactionDeclaration
Transfer
TransferOperation
TypeAnnotation
NominalType
OptionalType
VariableSizedType
ConstantSizedType
DictionaryType
FunctionType
ReferenceType
RestrictedType
InstantiationType
VariableDeclaration
VariableKind
DeclarationKind
CompositeKind
PragmaDeclaration
The text was updated successfully, but these errors were encountered: