summaryrefslogtreecommitdiff
path: root/source/slang/lexer.cpp
AgeCommit message (Collapse)Author
2017-06-15Rename `Slang::Compiler` -> `Slang`Tim Foley
This gets rid of one unecessary namespace.
2017-06-13Fixups for newline-escaping behavior.Tim Foley
This is really messy and I'm not entirely happy with the result, but at least we handle a couple more corner cases.
2017-06-12Lexer: handle escaped newlinesTim Foley
This is mostly to allow for the idiomatic style of defining a multi-line macro in C: #define FOO(a,b) \ x(a) \ y(b) \ /* end */ The handling is reasonably general: in the lexer whenever we need to consume or "peek" the next code point, we check if we are at the start of a backslash-newline sequence, and if so we skip past that to find what we were looking for. However, the way I'm handling things right now there is no step taken to "clean" a token and remove the backslash or newline from its value, so downstream code that actually inspects token values will probably break if users start putting escaped newlines in the middle of names. We can fix that issue when (if) it comes up.
2017-06-09Initial import of code.Tim Foley