Skip to content

Commit

Permalink
[NO REVIEW] Post-rebase fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
yannham committed Feb 8, 2023
1 parent 7c9d8c5 commit 99d5b9f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
15 changes: 12 additions & 3 deletions src/parser/grammar.lalrpop
Original file line number Diff line number Diff line change
Expand Up @@ -531,9 +531,18 @@ StrChunks: RichTerm = {
}).collect();

RichTerm::from(build_record([
(FieldPathElem::Ident("tag".into()), RichTerm::from(Term::Enum("SymbolicString".into()))),
(FieldPathElem::Ident("prefix".into()), RichTerm::from(Term::Enum(prefix.into()))),
(FieldPathElem::Ident("fragments".into()), RichTerm::from(Term::Array(terms, Default::default())))
(
FieldPathElem::Ident("tag".into()),
Field::from(RichTerm::from(Term::Enum("SymbolicString".into())))
),
(
FieldPathElem::Ident("prefix".into()),
Field::from(RichTerm::from(Term::Enum(prefix.into())))
),
(
FieldPathElem::Ident("fragments".into()),
Field::from(RichTerm::from(Term::Array(terms, Default::default())))
)
], Default::default()))
} else {
let mut chunks = chunks;
Expand Down
10 changes: 6 additions & 4 deletions src/parser/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,24 @@ fn mk_single_chunk(s: &str) -> RichTerm {
}

fn mk_symbolic_single_chunk(prefix: &str, s: &str) -> RichTerm {
use crate::term::record::Field;

build_record(
[
(
FieldPathElem::Ident("tag".into()),
RichTerm::from(Term::Enum("SymbolicString".into())),
Field::from(RichTerm::from(Term::Enum("SymbolicString".into()))),
),
(
FieldPathElem::Ident("prefix".into()),
RichTerm::from(Term::Enum(prefix.into())),
Field::from(RichTerm::from(Term::Enum(prefix.into()))),
),
(
FieldPathElem::Ident("fragments".into()),
RichTerm::from(Array(
Field::from(RichTerm::from(Array(
Array::new(Rc::new([Str(String::from(s)).into()])),
Default::default(),
)),
))),
),
],
Default::default(),
Expand Down

0 comments on commit 99d5b9f

Please sign in to comment.