You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Normally, whitespace is ignored and there are no whitespace tokens returned by Scan(). However, temporarily emitting whitespace tokens could prove quite useful.
We should add the ability for certain tokens to temporarily enable the scanning of any immediately following whitespace tokens, and then automatically disable it on the next non- whitespace token.
If TOKEN_A is marked as a whitespace trigger token, the two possibilities would be:
TOKEN_ATOKEN_B -- This indicates that no whitespace whatsoever exists between these two tokens.
TOKEN_ASPACETOKEN_B -- A SPACE token is emitted to indicate that one or more whitespace characters (of any kind) exist between the two tokens.
It is then up to the parser to deal with these SPACE tokens as it sees fit.
NOTE: Instead of always emitting a single SPACE token regardless of how much whitespace is scanned, we could:
distinguish between types of whitespace (space, tab, newline, etc... ) -- and/or
emit a separate token for each and every whitespace rune enountered.
The text was updated successfully, but these errors were encountered:
After careful review, it has been determined that this change is actually incomplete. However, there doesn't appear to be a logical use-case documented for it.
A separate ticket (Z72) has been created to discern what that use-case may be and this ticket will be marked as blocked until that's done.
Normally, whitespace is ignored and there are no whitespace tokens returned by Scan(). However, temporarily emitting whitespace tokens could prove quite useful.
We should add the ability for certain tokens to temporarily enable the scanning of any immediately following whitespace tokens, and then automatically disable it on the next non- whitespace token.
If
TOKEN_A
is marked as a whitespace trigger token, the two possibilities would be:TOKEN_A
TOKEN_B
-- This indicates that no whitespace whatsoever exists between these two tokens.TOKEN_A
SPACE
TOKEN_B
-- ASPACE
token is emitted to indicate that one or more whitespace characters (of any kind) exist between the two tokens.It is then up to the parser to deal with these
SPACE
tokens as it sees fit.NOTE: Instead of always emitting a single
SPACE
token regardless of how much whitespace is scanned, we could:The text was updated successfully, but these errors were encountered: