Make sure to use keyword rather than word for parsing keywords

This commit is contained in:
Joshua Warner 2024-12-28 22:24:38 -05:00
parent 9e6c249dca
commit 59fe0f06ea
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
6 changed files with 40 additions and 30 deletions

View file

@ -0,0 +1 @@
Expr(Type(TInParens(End(@5), @2), @2), @0)

View file

@ -0,0 +1,4 @@
s:(s
wherem
implementsF)A
_

View file

@ -1,6 +1,5 @@
(
i :
a #
where w implements I
i : a #
wherew implementsI
e
)

View file

@ -4,46 +4,48 @@
Defs {
tags: [
EitherIndex(2147483648),
EitherIndex(2147483649),
],
regions: [
@1-26,
@1-4,
@8-26,
],
space_before: [
Slice<roc_parse::ast::CommentOrNewline> { start: 0, length: 0 },
Slice<roc_parse::ast::CommentOrNewline> { start: 0, length: 1 },
],
space_after: [
Slice<roc_parse::ast::CommentOrNewline> { start: 0, length: 0 },
Slice<roc_parse::ast::CommentOrNewline> { start: 1, length: 0 },
],
spaces: [
LineComment(
"",
),
],
spaces: [],
type_defs: [],
value_defs: [
Annotation(
@1-2 Identifier {
ident: "i",
},
@3-26 Where(
@3-4 SpaceAfter(
BoundVariable(
"a",
),
[
LineComment(
"",
),
],
),
@3-4 BoundVariable(
"a",
),
),
Stmt(
@8-26 Apply(
@8-14 Var {
module_name: "",
ident: "wherew",
},
[
@13-26 ImplementsClause {
var: @13-14 "w",
abilities: [
@25-26 Apply(
"",
"I",
[],
),
],
@15-26 Var {
module_name: "",
ident: "implementsI",
},
],
Space,
),
),
],

View file

@ -276,6 +276,7 @@ mod test_snapshots {
fail/when_over_indented_int.expr,
fail/when_over_indented_underscore.expr,
fail/where_type_variable.expr,
fail/wherem_implementsf.expr,
fail/wild_case_arrow.expr,
malformed/bad_opaque_ref.expr,
malformed/malformed_pattern_field_access.expr, // See https://github.com/roc-lang/roc/issues/399