Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Multi-expression runtime node #62

Open
tmteam opened this issue Jan 30, 2023 · 0 comments
Open

Support Multi-expression runtime node #62

tmteam opened this issue Jan 30, 2023 · 0 comments

Comments

@tmteam
Copy link
Owner

tmteam commented Jan 30, 2023

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

@tmteam tmteam changed the title Support Multi-expression node Support Multi-expression runtime node Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant