3 ms·
Macros have a freeform syntax, with the only restriction being that delimiters within have to be balanced. I don't see how an IDE could provide general syntax h
by kibwen 12y ago
Macros have a freeform syntax, with the only restriction being that delimiters within have to be balanced. I don't see how an IDE could provide general syntax highlighting for them.
- whyever 12y agoThe IDE could parse the macro definition and highlight accordingly. (It would know where to expect an identifier and where to expect an expression etc.)
- steveklabnik 12y ago> (It would know where to expect an identifier and where to expect an expression etc.) But that doesn't mean that what's in the macro should be highlighted like Rust: sql!("SELECT * FROM users WHERE name = $1"); is a macro provided by https://github.com/sfackler/rust-postgres-macros https://github.com/sfackler/rust-postgres-macros , and should be highlighted like SQL, not like a Rust string. sql!("SELECT * FORM users WHERE name = $1"); throws an error, because it's malformed.