stringLiteral method
Implementation
Parser<Expression> stringLiteral() {
// Match opening quote, content (anything except quote or newline), and closing quote
final stringContent = (char('\\') & any()) // escaped character
.or(pattern('^"\n\r')) // any char except quote or newline
.star()
.flatten();
return (char('"') & stringContent & char('"'))
.pick(1)
.mapWithPosition((v, start, end) =>
Literal(v, '"$v"')..start = start..end = end);
}