[jbosstools-issues] [JBoss JIRA] (ERT-354) ASTParser does not parse expressions like `var a = b; ` correctly. [EBZ#498370]

Gorkem Ercan (JIRA) issues at jboss.org
Wed Jul 27 08:11:00 EDT 2016


     [ https://issues.jboss.org/browse/ERT-354?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gorkem Ercan updated ERT-354:
-----------------------------
    Story Points: 10


> ASTParser does not parse expressions like `var a = b;` correctly. [EBZ#498370]
> ------------------------------------------------------------------------------
>
>                 Key: ERT-354
>                 URL: https://issues.jboss.org/browse/ERT-354
>             Project: Eclipse Release Train
>          Issue Type: Task
>          Components: JSDT
>            Reporter: Friendly Jira Robot
>              Labels: General, bzira
>
> The AST generated by org.eclipse.wst.jsdt.core.dom.ASTParser.createAST() is incorrect.
> For the expression `var a = b`, the AST does not recognize `a` as the variable, instead representing the statement as `var b`
> E.g. (Parentheses indicate the ASTNode's toString())
> Statement: var b = 15; 
> AST:
> [...]
>     VariableDeclarationStatement   (var b=20)
>       InferredType 
>       VariableDeclarationFragment  (b=20)
>         SimpleName                 (b)
>         NumberLiteral              (20)
> Statement: var b = a;
> AST:
> [...]
>     VariableDeclarationStatement   (var a)
>       InferredType
>       VariableDeclarationFragment  (a)
>         SimpleName                 (a)
> The problem is not present for other node types (e.g. Assignment), not is it present when the right-hand-side contains an expression (e.g. `var c = b + a`)



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the jbosstools-issues mailing list