2024-01-14 00:48:57 +00:00
|
|
|
## the expression begins with a dictionary expression.
|
|
|
|
## it is not a function name and can'be be invoked.
|
|
|
|
#{100:1, 200: 3}; ##ERROR: syntax error - invalid callable
|
2024-04-10 10:23:15 +00:00
|
|
|
|
|
|
|
---
|
|
|
|
|
2024-04-14 17:23:55 +00:00
|
|
|
## you must enclose the binary expression with parentheses
|
|
|
|
## i := (i + 20)
|
|
|
|
|
|
|
|
i:=0;
|
|
|
|
while(i < 20) {
|
|
|
|
printf "hello world 안녕하신가\n"
|
2024-09-18 13:21:11 +00:00
|
|
|
i := i + 20 ##ERROR: syntax error - prohibited binary selector '+'
|
2024-04-14 17:23:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
---
|
|
|
|
|
2024-07-13 04:33:20 +00:00
|
|
|
if ##ERROR: syntax error - no conditional expression after 'if'
|
2024-04-12 15:48:23 +00:00
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
if (< 2 3) elif ##ERROR: syntax error - block expression expected as 'if' body
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
if (< 2 3) {} elif true else ##ERROR: syntax error - block expression expected as 'elif' body
|
|
|
|
|
|
|
|
---
|
|
|
|
|
2024-10-01 15:41:54 +00:00
|
|
|
if else ##ERROR: syntax error - 'else' prohibited in this context
|
2024-04-12 15:48:23 +00:00
|
|
|
|
|
|
|
---
|
|
|
|
|
2024-10-01 15:41:54 +00:00
|
|
|
if elif else ##ERROR: syntax error - 'elif' prohibited in this context
|
2024-04-12 15:48:23 +00:00
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
if (< 20 30) ##ERROR: syntax error - block expression expected as 'if' body
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
if (< 20 30) {
|
|
|
|
printf "ok\n"
|
|
|
|
} { ##ERROR: syntax error - redundant expression prohibited after 'if' body
|
|
|
|
printf "ok2\n"
|
|
|
|
}
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
if (< 20 30) else { ##ERROR: syntax error - block expression expected as 'if' body
|
|
|
|
printf "ok\n"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
catch (e) {} ##ERROR: syntax error - catch without try
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
try {} catch ##ERROR: syntax error - no exception variable for 'catch'
|
|
|
|
|
|
|
|
---
|
|
|
|
|
2024-04-10 10:23:15 +00:00
|
|
|
try {
|
|
|
|
throw "excetion message"
|
|
|
|
} catch (e a) { ##ERROR: syntax error - not proper exception variable
|
|
|
|
printf "EXCEPTION - %s\n" e
|
|
|
|
}
|
2024-04-10 10:48:49 +00:00
|
|
|
|
|
|
|
---
|
|
|
|
|
2024-04-12 15:48:23 +00:00
|
|
|
try { throw "1111"; } catch (e) ##ERROR: syntax error - block expression expected as 'catch' body
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
try { throw "1111"; } catch (e) {
|
|
|
|
printf "EXCEPTION - %s\n" e
|
|
|
|
} 20 ##ERROR: syntax error - redundant expression prohibited after
|
2024-04-13 08:17:15 +00:00
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
{
|
|
|
|
| a |
|
|
|
|
|
|
|
|
a := 30
|
|
|
|
fun a:get_999() { ##ERROR: exception not handled - "not class"
|
|
|
|
return 999;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
fun a:get_999() { ##ERROR: exception not handled - "a accessed without initialization"
|
|
|
|
return 999;
|
|
|
|
}
|
2024-09-26 10:50:57 +00:00
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
k := (core.basicAt "abcdefg" 1)
|
|
|
|
core.basicAtPut "xbcdefghiklmnl" 4 k ##ERROR: exception not handled - "receiver immutable - \"xbcdefghiklmnl\""
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
k := (core.basicAt #abcdefg 1)
|
|
|
|
core.basicAtPut #xbcdefghiklmnl 4 k ##ERROR: exception not handled - "receiver immutable - #xbcdefghiklmnl"
|