onelang / OneLang

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compact generic transforms

koczkatamas opened this issue · comments

Add an option to describe the transformation in the following form:

 - input: $object[$elementExpr] = $newValue
   output: $object.set($elementExpr, $newValue)

which will do the same as now this:

  - description: "$object[$elementExpr] = $newValue -> $object.set($elementExpr, $newValue)"
    input:
      exprKind: Binary
      operator: =
      left:
        exprKind: ElementAccess
        object: $object
        elementExpr: $elementExpr
      right: $newValue
    output:
      exprKind: Call
      method:
        exprKind: PropertyAccess
        object: $object
        propertyName: set
      arguments: [$elementExpr, $newValue]