How to use the @aurelia/jit.parse function in @aurelia/jit

To help you get started, we’ve selected a few @aurelia/jit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aurelia / aurelia / packages / __tests__ / jit / expression-parser.spec.ts View on Github external
it(input, function () {
            const state = new ParserState(input);
            const result = parse(state, Access.Reset, Precedence.Variadic, bindingType);
            assert.deepStrictEqual(result, expected);
          });
        }
github aurelia / aurelia / packages / __tests__ / jit / expression-parser.spec.ts View on Github external
it(input, function () {
            const state = new ParserState(input);
            const result = parse(state, Access.Reset, Precedence.Assign, bindingType);
            if ((result.$kind & ExpressionKind.IsPrimary) > 0 ||
              (result.$kind & ExpressionKind.Unary) === ExpressionKind.Unary ||
              (result.$kind & ExpressionKind.Binary) === ExpressionKind.Binary ||
              (result.$kind & ExpressionKind.Conditional) === ExpressionKind.Conditional ||
              (result.$kind & ExpressionKind.Assign) === ExpressionKind.Assign) {
              if ((expected.$kind & ExpressionKind.IsPrimary) > 0 ||
                (expected.$kind & ExpressionKind.Unary) === ExpressionKind.Unary ||
                (expected.$kind & ExpressionKind.Binary) === ExpressionKind.Binary ||
                (expected.$kind & ExpressionKind.Conditional) === ExpressionKind.Conditional ||
                (expected.$kind & ExpressionKind.Assign) === ExpressionKind.Assign) {
                assert.deepStrictEqual(result, expected);
                assert.strictEqual(state.index >= state.length, true, `state.index >= state.length`);
              } else {
                assert.strictEqual(state.index < state.length, true, `state.index < state.length`);
                assert.notStrictEqual(result.$kind, expected.$kind, 'result.$kind');
              }
github aurelia / aurelia / packages / __tests__ / jit / expression-parser.spec.ts View on Github external
it(input, function () {
            const state = new ParserState(input);
            const result = parse(state, Access.Reset, Precedence.Conditional, bindingType);
            if ((result.$kind & ExpressionKind.IsPrimary) > 0 ||
              (result.$kind & ExpressionKind.Unary) === ExpressionKind.Unary ||
              (result.$kind & ExpressionKind.Binary) === ExpressionKind.Binary ||
              (result.$kind & ExpressionKind.Conditional) === ExpressionKind.Conditional) {
              if ((expected.$kind & ExpressionKind.IsPrimary) > 0 ||
                (expected.$kind & ExpressionKind.Unary) === ExpressionKind.Unary ||
                (expected.$kind & ExpressionKind.Binary) === ExpressionKind.Binary ||
                (expected.$kind & ExpressionKind.Conditional) === ExpressionKind.Conditional) {
                assert.deepStrictEqual(result, expected);
                assert.strictEqual(state.index >= state.length, true, `state.index >= state.length`);
              } else {
                assert.strictEqual(state.index < state.length, true, `state.index < state.length`);
                assert.notStrictEqual(result.$kind, expected.$kind, 'result.$kind');
              }
            } else {
              throw new Error('Should not parse anything higher than ConditionalExpression');
github aurelia / aurelia / packages / __tests__ / jit / expression-parser.spec.ts View on Github external
it(input, function () {
            const state = new ParserState(input);
            const result = parse(state, Access.Reset, Precedence.Unary, bindingType);
            if ((result.$kind & ExpressionKind.IsPrimary) > 0 ||
              (result.$kind & ExpressionKind.Unary) === ExpressionKind.Unary) {
              if ((expected.$kind & ExpressionKind.IsPrimary) > 0 ||
                (expected.$kind & ExpressionKind.Unary) === ExpressionKind.Unary) {
                assert.deepStrictEqual(result, expected);
                assert.strictEqual(state.index >= state.length, true, `state.index >= state.length`);
              } else {
                assert.strictEqual(state.index < state.length, true, `state.index < state.length`);
                assert.notStrictEqual(result.$kind, expected.$kind, 'result.$kind');
              }
            } else {
              throw new Error('Should not parse anything higher than UnaryExpression');
            }
          });
        }
github aurelia / aurelia / packages / __tests__ / jit / expression-parser.spec.ts View on Github external
it(input, function () {
            const state = new ParserState(input);
            const result = parse(state, Access.Reset, Precedence.Binary, bindingType);
            if ((result.$kind & ExpressionKind.IsPrimary) > 0 ||
              (result.$kind & ExpressionKind.Unary) === ExpressionKind.Unary ||
              (result.$kind & ExpressionKind.Binary) === ExpressionKind.Binary) {
              if ((expected.$kind & ExpressionKind.IsPrimary) > 0 ||
                (expected.$kind & ExpressionKind.Unary) === ExpressionKind.Unary ||
                (expected.$kind & ExpressionKind.Binary) === ExpressionKind.Binary) {
                assert.deepStrictEqual(result, expected);
                assert.strictEqual(state.index >= state.length, true, `state.index >= state.length`);
              } else {
                assert.strictEqual(state.index < state.length, true, `state.index < state.length`);
                assert.notStrictEqual(result.$kind, expected.$kind, 'result.$kind');
              }
            } else {
              throw new Error('Should not parse anything higher than BinaryExpression');
            }
          });