mirror of
https://github.com/fluencelabs/aquavm
synced 2025-03-15 04:30:48 +00:00
feat(testing-framework): allow exclamation mark (#364)
While exclamation mark is legacy feature in the lambda parser, people seem to use it anyway, getting errors not always easy to understand.
This commit is contained in:
parent
bf8aee7f15
commit
651b569a13
@ -125,7 +125,10 @@ fn parse_sexp_symbol(inp: Input<'_>) -> IResult<Input<'_>, Sexp, ParseError<'_>>
|
||||
map(
|
||||
recognize(pair(
|
||||
many1_count(alt((value((), alphanumeric1), value((), one_of("_-.$#%"))))),
|
||||
opt(delimited(tag("["), parse_sexp_symbol, tag("]"))),
|
||||
opt(terminated(
|
||||
delimited(tag("["), parse_sexp_symbol, tag("]")),
|
||||
opt(tag("!")),
|
||||
)),
|
||||
)),
|
||||
Sexp::symbol,
|
||||
)(inp)
|
||||
@ -333,6 +336,12 @@ mod tests {
|
||||
assert_eq!(res, Ok(Sexp::symbol("sym_bol.$.blabla")));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_symbol_lambda_exclamation() {
|
||||
let res = Sexp::from_str("pid-num.$.[0]!");
|
||||
assert_eq!(res, Ok(Sexp::symbol("pid-num.$.[0]!")));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_symbol_stream() {
|
||||
let res = Sexp::from_str("$stream");
|
||||
|
Loading…
x
Reference in New Issue
Block a user