Lengths and angles should be set with |abs| values (#93)

* Lengths and angles should be set with |abs| values

* clean up
This commit is contained in:
Kurt Hutten
2023-04-02 17:20:11 +10:00
committed by GitHub
parent b279daa8e0
commit 01bf3c1049
13 changed files with 159 additions and 55 deletions

View File

@ -331,6 +331,14 @@ show(part001)`
})
})
describe('it recasts binary expression using brackets where needed', () => {
it('when there are two minus in a row', () => {
const code = `const part001 = 1 - (def - abc)`
const recasted = recast(code2ast(code).ast)
expect(recasted).toBe(code)
})
})
// helpers
function code2ast(code: string): { ast: Program; tokens: Token[] } {