diff --git a/packages/java-edition/src/mcfunction/parser/argument.ts b/packages/java-edition/src/mcfunction/parser/argument.ts index 2655b8eed..a0c93a5b4 100644 --- a/packages/java-edition/src/mcfunction/parser/argument.ts +++ b/packages/java-edition/src/mcfunction/parser/argument.ts @@ -337,7 +337,7 @@ function block(isPredicate: boolean): core.InfallibleParser { const blockState: core.InfallibleParser = block(false) export const blockPredicate: core.InfallibleParser = block(true) -export const component = json.parser.json() +export const component = json.parser.json function double( min = DoubleMin, diff --git a/packages/json/src/parser/array.ts b/packages/json/src/parser/array.ts index 5f1d73fd9..391da91a0 100644 --- a/packages/json/src/parser/array.ts +++ b/packages/json/src/parser/array.ts @@ -5,7 +5,7 @@ import { json } from './entry.js' export const array: core.Parser = (src, ctx) => { const parser = core.list({ start: '[', - value: json(), + value: json, sep: ',', trailingSep: false, end: ']', diff --git a/packages/json/src/parser/entry.ts b/packages/json/src/parser/entry.ts index 9b9458810..8c808f74f 100644 --- a/packages/json/src/parser/entry.ts +++ b/packages/json/src/parser/entry.ts @@ -20,7 +20,7 @@ const LegalNumberStart = new Set([ '9', '-', ]) -export function json(dumpErrors = false): core.Parser { +export function jsonParser(dumpErrors = false): core.Parser { return (src, ctx) => { const result = core.select([ { predicate: (src) => src.tryPeek('['), parser: array }, @@ -44,4 +44,5 @@ export function json(dumpErrors = false): core.Parser { } } -export const entry: core.Parser = json(true) +export const entry = jsonParser(true) +export const json = jsonParser() diff --git a/packages/json/src/parser/object.ts b/packages/json/src/parser/object.ts index b0edc603b..810b2609f 100644 --- a/packages/json/src/parser/object.ts +++ b/packages/json/src/parser/object.ts @@ -11,7 +11,7 @@ export const object: core.InfallibleParser = (src, ctx) => { pair: { key: string, sep: ':', - value: json(), + value: json, end: ',', trailingEnd: false, },