Skip to content

Question about how Bluehawk parsing works #137

Closed Answered by cbush
mongodben asked this question in General
Discussion options

You must be logged in to vote

While there is actually a bunch of implementation for handling tokens that push another parser (such as the <?php tag that switches from HTML to PHP), this is actually not as smart as any of that. The JS implementation doesn't declare any string types so any Bluehawk token in a string will be picked up. Your JS parser ignores the gql template literal (it's just a string as far as JS is concerned), but Bluehawk finds the tag tokens and uses them. Meanwhile, your gql parser ignores the Bluehawk tokens because they are commented out in gql.

There's an edge case here where if a block comment open token were in a string without a matching close comment token, the Bluehawk parser would treat th…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mongodben
Comment options

mongodben Mar 17, 2023
Maintainer Author

Answer selected by mongodben
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants