Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
unittests/Format/FormatTestJS.cpp | ||
---|---|---|
339 ↗ | (On Diff #54017) | What does the star mean here? Should we actually introduce a token type or do you think it's just going to work? Specifically, what happens if you need to line-wrap? |
unittests/Format/FormatTestJS.cpp | ||
---|---|---|
339 ↗ | (On Diff #54017) | The star indicates that this is a function that returns a generator, i.e. implicitly returns an iterator in which you shove values with yield. I think you wouldn't want to wrap between function and *. We currently don't, but more by chance - it's a side effect of not breaking before a binary operator. function* cannot be one token, there may be whitespace and comments in between. We could have a generator star token, but there are places where that'd be hard for us to detect, e.g. the class method above. Having a generator star only occasionally be recognized of course would be rather confusing. So I'd punt on this for the time beimg. I've added a test to make sure we correctly wrap above. Does that make sense? |
unittests/Format/FormatTestJS.cpp | ||
---|---|---|
339 ↗ | (On Diff #54195) | Fundamentally, I think there is two things we might need to do:
|
unittests/Format/FormatTestJS.cpp | ||
---|---|---|
339 ↗ | (On Diff #54195) | For (1) if needed we can detect the immediately preceding function. Overall I find it highly unlikely that this becomes a problem, having generator functions that wrap is unlikely, they tend to be top level functions. |