1 | // not including <> as they are ambiguous (< is also a comparison operator) |
2 | static S testBracketHygiene_op = "([{"; |
3 | static S testBracketHygiene_close = ")]}"; |
4 | |
5 | static bool testBracketHygiene(S s) { |
6 | ret testBracketHygiene(s, testBracketHygiene_op, testBracketHygiene_close, null); |
7 | } |
8 | |
9 | static bool testBracketHygiene(S s, Var<S> msg) { |
10 | ret testBracketHygiene(s, testBracketHygiene_op, testBracketHygiene_close, msg); |
11 | } |
12 | |
13 | static bool testBracketHygiene(S s, S op, S close, Var<S> msg) { |
14 | Pair<Int, S> p = testBracketHygiene2(s, op, close); |
15 | if (p == null) { |
16 | if (msg != null) msg.set("Hygiene OK!"); |
17 | true; |
18 | } |
19 | if (msg != null) msg.set(p.b); |
20 | false; |
21 | } |
Began life as a copy of #1003920
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1003922 |
Snippet name: | testBracketHygiene - uses Java brackets (except <>) and javaTok |
Eternal ID of this version: | #1003922/5 |
Text MD5: | 2983c7aadc568ced58c9e4a6f6f0b562 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-05-06 19:13:28 |
Source code size: | 684 bytes / 21 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 559 / 589 |
Version history: | 4 change(s) |
Referenced in: | [show references] |