File tree Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -3,13 +3,12 @@ import {
33 anySingleCharacter ,
44 as ,
55 butNot ,
6- lazy ,
76 literal ,
87 map ,
98 oneOf ,
109 oneOrMore ,
1110 sequence ,
12- zeroOrMore ,
11+ zeroOrMore
1312} from '@matt.kantor/parsing'
1413import { optionallySurroundedByParentheses } from './parentheses.js'
1514import { whitespace } from './trivia.js'
@@ -40,9 +39,6 @@ const atomComponentsRequiringQuotation = [
4039 literal ( '*/' ) ,
4140] as const
4241
43- export const atomParser : Parser < Atom > = optionallySurroundedByParentheses (
44- lazy ( ( ) => oneOf ( [ unquotedAtomParser , quotedAtomParser ] ) ) ,
45- )
4642
4743export const atomWithAdditionalQuotationRequirements = (
4844 additionalQuoteRequiringComponent : Parser < unknown > ,
@@ -99,3 +95,7 @@ const quotedAtomParser = map(
9995 ] ) ,
10096 ( [ _1 , contents , _2 ] ) => contents ,
10197)
98+
99+ export const atomParser : Parser < Atom > = optionallySurroundedByParentheses (
100+ oneOf ( [ unquotedAtomParser , quotedAtomParser ] ) ,
101+ )
Original file line number Diff line number Diff line change @@ -20,10 +20,6 @@ import { trivia } from './trivia.js'
2020
2121export type Molecule = { readonly [ key : Atom ] : Molecule | Atom }
2222
23- export const moleculeParser : Parser < Molecule > = lazy (
24- ( ) => potentiallySugaredMolecule ,
25- )
26-
2723// Keyless properties are automatically assigned numeric indexes, which uses some mutable state.
2824type Indexer = ( ) => string
2925const makeIncrementingIndexer = ( ) : Indexer => {
@@ -210,3 +206,5 @@ const potentiallySugaredMolecule: Parser<Molecule> = (() => {
210206 potentiallySugaredNonApply ,
211207 ] )
212208} ) ( )
209+
210+ export const moleculeParser : Parser < Molecule > = potentiallySugaredMolecule
You can’t perform that action at this time.
0 commit comments