-
Notifications
You must be signed in to change notification settings - Fork 0
/
funcSugPy.peggyjs
628 lines (551 loc) · 18.1 KB
/
funcSugPy.peggyjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
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
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
{
let indentationCount = 0
let indentationStack = []
function toIdentifier(p_stringName_or_identifier) {
if (p_stringName_or_identifier instanceof Expression) return p_stringName_or_identifier
return new Expression('identifier', p_stringName_or_identifier, p_stringName_or_identifier)
}
function toExpression(ps_name, pArrayExpression, pExprLabel, pCancelExpr, pMultLabel) {
return new Expression(
'expression',
[toIdentifier(ps_name)].concat(pArrayExpression.flat()),
text(),
pExprLabel,
pCancelExpr,
pMultLabel
)
}
function Expression(type, content, text, exprLabel, cancelExpression, multLabel) {
this.type = type
this.content = content
this.text = text
this.exprLabel = exprLabel
this.cancelExpression = cancelExpression
this.multLabel = multLabel
this.location = location()
}
}
start
= program
program
= optSpaces expr:expression optSpaces { return new Expression('program', expr, expr.text) }
expression
= seqExpr / parSelectBarExpr / parSelectExpr / parparExpr / parExpr / ifExpr / loopExpr / defAllparamExpr / defExpr
/ blockCallExpr / matchExpr / spawnExpr / jsExpr / prepareFrameExpr
/ whileTrue_dependsOn_Expr / whileTrueAwaitFrame_Expr / whileTrueAwaitDom_Expr
/ echoExpr / awaitInnamespaceBxpExpr / awaitBxpExpr / directExpr
/ varmulExpr / varExpr / specialAssignmentExpr / objectAssignment2Expr / objectAssignmentExpr
/ namespaceAssignment2Expr / namespaceAssignmentExpr / assignmentExpr
/ flatExpression
flatExpression
= calljsExpr / logicSumExpr
directExpr
= op:('break'/'restart'/'pause'/'resume') flatSpaces n:simpleName { return toExpression(op, [toIdentifier(n)]) }
awaitInnamespaceBxpExpr
= 'await' bxp:('Bip'/'Beep') flatSpaces n:simpleName ':' n2:simpleName {
return toExpression('awaitInNamespace', [toExpression( 'get', [toIdentifier(n)] ), toIdentifier(n2), toIdentifier(bxp.toLowerCase())])
}
awaitBxpExpr
= 'await' bxp:('Bip'/'Beep') flatSpaces n:simpleName { return toExpression('await', [toIdentifier(n), toIdentifier(bxp.toLowerCase())]) }
echoExpr
= 'echo' flatSpaces expr:expression { return toExpression('print', [expr]) }
simpleExpression
= '(' __ expr:flatExpression __ ')' {return expr}
/ string / parListExpr / listExpr / number / boolean
/ (n:name ':' n2:(name/number) ':' n3:(name/number) {
return toExpression('getFromNamespace', [toExpression('getFromNamespace', [toExpression('get', [n]), n2]), n3])
})
/ (n:name '.' n2:(name/number) '.' n3:(name/number) {
return toExpression('getFromObject', [toExpression('getFromObject', [toExpression('get', [n]), n2]), n3])
})
/ (n:name ':' n2:(name/number) {
return toExpression('getFromNamespace', [toExpression('get', [n]), n2])
})
/ (n:name '.' n2:(name/number) {
return toExpression('getFromObject', [toExpression('get', [n]), n2])
})
/ callExpr
/ (n:name {
const oper = (n.content[0] === '_') ? 'evalget' : 'get'
return toExpression(oper, [n])
})
varmulExpr
= 'varmul' flatSpaces expr1:simpleName expr2:(__ ':=' __ @expression)? {
if (expr2 === null) return toExpression('varmul', [toIdentifier(expr1)])
else return [
toExpression('varmul', [toIdentifier(expr1)]),
toExpression('set', [toIdentifier(expr1), expr2])
]
}
varExpr
= 'var' flatSpaces expr1:simpleName expr2:(__ ':=' __ @expression)? {
if (expr2 === null) return toExpression('var', [toIdentifier(expr1)])
else return [
toExpression('var', [toIdentifier(expr1)]),
toExpression('set', [toIdentifier(expr1), expr2])
]
}
specialAssignmentExpr
= n:simpleName __ op:[-+*/] '=' __ expr:expression {
return toExpression(
'set',
[
toIdentifier(n),
toExpression(
op,
[
toExpression( 'get', [toIdentifier(n)] ),
expr
]
)
]
)
}
namespaceAssignment2Expr
= n:simpleName ':' n2:simpleName ':' n3:simpleName __ ':=' __ expr:expression {
return toExpression('setToNamespace', [toExpression('getFromNamespace', [toExpression('get', [toIdentifier(n)]), toIdentifier(n2)]), toIdentifier(n3), expr])
}
objectAssignment2Expr
= n:simpleName '.' n2:simpleName '.' n3:simpleName __ ':=' __ expr:expression {
return toExpression('setToObject', [toExpression('getFromObject', [toExpression('get', [toIdentifier(n)]), toIdentifier(n2)]), toIdentifier(n3), expr])
}
namespaceAssignmentExpr
= n:simpleName ':' n2:simpleName __ ':=' __ expr:expression {
return toExpression('setToNamespace', [toExpression('get', [toIdentifier(n)]), toIdentifier(n2), expr])
}
objectAssignmentExpr
= n:simpleName '.' n2:simpleName __ ':=' __ expr:expression {
return toExpression('setToObject', [toExpression('get', [toIdentifier(n)]), toIdentifier(n2), expr])
}
assignmentExpr
= n:simpleName __ ':=' __ expr:expression { return toExpression('set', [toIdentifier(n), expr]) }
blockCallExpr
= 'blockCall' i:natNumber flatSpaces n:name exprs:(flatSpaces @flatExpression)|i| __ ':' exprLabel:(flatSpaces '@' @simpleName)? bl:BLOCK {
return toExpression(n, exprs.concat(bl), exprLabel)
}
callExpr
= n:simpleName __ '(' __ exprs:flatExpression|.., __ "," __| __ ')' {
const l_callExpr = toExpression(n, exprs)
if (n === 'seq') l_callExpr.seqFunction = true
return l_callExpr
}
calljsExpr
= 'calljs' flatSpaces n:simpleName __ '(' __ exprs:simpleName|.., __ "," __| __ ')' {
const ls_jsExpr = 'return ' + n + '(' + exprs.join(',') + ')'
return toExpression(
'short', [
new Expression( 'expression', exprs.map(elt=>toIdentifier(elt)), text() ),
new Expression('string', ls_jsExpr, ls_jsExpr)
]
)
}
listExpr
= '[' __ exprs:flatExpression|.., __ "," __| __ ']' { return new Expression('expression', exprs.flat(), text()) }
parListExpr
= '|' __ exprs:flatExpression|.., __ "," __| __ '|' { return toExpression('par', exprs) }
seqExpr
= ('seq:'/'sequence:') exprLabel:(flatSpaces '@' @simpleName)? bl:BLOCK blCanceled:(newline SAMEDENT 'onBreak:' @BLOCK)? {
return toExpression('seq', bl, exprLabel, blCanceled ? toExpression('seq', blCanceled) : undefined)
}
selectExpr
= 'select:' blSelect:BLOCK blDo:(newline SAMEDENT 'do:' @BLOCK) {
return [
...blSelect,
toExpression('disableCancelFor', [toIdentifier('SUG_branch')]),
toExpression( 'set' , [ toIdentifier('SUG_multReturn'), toIdentifier('false') ] ),
...blDo,
]
}
selectBarExpr
= '||' '='+ blSelect:BLOCK blDo:(newline SAMEDENT '...' '-'+ @BLOCK) {
return [
...blSelect,
toExpression('disableCancelFor', [toIdentifier('SUG_branch')]),
toExpression( 'set' , [ toIdentifier('SUG_multReturn'), toIdentifier('false') ] ),
...blDo,
]
}
parSelectBarExpr
= 'parallel('
inside:(__ ('inside'/'forEachValueOf') flatSpaces @simpleName __ ',')?
inside2:(__ ('for') flatSpaces @simpleName flatSpaces 'in' flatSpaces @flatExpression __ ',')?
selectNumber:(__ 'select' flatSpaces @flatExpression __ ')')
__ '||'
exprLabel:(flatSpaces '@' @simpleName)?
newWhiteLine*
newline SAMEDENT selectExpr:(comment/selectBarExpr)
selectExprs:(newWhiteLine* newline SAMEDENT @(comment/selectBarExpr))*
{
const listSelectExpr = [selectExpr].concat(selectExprs).filter(elt=>(elt!==null))
if (inside2) {
return toExpression(
'foreachIn_select_mult',
[toIdentifier(inside2[0]), inside2[1], selectNumber, listSelectExpr[0]].flat(),
exprLabel || undefined,
)
} else if (inside) {
return toExpression(
'foreach_select_mult',
[toIdentifier(inside), selectNumber, listSelectExpr[0]].flat(),
exprLabel || undefined,
)
} else {
return toExpression(
'par_select_mult',
[
selectNumber,
listSelectExpr.map(selExpr=> toExpression('seq', selExpr) )
],
exprLabel || undefined,
)
}
}
parSelectExpr
= 'parallel('
inside:(__ ('inside'/'forEachValueOf') flatSpaces @simpleName __ ',')?
inside2:(__ ('for') flatSpaces @simpleName flatSpaces 'in' flatSpaces @flatExpression __ ',')?
selectNumber:(__ 'select' flatSpaces @flatExpression __ ')')
__ ':'
exprLabel:(flatSpaces '@' @simpleName)?
newWhiteLine*
newline INDENT selectExpr:(comment/selectExpr)
selectExprs:(newWhiteLine* newline SAMEDENT @(comment/selectExpr))*
& (newline DEDENT)
{
const listSelectExpr = [selectExpr].concat(selectExprs).filter(elt=>(elt!==null))
if (inside2) {
return toExpression(
'foreachIn_select_mult',
[toIdentifier(inside2[0]), inside2[1], selectNumber, listSelectExpr[0]].flat(),
exprLabel || undefined,
)
} else if (inside) {
return toExpression(
'foreach_select_mult',
[toIdentifier(inside), selectNumber, listSelectExpr[0]].flat(),
exprLabel || undefined,
)
} else {
return toExpression(
'par_select_mult',
[
selectNumber,
listSelectExpr.map(selExpr=> toExpression('seq', selExpr) )
],
exprLabel || undefined,
)
}
}
parExpr
= op:('parallel'/'par'/'mix')
inside:(flatSpaces ('inside'/'forEachValueOf') flatSpaces @simpleName)?
exit:(flatSpaces 'exitAfter' flatSpaces @number flatSpaces 'finished')?
exitWith:(flatSpaces 'exitWith' flatSpaces 'branch' flatSpaces @number)?
suppl:(flatSpaces 'supplBranchBy' flatSpaces @simpleName)?
__ ':'
exprLabel:(flatSpaces '@' @simpleName)?
bl:BLOCK blCanceled:(newline SAMEDENT 'onBreak:' @BLOCK)?
{
if (inside && exit) {
return toExpression(
'foreach_race_mult',
[toIdentifier(inside), exit].concat(bl),
exprLabel || undefined,
blCanceled ? toExpression('seq', blCanceled) : undefined,
suppl || undefined
)
} else if (inside) {
return toExpression(
'foreach',
[toIdentifier(inside)].concat(bl),
exprLabel || undefined,
blCanceled ? toExpression('seq', blCanceled) : undefined,
suppl || undefined
)
} else if (exit) {
return toExpression(
'par_race_mult',
[toIdentifier(exit)].concat(bl),
//[
// toExpression('par', [exit].concat(bl))
//],
exprLabel || undefined,
blCanceled ? toExpression('seq', blCanceled) : undefined,
suppl || undefined
)
} else if (exitWith) {
return toExpression(
'par_race_num',
[toIdentifier(exitWith)].concat(bl),
exprLabel || undefined,
blCanceled ? toExpression('seq', blCanceled) : undefined,
suppl || undefined
)
}
return toExpression(
op.slice(0,3), bl, exprLabel || undefined,
blCanceled ? toExpression('seq', blCanceled) : undefined,
suppl || undefined
)
}
parparExpr
= op:('parallel'/'par')
exit:(flatSpaces 'exitAfter' flatSpaces @number flatSpaces 'finished')?
exitWith:(flatSpaces 'exitWith' flatSpaces 'branch' flatSpaces @number)?
__ '||'
exprLabel:(flatSpaces '@' @simpleName)?
blFirst:BLOCK_STARTING_WITH_LABEL blRest:(newline SAMEDENT '||' @BLOCK_STARTING_WITH_LABEL)*
{
if (exit) {
return toExpression(
'par_race_mult',
[toIdentifier(exit)].concat(
[blFirst].concat(blRest).map(
bl => (bl[0][0] == '@') ? toExpression('seq', bl.slice(1), bl[0][1]) : toExpression('seq', bl)
)
),
exprLabel || undefined,
undefined,
undefined
)
} else if (exitWith) {
return toExpression(
'par_race_num',
[toIdentifier(exitWith)].concat(
[blFirst].concat(blRest).map(
bl => (bl[0][0] == '@') ? toExpression('seq', bl.slice(1), bl[0][1]) : toExpression('seq', bl)
)
),
exprLabel || undefined,
undefined,
undefined
)
}
return toExpression(
'par',
[blFirst].concat(blRest).map(
bl => (bl[0][0] == '@') ? toExpression('seq', bl.slice(1), bl[0][1]) : toExpression('seq', bl)
),
exprLabel || undefined,
undefined,
undefined
)
}
ifExpr
= 'if' flatSpaces expr:flatExpression __ ':' blYes:BLOCK blNo:(newline SAMEDENT 'else:' @BLOCK)? {
if (blNo === null) return toExpression('if', [expr,blYes])
else return toExpression('if', [expr,blYes,toIdentifier('else'),blNo])
}
loopExpr
= op:('while'/'repeat') flatSpaces expr:flatExpression __ ':' exprLabel:(flatSpaces '@' @simpleName)? bl:BLOCK blCanceled:(newline SAMEDENT 'onBreak:' @BLOCK)? {
return toExpression(op, [expr].concat(bl), exprLabel, blCanceled ? toExpression('seq', blCanceled) : undefined)
}
spawnExpr
= 'spawn' flatSpaces n:simpleName __ ':' bl:BLOCK {
return toExpression('spawn', [toIdentifier(n)].concat(bl))
}
jsExpr
= 'js' __ '(' __ exprs:simpleName|.., __ "," __| __ ')' __ ':'
newline jslines:$(jsline/whiteLine)|1..,newline|
{
return toExpression(
'short', [
new Expression( 'expression', exprs.map(elt=>toIdentifier(elt)), text() ),
new Expression('string', jslines, jslines )
]
)
}
prepareFrameExpr
= 'prepareFrame_js:'
newline jslines:$(jsline/whiteLine)|1..,newline|
{
return toExpression(
'prepContinuous', [
new Expression('string', jslines, jslines )
]
)
}
whileTrueAwaitFrame_Expr
= 'whileTrueAwaitFrame_js' flatSpaces type:simpleName flatSpaces keyObj:simpleName __ ':' exprLabel:(flatSpaces '@' @simpleName)?
newline jslines:$(jsline/whiteLine)|1..,newline|
{
return toExpression(
'continuous', [
toIdentifier(type),
toIdentifier(keyObj),
new Expression('string', jslines, jslines )
], exprLabel
)
}
whileTrueAwaitDom_Expr
= 'whileTrueAwaitDom_js' flatSpaces target:flatExpression flatSpaces evt:simpleName __ ':' exprLabel:(flatSpaces '@' @simpleName)?
newline jslines:$(jsline/whiteLine)|1..,newline|
{
return toExpression(
'whileTrueAwaitDom_js', [
target,
toIdentifier(evt),
new Expression('string', jslines, jslines )
], exprLabel
)
}
matchExpr
= 'match' flatSpaces expr:flatExpression __ ':' exprLabel:(flatSpaces '@' @simpleName)? newline INDENT cases:caseExpr|1..,newline SAMEDENT| {
return toExpression('match', [expr, ...cases].flat(), exprLabel)
}
caseExpr
= 'case' flatSpaces expr:flatExpression __ ':' bl:BLOCK {return [toIdentifier('case'), expr, ...bl]}
defAllparamExpr
= 'def' flatSpaces n:simpleName __ '(' __ ':' param:simpleName __ ')' ':' bl:BLOCK {
return [
toExpression('var', [toIdentifier(n)]),
toExpression('set', [
toIdentifier(n),
toExpression('lambda', [
toIdentifier(param),
...bl
])
])
]
}
defExpr
= 'def' flatSpaces n:simpleName __ '(' __ exprs:simpleName|.., __ "," __| __ ')' ':' bl:BLOCK {
return [
toExpression('var', [toIdentifier(n)]),
toExpression('set', [
toIdentifier(n),
toExpression('lambda', [
new Expression( 'expression', exprs.map(elt=>toIdentifier(elt)), text() ),
...bl
])
])
]
}
whileTrue_dependsOn_Expr
= 'whileTrue_dependsOn' __ exprs:simpleName|.., __ "," __| ':' bl:BLOCK {
return toExpression(
'whileTrue_dependsOn',
[
toExpression('par', [exprs.map(elt=>toIdentifier(elt))]),
toExpression('seq', bl)
]
)
}
powerExpr
= expr1:simpleExpression expr2:(__ "**" __ @simpleExpression)? {
if (expr2 === null) return expr1
else return toExpression('**', [expr1,expr2])
}
productExpr
= expr1:powerExpr exprs:(__ ('*' / '/') __ powerExpr)* {
return exprs.reduce(
(acc, elt) => toExpression( elt[1], [acc,elt[3]] ),
expr1
)
}
sumExpr
= expr1:productExpr exprs:(__ ('+' / '-') __ productExpr)* {
return exprs.reduce(
(acc, elt) => toExpression( elt[1], [acc,elt[3]] ),
expr1
)
}
comparExpr
= expr1:sumExpr expr2:(__ ('<=' / '>=' / '!=' / '<' / '>' / '=') __ sumExpr)? {
if (expr2 === null) return expr1
else return toExpression((expr2[1]=='!=')?'/=':expr2[1], [expr1,expr2[3]])
}
simpleBoolExpr
= comparExpr / boolean
logicNotExpr
= 'not' flatSpaces b:simpleBoolExpr {
return toExpression('not', [b])
}
logicProdExpr
= expr1:(logicNotExpr/simpleBoolExpr) expr2:(flatSpaces "and" flatSpaces @(logicNotExpr/simpleBoolExpr))? {
if (expr2 === null) return expr1
else return toExpression('and', [expr1,expr2])
}
logicSumExpr
= expr1:logicProdExpr expr2:(flatSpaces "or" flatSpaces @logicProdExpr)? {
if (expr2 === null) return expr1
else return toExpression('or', [expr1,expr2])
}
// inspired by https://github.com/Kantouzin/python-pegjs
BLOCK
= newWhiteLine*
newline INDENT startExpr:(comment/expression)
restExpr:(newWhiteLine* newline SAMEDENT @(comment/expression))*
& (newline DEDENT)
{ return [startExpr].concat(restExpr.flat()).filter(elt=>(elt!==null)) }
BLOCK_STARTING_WITH_LABEL
= newWhiteLine*
newline INDENT startExpr:(comment/expression/'@' simpleName)
restExpr:(newWhiteLine* newline SAMEDENT @(comment/expression))*
& (newline DEDENT)
{ return [startExpr].concat(restExpr.flat()).filter(elt=>(elt!==null)) }
SAMEDENT
= tabs:tabs &{return tabs.length == indentationCount} {}
INDENT
= tabs:tabs &{return tabs.length == indentationCount + 1} {
indentationStack.push(indentationCount)
indentationCount += 1
}
DEDENT
= tabs:tabs {indentationCount = indentationStack.pop()}
// end of part inspired by https://github.com/Kantouzin/python-pegjs
name
= n:(simpleName / simpleOper) { return toIdentifier(n) }
simpleName "simple_name"
= nonUnderscoreSimpleName / underscoreSimpleName
nonUnderscoreSimpleName "non_underscore_simple_name"
= $([A-Za-z][0-9A-Za-z_]*)
underscoreSimpleName "underscore_simple_name"
= $("_" [A-Za-z_][0-9A-Za-z_]*)
simpleOper "simple_operator"
= $([=+*/<>-][_=+*/<>-]*)
__ "flat_optional_spaces"
= (comment / singleSpace)*
optSpaces "optional_spaces"
= (comment / singleSpace / newline)*
flatSpaces "flat_space(s)"
= (comment / singleSpace)+
spaces "space(s)"
= (comment / singleSpace / newline)+
comment "comment"
= (commentSharp / commentDoubleSlash) {return null}
commentSharp "sharp_comment"
= "#" [^\n\r]* &newline
commentDoubleSlash "slash_comment"
= "//" [^\n\r]* &newline
singleSpace "single_space"
= [ \t]
whiteSpace "white_space"
= [ \t\n\r]+
newline "newline"
= [\n\r]
whiteLine "white_line"
= [ \t]* &newline
newWhiteLine "new_white_line"
= newline [ \t]* &newline
/ newline [ \t]* comment
boolean "boolean"
= b:('true' / 'false') { return toIdentifier(b) }
number "number"
= digits:("-"?[0-9]+([.][0-9]+)?) {
return new Expression(
'number',
parseFloat( text() ),
text()
)
}
natNumber
= [0-9]+ {return parseInt( text() )}
string "string"
= '"' content:[^"]* '"' { return new Expression('string', content.join(""), text() ) }
/ "'" content:[^']* "'" { return new Expression('string', content.join(""), text() ) }
/ '`' content:[^`]* '`' { return new Expression('string', content.join(""), text() ) }
jsline "js_line_without_tab"
= tabs:tabs & {return tabs.length > indentationCount} t:$[^\t\n][^\n]*
tabs "tabulations"
= '\t'*