Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Willi Mutschler
preprocessor
Commits
ad1ef0d8
Commit
ad1ef0d8
authored
Jan 29, 2018
by
Houtan Bastani
Browse files
macroprocessor: fix unhandled case of nested ifdef/ifndef statements. closes #1587
parent
b94ff64c
Changes
1
Hide whitespace changes
Inline
Side-by-side
macro/MacroFlex.ll
View file @
ad1ef0d8
...
...
@@ -305,6 +305,16 @@ CONT \\\\
then_body_tmp
.
append
(
yytext
)
;
yylloc-
>
step
()
;
}
<
THEN_BODY
>
^
{
SPC
}*
@#
{
SPC
}*
ifdef
({
SPC
}
|
{
CONT
})
{
nested_if_nb++
;
then_body_tmp
.
append
(
yytext
)
;
yylloc-
>
step
()
;
}
<
THEN_BODY
>
^
{
SPC
}*
@#
{
SPC
}*
ifndef
({
SPC
}
|
{
CONT
})
{
nested_if_nb++
;
then_body_tmp
.
append
(
yytext
)
;
yylloc-
>
step
()
;
}
<
THEN_BODY
>.
{
then_body_tmp
.
append
(
yytext
)
; yylloc->step(); }
<
THEN_BODY
><<
EOF
>>
{
driver
.
error
(
if_stmt_loc_tmp
,
"@#if/@#ifdef/@#ifndef not matched by an @#endif or file does not end with a new line (unexpected end of file)"
)
; }
<
THEN_BODY
>
^
{
SPC
}*
@#
{
SPC
}*
else
{
SPC
}*(
\/\/
.*)
?
{
EOL
}
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment