// returns: (condition, goto, closing line number) // or null static Triple<S, S, Int> ctxCaseGoto(L<S> lines, int i) { new Matches m; while (i <= l(lines) && emptyAfterTrim(get(lines, i))) ++i; if (!flexMatch("CASE (*) ACTION", get(lines, i), m, false)) null; S condition = $1; if (!flexMatch("[GOTO] = *", get(lines, i+1), m, false)) null; S target = $1; int closing = indexOfClosingCurlyBracket(lines, i+2); ret triple(condition, target, closing); }
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1008883 |
Snippet name: | ctxCaseGoto |
Eternal ID of this version: | #1008883/4 |
Text MD5: | 6194b9958990e89569fe2d9d62935183 |
Author: | stefan |
Category: | javax / a.i. |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-06-15 18:38:47 |
Source code size: | 480 bytes / 12 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 591 / 599 |
Version history: | 3 change(s) |
Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) #1008885 - ctxCaseGotos #1008894 - ctxAction - old, use ctxCase(s) instead #1008924 - ctxCase |