-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide more information in the tokenizer (added to the Token) #13
Comments
Yeap, this should be done, for sure. I'll try to take a look this weekend. |
Specy
added a commit
to Specy/dotlr
that referenced
this issue
Oct 1, 2024
Specy
added a commit
to Specy/dotlr
that referenced
this issue
Oct 1, 2024
Specy
added a commit
to Specy/dotlr
that referenced
this issue
Oct 1, 2024
Specy
added a commit
to Specy/dotlr
that referenced
this issue
Oct 1, 2024
Specy
added a commit
to Specy/dotlr
that referenced
this issue
Oct 1, 2024
Specy
added a commit
to Specy/dotlr
that referenced
this issue
Oct 12, 2024
Specy
added a commit
to Specy/dotlr
that referenced
this issue
Oct 12, 2024
Specy
added a commit
to Specy/dotlr
that referenced
this issue
Oct 14, 2024
feat: add token span info, fixes umut-sahin#1 and umut-sahin#13
Specy
added a commit
to Specy/dotlr
that referenced
this issue
Oct 14, 2024
Specy
added a commit
to Specy/dotlr
that referenced
this issue
Oct 21, 2024
Specy
added a commit
to Specy/dotlr
that referenced
this issue
Oct 21, 2024
Specy
added a commit
to Specy/dotlr
that referenced
this issue
Oct 31, 2024
umut-sahin
pushed a commit
that referenced
this issue
Nov 7, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Most parsers have information on a token that tell you at what position the token is in. for example in this tokenized string (tokens separated by a |):
foo
: offset 0, len 3 (optional, can be derived from the slice itself(
: offset 3, len 1bar
: offset: 4, len 3etc...
Other useful proprieties are
start line, end line, start column, end column
Also, does the parser ignore whitespace?
foo(bar+baz)
andfoo(bar + baz)
tokenize the same.The offset information is useful to create things like this:
I was calculating the offset myself but since whitespace seems to be ignored, the tokens positions are wrong, this would be solved with the offsets.
This should also help with #1
The text was updated successfully, but these errors were encountered: