This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Function-like calls break string formatting inside parentheses #309
Open
Description
Prerequisites
- Put an X between the brackets on this line if you have done all of the following:
- Reproduced the problem in Safe Mode: http://flight-manual.atom.io/hacking-atom/sections/debugging/#using-safe-mode
- Followed all applicable steps in the debugging guide: http://flight-manual.atom.io/hacking-atom/sections/debugging/
- Checked the FAQs on the message board for common solutions: https://discuss.atom.io/c/faq
- Checked that your issue isn't already filed: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aatom
- Checked that there is not already an Atom package that provides the described functionality: https://atom.io/packages
Description / Steps to Reproduce
Let's start with this code:
__asm__
(
"_func:\n"
"orr x2, x2, " M1(M2(2)) "\n"
"nop\n"
);
This renders as I would expect:
Add one empty line and the formatting of M1
and M2
changes from beige to red (my color for constants):
Add another line and string formatting breaks after the nested macro invocation:
Some arbitrary changes seem to bypass this issue, like adding spaces before the parentheses, or having just one function-like expression:
Additional info:
- The
__asm__
part can be any identifier, but its length seems to be related to how many newlines are required for string formatting to break. - The lines before the function-like expression don't have to be empty, and having content on them makes the required number of lines smaller before string formatting starts to break.
M1
andM2
don't have to be macros (i.e. all-uppercase). Any function-like expression will work.- This only happens with C and C++ grammars, but not with Objective-C or Objective-C++.
Another test case:
some_identifier_that_is_way_longer_than_any_sane_person_would_ever_make_it_of_their_own_free_will
(
"_func:\n"
"nop\n nop\n nop\n nop\n nop\n nop\n nop\n nop\n"
"nop\n nop\n nop\n nop\n nop\n nop\n nop\n nop\n"
"nop\n nop\n nop\n nop\n nop\n nop\n nop\n nop\n"
"nop\n nop\n nop\n nop\n nop\n nop\n nop\n nop\n"
"orr x2, x2, " M1(M2(2)) "\n"
"nop\n"
);
Result:
Versions
OS: macOS High Sierra 10.13.6 (17G3025)
$ atom --version
Atom : 1.32.2
Electron: 2.0.9
Chrome : 61.0.3163.100
Node : 8.9.3
$ apm --version
apm 2.1.2
npm 6.2.0
node 8.9.3 x64
atom 1.32.2
python 2.7.10
git 2.17.2
language-c
package version: 0.60.13