static LS nl_convertMatchExpressionToPatternList(S s) { new LinkedHashSet<S> patterns; for (S s2 : tok_splitAtOrOperator(s)) { Pair<S, LS> p = tok_parseFunctionCall(s2); if (p == null || !isQuoted(first(p.b))) null; S pat = unquote(first(p.b)); if (eqOneOf(p.a, 'match_vbar, 'match)) patterns.addAll(tok_splitAtVerticalBar(pat)); else if (eqOneOf(p.a, 'matchStart_vbar, 'matchStart)) patterns.addAll(appendToAll(" ...", tok_splitAtVerticalBar(pat))); else if (eqOneOf(p.a, 'matchEnd_vbar, 'matchEnd)) patterns.addAll(prependToAll("... ", tok_splitAtVerticalBar(pat))); else fail(p.a); } ret asList(patterns); }
download show line numbers debug dex old transpilations
Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1020828 |
| Snippet name: | nl_convertMatchExpressionToPatternList |
| Eternal ID of this version: | #1020828/2 |
| Text MD5: | f7ac0b93da06ff7531a4eee86ec2a480 |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2019-01-03 20:07:35 |
| Source code size: | 694 bytes / 19 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 441 / 497 |
| Version history: | 1 change(s) |
| Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) |