@qrvey/formula-lang
Version:
QFormula support for qrvey projects
23 lines • 801 B
JavaScript
import { ExternalTokenizer } from '@lezer/lr';
import { noOprt } from './generated/qformula.lang.terms';
const space = [
9, 10, 11, 12, 13, 32, 133, 160, 5760, 8192, 8193, 8194, 8195, 8196, 8197,
8198, 8199, 8200, 8201, 8202, 8232, 8233, 8239, 8287, 12288,
];
const operators = [43, 45, 42, 47, 60, 61, 62];
const parenteses = [41, 40];
const comma = 44;
export const noOperator = new ExternalTokenizer((input, stack) => {
const { next } = input;
if (space.indexOf(next) > -1 ||
parenteses.indexOf(next) > -1 ||
next === comma)
return;
if (operators.indexOf(next) === -1 &&
next != -1 &&
!stack.context &&
stack.canShift(noOprt)) {
input.acceptToken(noOprt);
}
}, { contextual: true });
//# sourceMappingURL=tokens.js.map