mirror of
https://github.com/microsoft/regorus.git
synced 2026-08-05 02:16:11 +00:00
Statement Scheduler Implementation
Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
This commit is contained in:
committed by
Anand Krishnamoorthi
parent
6738eeed3c
commit
7789de41b6
@@ -0,0 +1,45 @@
|
||||
# Copyright (c) Microsoft Corporation.
|
||||
# Licensed under the MIT License.
|
||||
|
||||
cases:
|
||||
- note: basic
|
||||
modules:
|
||||
- |
|
||||
package test
|
||||
|
||||
x = y {
|
||||
p = 1
|
||||
# var can appear on rhs
|
||||
2 = q
|
||||
y = p
|
||||
# No local var is created for r
|
||||
r = 1
|
||||
|
||||
# Nested scope
|
||||
x := [ k |
|
||||
a = k
|
||||
# A loop index var with same name as parent scope.
|
||||
# The outer var is used.
|
||||
[1,2,3][idx]
|
||||
r1 = { q |
|
||||
# := forces a local variable
|
||||
rrr = t
|
||||
q := [1, 2, 3][idx1]
|
||||
}
|
||||
]
|
||||
|
||||
[a, [b]] = [[p], q]
|
||||
|
||||
# an index var
|
||||
[1,2, 3][idx]
|
||||
}
|
||||
|
||||
r = 1
|
||||
rrr = "fun"
|
||||
scopes:
|
||||
- locals: ["p", "y", "q", "x", "a", "b", "idx"]
|
||||
inputs: ["r", "rrr"]
|
||||
- locals: ["k", "r1"]
|
||||
inputs: ["a", "idx", "rrr"]
|
||||
- locals: ["q", "idx1", "t"]
|
||||
inputs: ["rrr"]
|
||||
Reference in New Issue
Block a user