Libraryless. Click here for Pure Java version (6200L/35K).
| 1 | sclass Tok_SettableFields > Tok_SettableOrGettableFields {
 | 
| 2 | |
| 3 |   *() {
 | 
| 4 |     super("settable");
 | 
| 5 | recognizedModifiers = listPlus(recognizedModifiers, "void"); | 
| 6 | } | 
| 7 | |
| 8 |   S replacement() {
 | 
| 9 | bool returnThis = !contains(modifiers, "void"); | 
| 10 | S returnType = returnThis ? "selfType" : "void"; | 
| 11 | ret tok_formatDollarVars( | 
| 12 |       "$fMod $returnType $var aka $setVar($type $var) { this.$var = $var; $returnStatement } gettable $modifiers $type",
 | 
| 13 | fMod := joinWithSpace(functionModifiers()) + " public", | 
| 14 | modifiers := joinWithSpace(listMinus(modifiers, "void")), | 
| 15 | +type, +var, +returnType, | 
| 16 | $returnStatement := returnThis ? "this;" : "", | 
| 17 | setVar := "set" + firstToUpper(var)); | 
| 18 | } | 
| 19 | } | 
Began life as a copy of #1033793
download show line numbers debug dex old transpilations
Travelled to 4 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
| Snippet ID: | #1033794 | 
| Snippet name: | Tok_SettableFields | 
| Eternal ID of this version: | #1033794/8 | 
| Text MD5: | 67396a54d9dd79fe6a47252bc3e2f168 | 
| Transpilation MD5: | 725890d0fc556a2ffada6c431cfc4434 | 
| Author: | stefan | 
| Category: | javax / transpiling | 
| Type: | JavaX fragment (include) | 
| Public (visible to everyone): | Yes | 
| Archived (hidden from active list): | No | 
| Created/modified: | 2022-02-03 03:03:59 | 
| Source code size: | 717 bytes / 19 lines | 
| Pitched / IR pitched: | No / No | 
| Views / Downloads: | 431 / 608 | 
| Version history: | 7 change(s) | 
| Referenced in: | [show references] |