Closed mantielero closed 1 year ago
import npeg
let tmp = "(*This is a comment*)" # Nested comments are not allowed
let parser = peg "comment":
comment <- "(*" * >*(1-"*)") * "*)"
echo parser.match(tmp).captures
output:
@["This is a comment"]
Thanks a lot
I am trying to parse comments with limits:
(*
and*)
.I am trying the following without success:
The sort of comments I could expect are like: