Libraryless. Click here for Pure Java version (3185L/19K).
1 | svoid test_tok_findBeginningOfJavaXTerm() { |
2 | LS tok = javaTok([[ a~.b ]]); |
3 | assertEqualsVerbose("a", get(tok, tok_findBeginningOfJavaXTerm(tok, indexOf(tok, "a")))); |
4 | assertEqualsVerbose("a", get(tok, print(tok_findBeginningOfJavaXTerm(tok, print(indexOf(tok, "b")))))); |
5 | tok = javaTok([[ = getGuild()~.getRoles() ]]); |
6 | assertEqualsVerbose("getGuild", get(tok, tok_findBeginningOfJavaXTerm(tok, indexOf(tok, ")")))); |
7 | |
8 | test_tok_findBeginningOfJavaXTerm("ret o.~a", "o"); |
9 | } |
10 | |
11 | svoid test_tok_findBeginningOfJavaXTerm(S src, S token) { |
12 | LS tok = javaTok(src); |
13 | int i = indexOfAnySubList(tok, ll(".", "", "~"), ll("~", "", ".")); |
14 | printVars_str(+i); |
15 | assertEqualsVerbose(token, get(tok, tok_findBeginningOfJavaXTerm(tok, i))); |
16 | } |
Began life as a copy of #1025038
download show line numbers debug dex old transpilations
Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1026295 |
Snippet name: | test_tok_findBeginningOfJavaXTerm |
Eternal ID of this version: | #1026295/10 |
Text MD5: | 21d7df0c41d16e761a43c793f8ceb152 |
Transpilation MD5: | da2c9e532fa5ce2404dcb986f86c1b03 |
Author: | stefan |
Category: | javax / transpiling |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-06-05 09:08:48 |
Source code size: | 750 bytes / 16 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 246 / 370 |
Version history: | 9 change(s) |
Referenced in: | [show references] |