mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-27 21:48:27 +00:00
alias - for ~ (#981)
This commit is contained in:
parent
524109056f
commit
8e41332dfa
@ -125,7 +125,7 @@ export function patternifyAST(ast, code, onEnter, offset = 0) {
|
|||||||
return enter(ast.source_);
|
return enter(ast.source_);
|
||||||
}
|
}
|
||||||
case 'atom': {
|
case 'atom': {
|
||||||
if (ast.source_ === '~') {
|
if (ast.source_ === '~' || ast.source_ === '-') {
|
||||||
return strudel.silence;
|
return strudel.silence;
|
||||||
}
|
}
|
||||||
if (!ast.location_) {
|
if (!ast.location_) {
|
||||||
|
|||||||
@ -117,6 +117,9 @@ describe('mini', () => {
|
|||||||
checkEuclid([11, 24], 'x ~ ~ x ~ x ~ x ~ x ~ x ~ ~ x ~ x ~ x ~ x ~ x ~');
|
checkEuclid([11, 24], 'x ~ ~ x ~ x ~ x ~ x ~ x ~ ~ x ~ x ~ x ~ x ~ x ~');
|
||||||
checkEuclid([13, 24], 'x ~ x x ~ x ~ x ~ x ~ x ~ x x ~ x ~ x ~ x ~ x ~');
|
checkEuclid([13, 24], 'x ~ x x ~ x ~ x ~ x ~ x ~ x x ~ x ~ x ~ x ~ x ~');
|
||||||
});
|
});
|
||||||
|
it('supports the - alias for ~', () => {
|
||||||
|
expect(minS('a - b [- c]')).toEqual(minS('a ~ b [~ c]'));
|
||||||
|
});
|
||||||
it('supports the ? operator', () => {
|
it('supports the ? operator', () => {
|
||||||
expect(
|
expect(
|
||||||
mini('a?')
|
mini('a?')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user