20
20
can be: advance clean eval hide html-editor js-editor js-unit legacy math ugly wordy
21
21
## -thread - disable an html-attribute via inline script
22
22
can be: advance clean eval hide html-editor js-editor js-unit legacy math ugly wordy
23
+ ## @x - emulates that JS version: 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.8.1, 1.8.5
23
24
## *a: b; - replace all $a with b (soft baste)
24
25
## **a: b; - replace all $a with parsed b (hard baste)
25
26
34
35
a--b - a_b
35
36
a#b - a[b]
36
37
a#0b - a[a.length - b]
37
- @ - this
38
+ @ - this or self, depending on the JS version
39
+ # - this or self, depending on the JS version
38
40
@a - this.a
39
41
$of - typeof
40
42
$del - delete
@@ -56,6 +58,7 @@ $# - Object
56
58
.$val - value
57
59
.$qy - querySelector
58
60
.$Qy - querySelectorAll
61
+ ...$args - depending on the JS version, either calls on the last constructor, or does nothing
59
62
a: b - if there isn't a comma after b, there will be one added, unless b is the last item
60
63
61
64
-- functions --
@@ -97,7 +100,7 @@ a!?? - test if a doesn't exist
97
100
98
101
---- "Advance thread" features ----
99
102
.a - class x
100
- .a b - class a extends y
103
+ .a b - class a extends b
101
104
*. - super
102
105
@(a, b, c) - constructor(a, b, c)
103
106
b => a - const a = b
@@ -110,6 +113,7 @@ prom a - creates a promissory function (like Java's "interface", Tux "gusset");
110
113
supported types: Array Boolean Function Number Object RegExp String Symbol * [any]
111
114
112
115
---- "Legacy thread" features ----
116
+ a ~= b - a = -(a - b)
113
117
a &= b - a = a && b
114
118
a |= b - a = a || b
115
119
a ^= b - if a != null, a = b
@@ -138,23 +142,27 @@ a[=] - a.reverse()
138
142
a[^]<b> - a.sort(b)
139
143
a[-] - a.pop()
140
144
d[] - if d is a number, it creates a d-dimension array (Tux Array "gores"), i.e. 3[] === [[[]]] /called on as [x][y][z]/
141
- d"..." - (Tux String "gores") if d is a number, then the string will be repeated d many times
142
- d'...' - if d is a number, then the string will be repeated d many times
143
- d`...` - if d is a number, then the string will be repeated d many times
144
145
r:a - if r is a reserved word, it will be double-quoted
145
146
.r - if r is a reserved word, it will be double-quoted and bracketed; ["r"]
146
147
147
148
-- Strings --
148
149
"${a}" - interpolation, ..." + a + "...
149
- '${a}' - interpolation, ...' + a + '...
150
- `${a}` - interpolation, ...` + a + `...
150
+ '${a}' - interpolation, ...' + a + '...
151
+ `${a}` - interpolation, ...` + a + `...
151
152
"..." "..." - automatic concatination, "..." + "..."
152
153
'...' '...' - automatic concatination, '...' + '...'
153
154
`...` `...` - automatic concatination, `...` + `...`
155
+ d * "..." - (Tux String "gores") if d is a number, then the string will be repeated d many times
156
+ d * '...' - if d is a number, then the string will be repeated d many times
157
+ d * `...` - if d is a number, then the string will be repeated d many times
154
158
155
159
-- RegExp --
160
+ \a - Alpha characters, [a-zA-Z]
161
+ \A - Non-alpha characters, [^a-zA-Z]
156
162
\j - JS variables, [a-zA-Z\$_][\w\d\$_]*
157
163
\J - non-JS variables, [^a-zA-Z\$_][\w\d\$_]*
164
+ \k - lowercase, \k[A-fR-Z] = /[a-fr-z]/
165
+ \K - uppercase, \K[A0fR-Z] = /[A-FR-Z]/
158
166
159
167
---- "Math thread" features ----
160
168
a(b) = c - function a(b){ return c; }
@@ -163,9 +171,9 @@ a~b - ((a % b + b) % b)
163
171
|a| - Math.abs(a)
164
172
a^b - Math.pow(a, b)
165
173
a**b - Math.pow(a, b)
166
- \a\ - Math.sqrt(a)
167
- a\b\ - "a" root of b, i.e. 3\x\ is the cube root of x
168
- a _ b - Math.floor(a/b) /notice the spaces/
174
+ /?a/ - Math.sqrt(a)
175
+ a/?b/ - "a" root of b, i.e. 3\x\ is the cube root of x
176
+ a%% b - Math.floor(a/b)
169
177
log a (b) - log, base a, of b /log(b) / log(a)/
170
178
@.property - Math.property, i.e. @.PI = Math.PI, @.log = Math.log /notice the ./
171
179
@@ -308,7 +316,8 @@ a /b/ - a(/b/)
308
316
309
317
---- Tuxedo Methods ----
310
318
* $ means executable
311
- * ~ means above, but with different arguments
319
+ * ~ means "same as above," but with different arguments
320
+ * # means a property, that isn't a method
312
321
* tuxedo === tux
313
322
tux
314
323
.get
@@ -337,4 +346,15 @@ $ .load[name] - tux.storage.get(name)
337
346
$ .delete[name] - tux.storage.delete(name)
338
347
$ .typeof[object] - returns the typeof "object" to a string, i.e. true === "<true>", [1, 2, 3] === "[1, 2, 3]"
339
348
$ .typeOf[a, b, c] - returns a string of each arguments type
340
- ********/
349
+ $ .precompiled - returns an object as if a snap-shot of the data being compiled
350
+ # .content - returns the actual "snap-shot"
351
+ # .channels - returns the channels {no}
352
+ # .comments - returns an object of the comments {plural, single}
353
+ # .regexps - returns the regexps
354
+ # .strings - returns an object of strings {double, grave, single}
355
+ # .threads - returns an object of threads {available, disabled, enabled}
356
+ $ .stamp - returns an object containing a start, stop, and difference of the TuxedoScript compile time {start, end, span}
357
+ # .version - the TuxedoScript version
358
+ $ .support - returns an array of all JS versions supported by the user's browser i.e. [1.1 ... 1.8.5]
359
+ $ .runtime - returns the JS version that has been detected
360
+ ********/
0 commit comments