Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pike
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pikelang
pike
Commits
ea0d481a
Commit
ea0d481a
authored
Jul 22, 2012
by
Arne Goedeke
Browse files
Options
Downloads
Patches
Plain Diff
lexer: added support for non abbreviated #line directive
parent
38e29605
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/lexer.h
+11
-0
11 additions, 0 deletions
src/lexer.h
with
11 additions
and
0 deletions
src/lexer.h
+
11
−
0
View file @
ea0d481a
...
@@ -703,6 +703,16 @@ static int low_yylex(struct lex *lex, YYSTYPE *yylval)
...
@@ -703,6 +703,16 @@ static int low_yylex(struct lex *lex, YYSTYPE *yylval)
switch
(
len
>
0
?
INDEX_CHARP
(
buf
,
0
,
SHIFT
)
:
0
)
switch
(
len
>
0
?
INDEX_CHARP
(
buf
,
0
,
SHIFT
)
:
0
)
{
{
case
'l'
:
if
(
ISWORD
(
"line"
))
{
SKIPSPACE
();
if
(
LOOK
()
<
'0'
||
LOOK
()
>
'9'
)
goto
unknown_directive
;
READBUF
(
C
!=
'\n'
&&
C
!=
' '
&&
C
!=
'\t'
);
/* fallthrough */
}
else
goto
unknown_directive
;
case
'0'
:
case
'1'
:
case
'2'
:
case
'3'
:
case
'4'
:
case
'0'
:
case
'1'
:
case
'2'
:
case
'3'
:
case
'4'
:
case
'5'
:
case
'6'
:
case
'7'
:
case
'8'
:
case
'9'
:
case
'5'
:
case
'6'
:
case
'7'
:
case
'8'
:
case
'9'
:
lex
->
current_line
=
lex_strtol
(
buf
,
NULL
,
10
)
-
1
;
lex
->
current_line
=
lex_strtol
(
buf
,
NULL
,
10
)
-
1
;
...
@@ -791,6 +801,7 @@ static int low_yylex(struct lex *lex, YYSTYPE *yylval)
...
@@ -791,6 +801,7 @@ static int low_yylex(struct lex *lex, YYSTYPE *yylval)
/* FALL_THROUGH */
/* FALL_THROUGH */
default:
default:
unknown_directive:
/* FIXME: This doesn't look all that safe...
/* FIXME: This doesn't look all that safe...
* buf isn't NUL-terminated, and it won't work on wide strings.
* buf isn't NUL-terminated, and it won't work on wide strings.
* /grubba 1999-02-20
* /grubba 1999-02-20
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment