Details
Diff Detail
Event Timeline
lib/Format/TokenAnnotator.cpp | ||
---|---|---|
1821 | I've chosen 100 by fair dice roll. Please advise on how to pick a reasonable penalty :-) |
lib/Format/FormatTokenLexer.cpp | ||
---|---|---|
230 | I think, this could now use an elaborate comment on what it is actually trying to parse. And part of that should probably make it into the patch description. | |
235 | Indent seems off. | |
260 | Maybe use "Offset[1]" instead of "*(Offset + 1)"? | |
lib/Format/TokenAnnotator.cpp | ||
1821 | In what cases would you actually want to put a line break here? Presumably, if otherwise the column limit is violated. Are there any other cases? |
lib/Format/FormatTokenLexer.cpp | ||
---|---|---|
230 | Done. Also, it turns out my attempt here was overly optimistic, I actually need a proper state stack to handle this correctly. | |
260 | Is somePointer[1] idiomatic C for "the next element after this pointer"? To me + 1 seemed like a better expression of intent, if a bit more wordy. Done in any case. | |
lib/Format/TokenAnnotator.cpp | ||
1821 | No, I think breaking in the template string should probably be a last resort. It's IMHO conceptually tighter than string concatenation using +. That being said, I have no idea what number that should translate into :-) |
- Use a stack to parse nested template strings.
- move docs
- Fold GreaterStashed, LessStashed into TOKEN_STASHED lexer state.
- Test escaped dollar sign.
lib/Format/FormatTokenLexer.cpp | ||
---|---|---|
259 | Question by @ygao in the other diff:
A template like foo\${bar} is the literal string 'foo\${bar}', i.e. the \ acts as an escape for the '$' sign. I've added a test to validate that. |
.. in turn.