You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: rust/kcl-lib/src/parsing/parser.rs
+33-1Lines changed: 33 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -48,6 +48,8 @@ const IF_ELSE_CANNOT_BE_EMPTY: &str = "`if` and `else` blocks cannot be empty";
48
48
constELSE_STRUCTURE:&str = "This `else` should be followed by a {, then a block of code, then a }";
49
49
constELSE_MUST_END_IN_EXPR:&str = "This `else` block needs to end in an expression, which will be the value if no preceding `if` condition was matched";
50
50
51
+
constKEYWORD_EXPECTING_IDENTIFIER:&str = "Expected an identifier, but found a reserved keyword.";
letkey = identifier.context(expected("the property's key (the name or identifier of the property), e.g. in 'height = 4', 'height' is the property key")).parse_next(i)?;
935
+
letkey_token = identifier_or_keyword.context(expected("the property's key (the name or identifier of the property), e.g. in 'height = 4', 'height' is the property key")).parse_next(i)?;
934
936
ignore_whitespace(i);
935
937
// Temporarily accept both `:` and `=` for compatibility.
0 commit comments