Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

18
LINES

< > BotCompany Repo | #1006346 // Auto-Add Closing Brackets Algorithm [Test tok_autoCloseBrackets, WORKS]

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (1301L/10K/31K).

1  
!7
2  
3  
p {
4  
  testFunc("print;", "print;");
5  
  testFunc("print(;", "print();");
6  
  testFunc("print(x(;", "print(x());");
7  
  testFunc("print(x(z, y;", "print(x(z, y));");
8  
  testFunc("print(x(z, y);", "print(x(z, y));");
9  
  testFunc("for (i = 1; i; i) {}", "for (i = 1; i; i) {}");
10  
  testFunc("for (i = x(; i; i) {}", "for (i = x(); i; i) {}");
11  
  testFunc("for ping (Set<S> seen = new LinkedHashSet; l(set) < 100; ) {", "for ping (Set<S> seen = new LinkedHashSet; l(set) < 100; ) {");
12  
13  
  print("OK");
14  
}
15  
16  
svoid testFunc(S in, S out) {
17  
  assertEqualsVerbose(in + " => " + out, out, tok_autoCloseBrackets(in));
18  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, sawdedvomwva, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1006346
Snippet name: Auto-Add Closing Brackets Algorithm [Test tok_autoCloseBrackets, WORKS]
Eternal ID of this version: #1006346/2
Text MD5: e2fe09874dff039b88680db9a62b605b
Transpilation MD5: 005c8efedd35f1cefb330e4f8bd47905
Author: stefan
Category: javax / parsing
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-08-11 16:39:05
Source code size: 616 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 1202 / 1313
Version history: 1 change(s)
Referenced in: [show references]