1 | // return new rule text, add comments to comments |
2 | sS gazelle_processSquareBracketAnnotations(S ruleText, LS comments) {
|
3 | LS lines = tlft(ruleText); |
4 | while (isSquareBracketed(last(lines))) |
5 | comments.add(deSquareBracket(popLast(lines))); |
6 | |
7 | int out = -1; |
8 | for i over lines: {
|
9 | S s = lines.get(i); |
10 | PairS p = splitTrailingSquareBracketStuff(s); |
11 | if (startsWith(s, "=>")) out = i; |
12 | if (nempty(p.b)) |
13 | comments.add( |
14 | (out >= 0 ? i == out && i == l(lines)-1 ? "out" : "out " + (i-out+1) : "in " + (i+1)) |
15 | + " = " + gazelle_canonicalizeLineType(p.b)); |
16 | lines.set(i, p.a); |
17 | } |
18 | |
19 | ret lines_rtrim(lines); |
20 | } |
Began life as a copy of #1021762
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1021782 |
| Snippet name: | gazelle_processSquareBracketAnnotations - extract comments from rule text |
| Eternal ID of this version: | #1021782/6 |
| Text MD5: | 6cf1fb335438ebbd675328c5d8c2cc9f |
| Author: | stefan |
| Category: | javax / gazelle |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2019-03-23 17:25:50 |
| Source code size: | 660 bytes / 20 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 525 / 577 |
| Version history: | 5 change(s) |
| Referenced in: | [show references] |