Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/Format/TokenAnnotator.cpp | ||
---|---|---|
1821 ↗ | (On Diff #64214) | I've chosen 100 by fair dice roll. Please advise on how to pick a reasonable penalty :-) |
lib/Format/FormatTokenLexer.cpp | ||
---|---|---|
231 ↗ | (On Diff #64214) | 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. |
236 ↗ | (On Diff #64214) | Indent seems off. |
246 ↗ | (On Diff #64214) | Maybe use "Offset[1]" instead of "*(Offset + 1)"? |
lib/Format/TokenAnnotator.cpp | ||
1821 ↗ | (On Diff #64214) | 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 | ||
---|---|---|
231 ↗ | (On Diff #64214) | Done. Also, it turns out my attempt here was overly optimistic, I actually need a proper state stack to handle this correctly. |
246 ↗ | (On Diff #64214) | 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 ↗ | (On Diff #64214) | 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 ↗ | (On Diff #68687) | 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. |
Looks good. Sorry for the delay!
lib/Format/FormatTokenLexer.h | ||
---|---|---|
68 ↗ | (On Diff #68687) | .. in turn. |