feat: explicit invalid syntax checks improvements #17

Merged
gk1623 merged 6 commits from more-explicit-invalid-syntax into master 2025-02-07 16:42:38 +00:00
Showing only changes of commit d32855cc29 - Show all commits

View File

@@ -91,7 +91,8 @@ object parser {
`<ident-or-array-elem>`, `<ident-or-array-elem>`,
Parens("(" ~> `<expr>` <~ ")") Parens("(" ~> `<expr>` <~ ")")
) )
private val `<ident>` = Ident(ident) private val `<ident>` =
Ident(ident) | some("*" | "&").verifiedExplain("pointer operators are not allowed")
private lazy val `<ident-or-array-elem>` = private lazy val `<ident-or-array-elem>` =
`<ident>` <**> (`<array-indices>` </> identity) `<ident>` <**> (`<array-indices>` </> identity)
private val `<array-indices>` = ArrayElem(some("[" ~> `<expr>` <~ "]")) private val `<array-indices>` = ArrayElem(some("[" ~> `<expr>` <~ "]"))