-
Notifications
You must be signed in to change notification settings - Fork 587
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
C: Fix line continuation handling (#1370)
Escaped newlines were properly handled inside preprocessor directives, but not otherwise. Seeing `continue` here suggests the code used to work a long time ago but some loop refactoring broke it, as now it would not stay in the loop unless in a preprocessor directive. Or maybe it only ever worked for preprocessor directives, and the `continue` was superfluous? Fixes #1370.
- Loading branch information
Showing
4 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
typedef int T; | ||
|
||
int func1(\ | ||
int var1, int var2, ...); | ||
|
||
int func2(int var1, \ | ||
int var2, ...); | ||
|
||
int func3(T \ | ||
var1, T var2, ...); | ||
int func4(T var1, \ | ||
T var2, ...); | ||
|
||
int func5(int \ | ||
var1, int var2, ...); | ||
|
||
// check continuations in macros are properly handled | ||
#define MACRO1 \ | ||
( | ||
int func6(void); | ||
#define MACRO2(x) \ | ||
int x(void); | ||
#define MACRO3(y) \ | ||
int \ | ||
y \ | ||
( \ | ||
void \ | ||
); | ||
int func7(int a); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# format=tagmanager | ||
MACRO1�65536�0 | ||
MACRO2�131072�(x)�0 | ||
MACRO3�131072�(y)�0 | ||
T�4096�0�int | ||
func1�1024�(int var1, int var2, ...)�0�int | ||
func2�1024�(int var1, int var2, ...)�0�int | ||
func3�1024�(T var1, T var2, ...)�0�int | ||
func4�1024�(T var1, T var2, ...)�0�int | ||
func5�1024�(int var1, int var2, ...)�0�int | ||
func6�1024�(void)�0�int | ||
func7�1024�(int a)�0�int |