Transpiled version (103L) is out of date.
1 | static LS lambdaMapLike singlePredTok(ICharPred isPartOfToken, S s) { |
2 | new ArrayList<S> tok; |
3 | int l = s == null ? 0 : s.length(); |
4 | |
5 | int i = 0, n = 0; |
6 | while (i < l) { |
7 | int j = i; |
8 | char c; |
9 | |
10 | // scan for whitespace |
11 | while (j < l) { |
12 | c = s.charAt(j); |
13 | if (isPartOfToken.get(c)) |
14 | break; |
15 | else |
16 | ++j; |
17 | } |
18 | |
19 | tok.add(substring(s, i, j)); |
20 | i = j; |
21 | if (i >= l) break; |
22 | |
23 | // scan for non-whitespace |
24 | |
25 | do |
26 | ++j; |
27 | while (j < l && isPartOfToken.get(s.charAt(j))); |
28 | |
29 | tok.add(substring(s, i, j)); |
30 | i = j; |
31 | } |
32 | |
33 | if ((tok.size() % 2) == 0) tok.add(""); |
34 | ret tok; |
35 | } |
Began life as a copy of #1034375
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1034538 |
Snippet name: | singlePredTok - tokenizer based on a single predicate |
Eternal ID of this version: | #1034538/3 |
Text MD5: | fb138ae4faae2065aa0d2726f5767ed4 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-02-11 21:38:04 |
Source code size: | 672 bytes / 35 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 156 / 218 |
Version history: | 2 change(s) |
Referenced in: | [show references] |