Skip to content

Commit

Permalink
Fix cozodb#234 by modifying LINE_COMMENT grammar rule on cozoscript.pest
Browse files Browse the repository at this point in the history
LINE_COMMENT rule was changes to match the SOI first, otherwise any raw string containing `#` will be considered a LINE_COMMENT
  • Loading branch information
aramallo committed Feb 9, 2024
1 parent 7adfc6c commit 0a8faf0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cozo-core/src/cozoscript.pest
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ index_opt_field = {ident ~ ":" ~ expr}

WHITESPACE = _{ " " | "\t" | "\r" | "\n" }
BLOCK_COMMENT = _{ "/*" ~ (BLOCK_COMMENT | !"*/" ~ ANY)* ~ "*/" }
LINE_COMMENT = _{ "#" ~ (!"\n" ~ ANY)* }
LINE_COMMENT = _{ SOI ~ "#" ~ (!"\n" ~ ANY)* }
COMMENT = _{(BLOCK_COMMENT | LINE_COMMENT)}

prog_entry = {"?"}
Expand Down Expand Up @@ -273,4 +273,4 @@ fts_or = {"OR" | "," | ";"}
fts_not = {"NOT"}

expression_script = {SOI ~ expr ~ EOI}
param_list = {SOI ~ "[" ~ "[" ~ (param ~ ",")* ~ param? ~ "]" ~ "]" ~ EOI}
param_list = {SOI ~ "[" ~ "[" ~ (param ~ ",")* ~ param? ~ "]" ~ "]" ~ EOI}

0 comments on commit 0a8faf0

Please sign in to comment.