Add for parsing to parser test

This commit is contained in:
Sasha Koshka
2024-03-15 03:03:39 -04:00
parent 36dc8c769c
commit 43c2e23999

View File

@@ -72,6 +72,8 @@ testString (test,
- [ifElse]:Int = if true then 4 else 5
- [dangleElse]:Int = if true then if false then 3 else 5
- [loop]:Int = {i:Int=0 if [< i 3] then return 1 loop {[print 3] if [> i 3] then break 0 i=[++ i]}}
- [for s:String] = for i:Index e:Byte in str if [> i 3] then [break e]
- [for s:String] = for e:Byte in s [break e]
- [matchToInt u:(| Int F64)]:Int = match u | u:Int u | u:F64 [~ Int u]`,
// input
`
@@ -118,6 +120,10 @@ testString (test,
i = [++ i]
}
}
[for s:String] = for i:Index e:Byte in str
if [> i 3] then [break e]
[for s:String] = for e:Byte in s
[break e]
[matchToInt u:(| Int F64)]:Int = match u
| u:Int u
| u:F64 [~Int u]