3 ms·
Sure, just plain C can wreck any kind of parsing with its macros.
by dataflow 5y ago
Sure, just plain C can wreck any kind of parsing with its macros.
- int0x80 5y agoTechnically the parsing itself and the grammar are the same, they don't depend on defined macros. Yes, defining a macro in an included file can make the resulting AST change, but the parsing algorithm doesn't really care about it.
- chriswarbo 5y agoUnfortunately, text-substitution macros (like CPP) pretty much force a source file to be treated as a stream of bytes. They can be handy, but delimited macros (e.g. like Lisps) are much less invasive.
- dataflow 5y agoYeah that's kind of my point. The idea of syntax based source control is nice in theory but in reality it's just wishful thinking with the kinds of languages we use.