Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove alternate binding parsers from bundle #405

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions core/player/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ javascript_pipeline(
"@npm//p-defer",
"@npm//queue-microtask",
"@npm//tapable-ts",
"@npm//parsimmon",
"@npm//@types/parsimmon",
"@npm//arr-flatten",
"@npm//ebnf",
"@npm//timm",
"@npm//error-polyfill",
"@npm//ts-nested-error"
],
test_data = [
"@npm//arr-flatten",
"@npm//ebnf",
"@npm//parsimmon",
"@npm//@types/parsimmon",
"//core/make-flow:@player-ui/make-flow",
"//plugins/common-types/core:@player-ui/common-types-plugin",
],
Expand Down
4 changes: 2 additions & 2 deletions core/player/src/binding-grammar/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export * from './ast';
export { parse as parseParsimmon } from './parsimmon';
export { parse as parseEBNF } from './ebnf';
// export { parse as parseParsimmon } from './parsimmon';
// export { parse as parseEBNF } from './ebnf';
export { parse as parseCustom } from './custom';
8 changes: 4 additions & 4 deletions core/player/src/binding/__tests__/resolver.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import get from 'dlv';

import type { ParserSuccessResult } from '../../binding-grammar';
import { parseParsimmon } from '../../binding-grammar';
import { parseCustom } from '../../binding-grammar';
import { resolveBindingAST } from '../resolver';
import { getBindingSegments } from '../utils';

Expand Down Expand Up @@ -33,7 +33,7 @@ const testCases: Array<[string, string]> = [
];

test.each(testCases)('Resolving binding: %s', (binding, expectedResolved) => {
const parsedBinding = parseParsimmon(binding);
const parsedBinding = parseCustom(binding);
expect(parsedBinding.status).toBe(true);
const actual = resolveBindingAST(
(parsedBinding as ParserSuccessResult).path,
Expand All @@ -48,7 +48,7 @@ test.each(testCases)('Resolving binding: %s', (binding, expectedResolved) => {
});

test('works for nested keys', () => {
const parsedBinding = parseParsimmon('foo.{{BASE_PATH}}.bar');
const parsedBinding = parseCustom('foo.{{BASE_PATH}}.bar');
expect(parsedBinding.status).toBe(true);

const resolved = resolveBindingAST(
Expand All @@ -65,7 +65,7 @@ test('works for nested keys', () => {

describe('expressions', () => {
test('evaluates expressions as paths', () => {
const parsedBinding = parseParsimmon('foo.bar.`exp()`');
const parsedBinding = parseCustom('foo.bar.`exp()`');

const evaluate = jest.fn().mockReturnValue(100);
const resolved = resolveBindingAST(
Expand Down