Libraryless. Click here for Pure Java version (2723L/17K).
1 | sbool tok_shouldAddReturn(LS tok) { |
2 | S lastToken = get(tok, l(tok)-2); |
3 | if (eqOneOf(lastToken, ";", null)) false; |
4 | if (eq(lastToken, "}")) { |
5 | int i = findBeginningOfBlock(tok, l(tok)-2); |
6 | ret eqGet(tok, i-4, "-") && eqGet(tok, i-3, "") && eqGet(tok, i-2, ">"); // it's a lambda definition |
7 | } |
8 | true; |
9 | } |
10 | |
11 | sbool tok_shouldAddReturn(S s) { |
12 | ret tok_shouldAddReturn(javaTok(s)); |
13 | } |
Began life as a copy of #1003852
download show line numbers debug dex old transpilations
Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1017258 |
Snippet name: | tok_shouldAddReturn |
Eternal ID of this version: | #1017258/5 |
Text MD5: | 2e06e2472c515075feb8459ac9d15026 |
Transpilation MD5: | c782a9d74627704ea3d2d909a059453e |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-11-04 12:16:37 |
Source code size: | 398 bytes / 13 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 336 / 434 |
Version history: | 4 change(s) |
Referenced in: | [show references] |