introduce a ParExpression AST node type
See original GitHub issueI can no longer compile the language module, since new code like:
[""->""].map((k->v) => v else "<null>");
desugars to the invalid:
[""->""].map((entry) => let (k->v = entry) v else "null");
Ceylon AST complains:
Exception in thread "main" ceylon.language.AssertionError "Assertion failed: Check precedence
violated is DisjoiningExpression|IfElseExpression|LetExpression expression = expressionToCeylon(letClause.expression, update)"
at ceylon.ast.redhat.letExpressionToCeylon_.letExpressionToCeylon(LetExpression.ceylon:25)
at ceylon.ast.redhat.expressionToCeylon_.expressionToCeylon(Expression.ceylon:31)
The Redhat AST is:
| | | | | | | | | | + [Expression] (2:27-2:41) : String
| | | | | | | | | | | + [LetExpression] (2:27-2:41) : String
| | | | | | | | | | | | + [LetClause] (2:27-2:41)
| | | | | | | | | | | | | + [Destructure] (2:18-2:21)
| | | | | | | | | | | | | | + [ValueModifier] : unknown
| | | | | | | | | | | | | | + [KeyValuePattern] (2:18-2:21)
| | | | | | | | | | | | | | | + [VariablePattern] (2:18-2:18)
| | | | | | | | | | | | | | | | + [Variable] (2:18-2:18) : value k => String
| | | | | | | | | | | | | | | | | + k [Identifier] (2:18-2:18)
| | | | | | | | | | | | | | | | | + [ValueModifier] : String
| | | | | | | | | | | | | | | + [VariablePattern] (2:21-2:21)
| | | | | | | | | | | | | | | | + [Variable] (2:21-2:21) : value v => String
| | | | | | | | | | | | | | | | | + v [Identifier] (2:21-2:21)
| | | | | | | | | | | | | | | | | + [ValueModifier] : String
| | | | | | | | | | | | | | + [SpecifierExpression]
| | | | | | | | | | | | | | | + [Expression] : String->String
| | | | | | | | | | | | | | | | + [BaseMemberExpression] : String->String : _0 : value run.anonymous#0._0 => String->String
| | | | | | | | | | | | | | | | | + _0 [Identifier]
| | | | | | | | | | | | | | | | | + [InferredTypeArguments]
| | | | | | | | | | | | | + [Expression] (2:27-2:41) : String
| | | | | | | | | | | | | | + else [DefaultOp] (2:27-2:41) : String
| | | | | | | | | | | | | | | + [BaseMemberExpression] (2:27-2:27) : String : v : value v => String [!][expression type is not optional: 'String' cannot be null]
| | | | | | | | | | | | | | | | + v [Identifier] (2:27-2:27)
| | | | | | | | | | | | | | | | + [InferredTypeArguments]
| | | | | | | | | | | | | | | + <null> [StringLiteral] (2:34-2:41) : String
Issue Analytics
- State:
- Created 7 years ago
- Comments:20 (19 by maintainers)
Top Results From Across the Web
ast — Abstract Syntax Trees
Source code: Lib/ast.py The ast module helps Python applications to process trees of the ... This type must be used when building a...
Read more >Introduction to Abstract Syntax Trees
Traversing an AST means visiting the different nodes of the tree to gain insights or perform actions. One of the most common use...
Read more >ASTNode (JavaScript Development Tools API Specification)
An AST node represents a JavaScript source code construct, such as a name, type, expression, statement, or declaration. Each AST node belongs to...
Read more >Programming Project #4: Abstract Syntax Trees
The file Ast.java documents the Abstract Syntax Tree data structure. There are many different kinds of AST node. For example, there is one ......
Read more >CS 160 - Project 4
This project has two main steps: first understand the AST classes that you will use to build the AST, then write Bison actions...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It sounds like we’re resorting to nastiness here to paper over the lack of a
Tree.ParenthesizedExpression
AST node type. Why not just add one?@gavinking Thanks!