mirror of
https://github.com/microsoft/regorus.git
synced 2026-08-05 02:16:11 +00:00
Rework assign operations (#6)
Support "var = value", "value = var", and "var = var" Fall back the '=' to comparsion when both operators are defined Correctly support variable shadowing with "var := value" Also, remove the unused Variable struct Signed-off-by: Ming-Wei Shih <mishih@microsoft.com>
This commit is contained in:
@@ -24,6 +24,14 @@ cases:
|
||||
x == 4
|
||||
}
|
||||
|
||||
default y = 10
|
||||
|
||||
z = y {
|
||||
y
|
||||
}
|
||||
|
||||
y = 20
|
||||
|
||||
default d = "has_default"
|
||||
|
||||
default object["key"] = "string"
|
||||
@@ -51,6 +59,8 @@ cases:
|
||||
x: 5
|
||||
a: -6
|
||||
b: -6
|
||||
y: 20
|
||||
z: 20
|
||||
c: "has_default"
|
||||
d: "has_default"
|
||||
object:
|
||||
|
||||
Reference in New Issue
Block a user