What is the behavior of TokenizerContext.previous #156
Unanswered
gSarciotto
asked this question in
Q&A
Replies: 1 comment 4 replies
-
Starting a tokenizer, as what? Typically they are hooked into looking for a particular character? Or are a particular kind? Can you maybe share some more code? The example you found is how it is indeed almost always handled. Say, a But, do note that |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey, so I have been writing an extension to parse the following:
[[some-alphanumeric-value]]
. I want to check that the first[
is not escaped (\[
) and if it is then I want tonok
The problem is that I am finding the behavior of the
previous
key in the tokenizer context pretty hard to understand.,The following entries have theprevious
with the following values in the starting state:a \[[b]] c
=>32
(space)[[b]] c =>
32
In the first case I expected the value
92
(backlash) while on the second one I expected either one of the line endings ornull
. I looked around to see how other extensions dealt with this case , however this doesn't work for me, the values in the events array are all of typedata
with previous value of32
as well :/For reference, this is the code for the starting state of the tokenizer:
Beta Was this translation helpful? Give feedback.
All reactions