@@ -19,8 +19,8 @@ use celma_v0_core::parser::literal::{delimited_char, delimited_string};
1919
2020use celma_v0_macro:: parsec_rules;
2121use celma_v1_ast:: syntax:: ASTParsec :: {
22- PAtom , PAtoms , PBind , PCheck , PChoice , PCode , PEpsilon , PIdent , PMap , PNot , PRepeat ,
23- PSequence , PTry ,
22+ PAtom , PAtoms , PBind , PCheck , PChoice , PCode , PEpsilon , PIdent , PMap , PNot , PRepeat , PSequence ,
23+ PTry ,
2424} ;
2525use celma_v1_ast:: syntax:: { ASTParsec , ASTParsecRule } ;
2626
@@ -93,16 +93,16 @@ parsec_rules!(
9393 let skip = ( ' ' |'\t' |'\n' |'\r' ) * -> { }
9494 let ident: { String } = ( skip i=#( alpha ( alpha|digit|'_' ) * ) skip) -> { i. into_iter( ) . collect( ) }
9595
96- let rkind = ( ^( '<' |'>' ) + rkind -> { } )
97- | ( '<' rkind '>' rkind -> { } )
96+ let kind_content = ( ^( '<' |'>' ) + kind_content -> { } )
97+ | ( '<' kind_content '>' kind_content -> { } )
9898 | ( )
9999
100- let rcode = ( ^( '}' |'{' ) + rcode -> { } )
101- | ( '{' rcode '}' rcode -> { } )
100+ let code_content = ( ^( '}' |'{' ) + code_content -> { } )
101+ | ( '{' code_content '}' code_content -> { } )
102102 | ( )
103103
104- let kind: { String } = ( skip '<' c=#rkind '>' skip) -> { c. into_iter( ) . collect( ) }
105- let code: { String } = ( skip '{' c=#rcode '}' skip) -> { c. into_iter( ) . collect( ) }
104+ let kind: { String } = ( skip '<' c=#kind_content '>' skip) -> { c. into_iter( ) . collect( ) }
105+ let code: { String } = ( skip '{' c=#code_content '}' skip) -> { c. into_iter( ) . collect( ) }
106106
107107 let rules: { Vec <ASTParsecRule <char >>} = rule*
108108 let rule: { ASTParsecRule <char >} = (
@@ -117,7 +117,7 @@ parsec_rules!(
117117 let additional: { ( bool , ASTParsec <char >) } = ( skip c='|' ? skip p=parsec) -> { ( c. is_some( ) , p) }
118118
119119 let atom: { ASTParsec <char >} = (
120- skip o=( '^' |'!' |'#' | '/' ) ? skip p=( atom_block|atom_ident|atom_char|atom_string|atom_code) skip
120+ skip o=( '^' |'!' |'#' ) ? skip p=( atom_block|atom_ident|atom_char|atom_string|atom_code) skip
121121 ) -> { mk_atom( o, p) }
122122
123123 let atom_block: { ASTParsec <char >} = ( '(' p=parsec? ')' ) -> { p. unwrap_or_else( PEpsilon ) }
0 commit comments