1 | static LS nl_convertMatchExpressionToPatternList(S s) { |
2 | new LinkedHashSet<S> patterns; |
3 | |
4 | for (S s2 : tok_splitAtOrOperator(s)) { |
5 | Pair<S, LS> p = tok_parseFunctionCall(s2); |
6 | if (p == null || !isQuoted(first(p.b))) null; |
7 | S pat = unquote(first(p.b)); |
8 | if (eqOneOf(p.a, 'match_vbar, 'match)) |
9 | patterns.addAll(tok_splitAtVerticalBar(pat)); |
10 | else if (eqOneOf(p.a, 'matchStart_vbar, 'matchStart)) |
11 | patterns.addAll(appendToAll(" ...", tok_splitAtVerticalBar(pat))); |
12 | else if (eqOneOf(p.a, 'matchEnd_vbar, 'matchEnd)) |
13 | patterns.addAll(prependToAll("... ", tok_splitAtVerticalBar(pat))); |
14 | else |
15 | fail(p.a); |
16 | } |
17 | |
18 | ret asList(patterns); |
19 | } |
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: | 246 / 292 |
Version history: | 1 change(s) |
Referenced in: | [show references] |