98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
|
# File 'lib/teepee/command-parser.rb', line 98
def builtins
case command.word
when "backslash",
"bslash",
"-/"
commander.backslash
when "left-brace",
"left_brace",
"leftbrace",
"lbrace",
"opening-brace",
"opening_brace",
"openingbrace",
"obrace",
"-("
commander.left_brace
when "right-brace",
"right_brace",
"rightbrace",
"rbrace",
"closing-brace",
"closing_brace",
"closingbrace",
"cbrace",
")-"
commander.right_brace
when "left-bracket",
"left_bracket",
"opening-bracket",
"opening_bracket",
"lbracket",
"obracket",
"(("
commander.left_bracket
when "right-bracket",
"right_bracket",
"closing-bracket",
"closing_bracket",
"rbracket",
"cbracket",
"))"
commander.right_bracket
when "pipe"
commander.pipe
when "backtick",
"backquote",
"'"
commander.backquote
when "squiggle",
"tilde"
commander.squiggle
when "dollar"
commander.dollar
when "_"
commander.nbsp optional_first_word_token
when "space"
commander.space
when "br", "newline"
commander.br
when "bold", "b", "textbf"
commander.b expressions
when "del",
"s",
"strike",
"strikethrough",
"strikeout"
commander.del expressions
when "italic",
"textit",
"it"
commander.it expressions
when "underline",
"u"
commander.u expressions
when "tt",
"texttt",
"teletype",
"typewriter"
commander.tt expressions
when "small"
commander.small expressions
when "big"
commander.big expressions
when "subscript",
"sub"
commander.sub expressions
when "superscript",
"sup"
commander.sup expressions
when "h1"
commander.h1 expressions
when "h2"
commander.h2 expressions
when "h3"
commander.h3 expressions
when "h4"
commander.h4 expressions
when "h5"
commander.h5 expressions
when "h6"
commander.h6 expressions
when "itemize",
"ul"
commander.itemize expressions
when "itemize-disc",
"ul-disc",
"itemize_disc",
"ul_disc",
"itemize-disk",
"ul-disk",
"itemize_disk",
"ul_disk"
commander.itemize_disc expressions
when "itemize-circle",
"ul-circle",
"itemize_circle",
"ul_circle"
commander.itemize_circle expressions
when "itemize-square",
"ul-square",
"itemize_square",
"ul_square"
commander.itemize_square expressions
when "itemize-none",
"ul-none",
"itemize_none",
"ul_none"
commander.itemize_none expressions
when "enumerate",
"ol"
commander.enumerate expressions
when "enumerate-numeric",
"enumerate_numeric",
"enumerate-1",
"ol-1",
"enumerate_1",
"ol_1"
commander.enumerate_numeric expressions
when "enumerate-uppercase",
"enumerate_uppercase",
"enumerate-upcase",
"enumerate_upcase",
"enumerate-A",
"ol-A",
"enumerate_A",
"ol_A"
commander.enumerate_uppercase expressions
when "enumerate-lowercase",
"enumerate_lowercase",
"enumerate-downcase",
"enumerate_downcase",
"enumerate-a",
"ol-a",
"enumerate_a",
"ol_a"
commander.enumerate_lowercase expressions
when "enumerate-roman-uppercase",
"enumerate_roman_uppercase",
"enumerate-roman-upcase",
"enumerate_roman_upcase",
"enumerate-I",
"ol-I",
"enumerate_I",
"ol_I"
commander.enumerate_roman_uppercase expressions
when "enumerate-roman-lowercase",
"enumerate_roman_lowercase",
"enumerate-roman-downcase",
"enumerate_roman_downcase",
"enumerate-i",
"ol-i",
"enumerate_i",
"ol_i"
commander.enumerate_roman_lowercase expressions
when "item",
"li"
commander.item expressions
when "let1"
subscoped_commander.let1 expressions
when "table"
commander.table expressions
when "tr",
"table-row",
"table_row"
commander.table_row expressions
when "th",
"table-header",
"table_header"
commander. expressions
when "td",
"table-data",
"table_data",
"table-cell",
"table_cell"
commander.table_data expressions
when "link",
"href",
"url"
commander.link expressions
when "email",
"email-address",
"email_address",
"mailto"
commander.mailto first_word_token
when "img",
"image"
commander.image expressions
when "user",
"user-id",
"user_id"
commander.user first_word_token
when "link-id",
"link_id"
commander.link_id first_word_token
when "keyword-id",
"keyword_id"
commander.keyword_id first_word_token
when "note-id",
"note_id"
commander.note_id first_word_token
when "tag-id",
"tag_id"
commander.tag_id first_word_token
when "forum-id",
"forum_id"
commander.forum_id first_word_token
when "folder-id",
"folder_id"
commander.folder_id first_word_token
when "bookmarks-folder-id",
"bookmarks_folder_id",
"bookmarks_folder-id",
"bookmarks-folder_id",
"bookmark-folder-id",
"bookmark_folder_id",
"bookmark_folder-id",
"bookmark-folder_id"
commander.bookmarks_folder_id first_word_token
when "i" commander.i
when "pi"
commander.pi
when "e"
commander.e
when "+"
commander.+ word_tokens
when "increment",
"inc"
commander.increment first_word_token
when "decrement",
"dec"
commander.decrement first_word_token
when "-"
commander.- word_tokens
when "*"
commander.* word_tokens
when "/",
"÷"
commander./ word_tokens
when "%"
commander.% word_tokens
when "+%"
commander.add_percentage word_tokens
when "-%"
commander.subtract_percentage word_tokens
when "%t",
"%total"
commander.percent_total word_tokens
when "floor"
commander.floor first_word_token
when "ceil",
"ciel",
"ceiling"
commander.ceiling first_word_token
when "round"
commander.round *word_tokens
when "mod",
"modulus",
"modulo"
commander.mod word_tokens
when "^", "**"
commander.** word_tokens
when "sin", "cos", "tan",
"asin", "acos", "atan",
"sinh", "cosh", "tanh",
"asinh", "acosh", "atanh",
"erf", "erfc",
"gamma", "log10", "sqrt"
commander.send command.word.to_sym, first_word_token
when "d2r",
"deg->rad",
"degrees->radians"
commander.degrees2radians first_word_token
when "r2d",
"rad->deg",
"radians->degrees"
commander.radians2degrees first_word_token
when "lgamma"
commander.lgamma first_word_token
when "ld",
"log2"
commander.ld first_word_token
when "ln"
commander.ln first_word_token
when "log"
base, number = word_tokens
commander.log base, number
when "ldexp"
fraction, exponent = word_tokens
commander.ldexp fraction, exponent
when "hypot"
commander.hypot word_tokens
when "true"
commander.true_constant
when "false"
commander.false_constant
when "not"
commander.boolean_not first_word_token
when "and"
commander.boolean_and expressions
when "or"
commander.boolean_or expressions
when "nand"
commander.boolean_nand expressions
when "nor"
commander.boolean_nor expressions
when "xor"
commander.boolean_xor expressions
when "xnor"
commander.boolean_xnor expressions
when "<"
commander.less_than word_tokens
when "<=",
"≤"
commander.less_than_or_equal word_tokens
when ">"
commander.greater_than word_tokens
when ">=",
"≥"
commander.greater_than_or_equal word_tokens
when "="
commander.equal word_tokens
when "!=",
"≠"
commander.not_equal word_tokens
when "if"
commander.if_operator expressions
when "when"
commander.when_operator expressions
when "unless"
commander.unless_operator expressions
when "comment",
"!--",
"#"
commander. expressions
when "span"
commander.span_operator expressions
when "prog1"
commander.prog1_operator expressions
when "progn"
commander.progn_operator expressions
when "prognil",
"side-effects",
"side-affects",
"effects",
"affects"
commander.prognil expressions
when "cond"
commander.cond_operator expressions
when "case"
commander.case_operator expressions
when "get"
commander.get_operator first_word_token
when "define",
"def"
commander.define expressions
when "undefine",
"undef"
commander.undefine expressions
when "defined?"
commander.is_defined? word_tokens
when "dotimes"
commander.dotimes expressions
else
command_error "unknown command #{command.to_html}"
end
end
|