Began work on rewriting parser without object orientation
Parsing is expensive, if the parse tree can be stored on the DB it can save a lot of compute time, but mongo can't store Classes, so we re-write without classes
This commit is contained in:
11
app/imports/parser/parser.test.js
Normal file
11
app/imports/parser/parser.test.js
Normal file
@@ -0,0 +1,11 @@
|
||||
import { parse } from './parser';
|
||||
import { assert } from 'chai';
|
||||
|
||||
describe('Parser', function(){
|
||||
it('parses valid text without error', function(){
|
||||
assert.typeOf(parse('1'), 'object');
|
||||
});
|
||||
it('parses various operations', function(){
|
||||
assert.typeOf(parse('1 + 2 * 3 / 4 * 1d8'), 'object');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user