2024-01-18 04:17:13 +00:00
|
|
|
# File showing examples of Kabel syntax
|
|
|
|
|
|
|
|
# Function/procedure definition
|
|
|
|
# 'using', 'and', and the commas should be lexed out because they don't mean
|
|
|
|
# anything However, they should be required nonetheless for the sake of
|
|
|
|
# clarity and consistency.
|
2024-01-19 03:51:57 +00:00
|
|
|
# ^^ perhaps? leave in if it's useful at parser
|
2024-01-18 04:17:13 +00:00
|
|
|
|
2024-01-19 03:51:57 +00:00
|
|
|
to myFunction using r, x, and p:
|
|
|
|
|
2024-01-18 04:17:13 +00:00
|
|
|
|
2024-01-19 03:51:57 +00:00
|
|
|
# Hoisting and declaration is implicit
|
|
|
|
n = 5;
|
|
|
|
_7 = 6;
|
|
|
|
_kt_hr = "string literal!";
|
2024-01-18 04:17:13 +00:00
|
|
|
|
2024-01-19 03:51:57 +00:00
|
|
|
# OOP-ish-ly:
|
|
|
|
# g = 7 + t.x.find(n, k, g+5, p) + 6;
|
|
|
|
g = (t's x: find using n, k, g + 5, p) + 6;
|
2024-01-18 04:17:13 +00:00
|
|
|
|
2024-01-19 03:51:57 +00:00
|
|
|
|
|
|
|
for module in p:
|