Skip to content

Support Multi-expression runtime node #62

Open
@tmteam

Description

@tmteam

Assume '<{ … }>' as multiline node (not in syntax, but for example of how it works under the hood)

for example:


a = let:
          d = b**2 -4a*c
          {       #value to return
                  x1 = ( -b + sqrt(d))/2a
                  x2 = (-b - sqrt(d)) /2a
          }
       end

# turns into

a = 
          <{
              d = b**2 -4a*c
              return {  #value to return
                  x1 = ( -b + sqrt(d))/2a
                  x2 = (-b - sqrt(d)) /2a
              }
          }>   
a = x<y<z

# turns into

a = 
    <{
        r1 = x<y
        return 
            if(not r1) false
            else  y<z
    >}

multi-expression node , semantically, can contains only assignment expressions and return statement at the end

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions