Implements parsing for #pragma, handles the multiple case niavely#372
Implements parsing for #pragma, handles the multiple case niavely#372SpaceManiac merged 2 commits intoSpaceManiac:masterfrom
Conversation
I'm using a second hashmap to track multiple'd files. Not sure that this is the best way of going about it, but it's a living
| } | ||
| "pragma" if disabled => {} | ||
| "pragma" => { | ||
| expect_token!((text) = Token::String(text)); |
There was a problem hiding this comment.
You probably mean Ident here, not String
There was a problem hiding this comment.
I changed it, but are you sure? #warn uses String() and its input isn't "'d at all, it's just the text after the #warn
There was a problem hiding this comment.
It's stupid, but there's a hack in lexer.rs for this: if ident == "warn" || ident == "error" {
There was a problem hiding this comment.
in fucking tears
There was a problem hiding this comment.
should I add to that or just keep as is
There was a problem hiding this comment.
As written is fine. The reason is that #warn and #error want to treat the whole rest of the line as one big string. #pragma is (for now...) followed by ordinary tokens.
There was a problem hiding this comment.
alright. is there anything else you want me to do here?
…agma args as an ident instead of a string
I'm using a second hashmap to track multiple'd files. Not sure that this is the best way of going about it, but it's a living