Skip to content

DSLD: AssignedVariable pointcut does not match in non-declaring assignment #600

@ybayk

Description

@ybayk

For the given pointcut
contribute(bind(exprs: assignedVariable())) {...}

The following use cases work as expected:

  //note we do NOT declare variable foo here 
  foo = {
     bar {
       baz { | }
     }
   }

or works with declaration

def foo = |

But the following use case fails to match:
foo = |

ErrorRecoveredCSTParserPlugin fails to obtain an AST in case of simple assignment, but succeed in case of declarative assignment, for which groovy.g has an GRECLIPSE specific recovery for incomplete binary expression by injecting a right side variable "?"

The problem with simple (non-declarative) assignment is that similar recovery is missing in assignmentExpression.

PR is coming

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions