Logo
Explore Help
Register Sign In
tomoaki/hakorune
1
0
Fork 0
You've already forked hakorune
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
f4ab5ca5f4f04c7c982c6181a80e513546fda98c
hakorune/apps/loop-continue-demo/main.hako

15 lines
200 B
Plaintext
Raw Normal View History

grammar(P0): add peek expression, continue statement, and field type annotations acceptance; add sample apps and interpreter path\n\n- tokenizer: add keywords (peek, continue), tokens (=> as FatArrow, :: as DoubleColon), keep >> as Arrow\n- parser: implement peek as expression (literal patterns only, else required), add continue; accept field 'name: Type' (discard type P0)\n- interpreter: evaluate PeekExpr; add Continue control flow handling\n- apps: add peek-demo, loop-continue-demo, adjust field-decl demo; use ConsoleBox instead of env.console for interpreter backend\n- docs: CURRENT_TASK updated earlier for Phase 12.7 P0\n\nNOTE: peek arms currently single-expression (no block expr yet); VM/MIR path does not lower PeekExpr yet; use --backend interpreter for demos
2025-09-03 15:26:15 +09:00
// continue demo: sum of 1..5 skipping 3
local i = 0
local sum = 0
loop (i < 5) {
i = i + 1
if i == 3 {
continue
}
sum = sum + i
}
local con = new ConsoleBox()
con.println("sum=" + sum)
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.2 Page: 73ms Template: 3ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API