-
Notifications
You must be signed in to change notification settings - Fork 22
Closed
Description
The >
symbol used in an expression inside of a proc causes the following error: Error: wrong number of arguments
. It seems like it is being recognized as the system operator rather than part of the expression.
Two examples of it not working:
import npeg
proc test(T: typedesc, str: string) =
let p = peg "start":
start <- >"Test"
var m = p.match(str)
echo m.captures
test(string, "Test")
import npeg
proc test[T](obj: T, str: string) =
let p = peg "start":
start <- >"Test"
var m = p.match(str)
echo m.captures
test(1, "Test")
If the '>' is removed, things work. But of course I cannot use the matched element. This is the only symbol that is causing me problems and the parser I've been trying to write is using almost all of them.
import npeg
proc test(T: typedesc, str: string) =
let p = peg "start":
start <- "Test"
var m = p.match(str)
echo m.captures
test(string, "Test")
import npeg
proc test[T](obj: T, str: string) =
let p = peg "start":
start <- "Test"
var m = p.match(str)
echo m.captures
test(1, "Test")
Metadata
Metadata
Assignees
Labels
No labels