mondo: add .. operator
This commit is contained in:
parent
55a5f1d62a
commit
3505732afa
3 changed files with 12 additions and 2 deletions
|
|
@ -17,9 +17,9 @@ export class MondoParser {
|
|||
open_seq: /^\[/,
|
||||
close_seq: /^\]/,
|
||||
number: /^-?[0-9]*\.?[0-9]+/, // before pipe!
|
||||
op: /^[*\/:]|^\.{2}/, // * / : ..
|
||||
pipe: /^\./,
|
||||
stack: /^[,$]/,
|
||||
op: /^[*/:]/,
|
||||
plain: /^[a-zA-Z0-9-~_^]+/,
|
||||
};
|
||||
// matches next token
|
||||
|
|
|
|||
|
|
@ -102,6 +102,7 @@ describe('mondo sugar', () => {
|
|||
it('should desugar x:y', () => expect(desguar('x:y')).toEqual('(: x y)'));
|
||||
it('should desugar x:y:z', () => expect(desguar('x:y:z')).toEqual('(: (: x y) z)'));
|
||||
it('should desugar x:y*x', () => expect(desguar('bd:0*2')).toEqual('(* (: bd 0) 2)'));
|
||||
it('should desugar a..b', () => expect(desguar('0..2')).toEqual('(.. 0 2)'));
|
||||
|
||||
it('should desugar README example', () =>
|
||||
expect(desguar('s [bd hh*2 cp.(crush 4) <mt ht lt>] . speed .8')).toEqual(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue