Libraryless. Click here for Pure Java version (8094L/47K).
1 | sS addFunctionNameToInclude(S snippetID, S functionName) { |
2 | LS tok = javaTokSnippet(snippetID); |
3 | var pif = tok_nextPleaseIncludeFunctionsStatement(tok); |
4 | if (pif == null) ret "PIF statement not found in snippet"; |
5 | |
6 | if (pif.containsFunction(functionName)) ret functionName + " already included"; |
7 | |
8 | int i = pif.iFirstIdentifier; |
9 | tokPrepend(tok, i, functionName + or2(javaDropComments(tok.get(i+1)), " ")); |
10 | |
11 | ret editSnippet(snippetID, join(tok)); |
12 | } |
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1034736 |
Snippet name: | addFunctionNameToInclude |
Eternal ID of this version: | #1034736/3 |
Text MD5: | 35230906ca69b0c1a12745784115472c |
Transpilation MD5: | a0669ef15eed61455938379294bfd6f9 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-03-07 23:12:51 |
Source code size: | 471 bytes / 12 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 128 / 203 |
Version history: | 2 change(s) |
Referenced in: | [show references] |