I am trying to match anything but ; and thought I could do the following:
parser = peg Line do
Line <- str(!";")
end
Xpeg.match(parser, "a")
But nothing is captured:
%{
captures: [""],
match_len: 0,
rest: 'a',
result: :ok,
time: 0.0,
userdata: nil
}
I also tried various other patterns to no avail:
parser = peg Line do
Line <- str(!{";"})
end
Xpeg.match(parser, "a")
or
parser = peg Line do
Line <- str(!{';'})
end
Xpeg.match(parser, "a")
In the tests I could only find a negation without capture: https://github.com/zevv/xpeg/blob/master/test/xpeg_test.exs#L85-L86. Maybe negation does not capture anything?
What am I doing wrong?
I am trying to match anything but
;and thought I could do the following:But nothing is captured:
I also tried various other patterns to no avail:
or
In the tests I could only find a negation without capture: https://github.com/zevv/xpeg/blob/master/test/xpeg_test.exs#L85-L86. Maybe negation does not capture anything?
What am I doing wrong?