Skip to content

Commit

Permalink
fix: change priority of parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
karatakis committed Dec 12, 2024
1 parent 2e3c8f9 commit 84cf742
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ChatRequest {
ChatMessage {
role: System,
content: Text(
"Given the sample schema of a GraphQL type, suggest 5 meaningful names for it.\nThe name should be concise, preferably a single word and must not be in the `ignore` list.\n\nExample Input:\n\n\nExample Output:\n{\"suggestions\":[\"Person\",\"Profile\",\"Member\",\"Individual\",\"Contact\"]}\n\nEnsure the output is in valid JSON format.\n",
"Given the sample schema of a GraphQL type, suggest 5 meaningful names for it.\nThe name should be concise, preferably a single word and must not be in the `ignore` list.\n\nExample Input:\n{\"ignore\":[\"User\"],\"fields\":[[\"id\",\"String\"],[\"name\",\"String\"],[\"age\",\"Int\"]]}\n\nExample Output:\n{\"suggestions\":[\"Person\",\"Profile\",\"Member\",\"Individual\",\"Contact\"]}\n\nEnsure the output is in valid JSON format.\n",
),
extra: None,
},
Expand Down
8 changes: 4 additions & 4 deletions src/core/mustache/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ fn parse_expression(input: &str) -> IResult<&str, Segment> {
delimited(
tag("{{"),
map(take_until("}}"), |template| {
if let Ok(jq) = JqTransform::try_new(template) {
Segment::JqTransform(jq)
} else if let Ok((_, seg)) = parse_mustache_expression(input) {
if let Ok((_, seg)) = parse_mustache_expression(input) {
seg
} else {
} else if let Ok(jq) = JqTransform::try_new(template) {
Segment::JqTransform(jq)
} else {
Segment::Literal(template.to_string())
}
}),
Expand Down

0 comments on commit 84cf742

Please sign in to comment.