Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
38202de1
Commit
38202de1
authored
Feb 23, 2010
by
Rob Pike
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
goyacc: fix handling of / and comments in goyacc
Fixes #618. R=rsc CC=golang-dev
https://golang.org/cl/217094
parent
8ba5c559
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
2 deletions
+20
-2
src/cmd/goyacc/goyacc.go
src/cmd/goyacc/goyacc.go
+20
-2
No files found.
src/cmd/goyacc/goyacc.go
View file @
38202de1
...
...
@@ -1352,13 +1352,31 @@ loop:
return
case
'/'
:
nc
:=
getrune
(
finput
)
if
nc
!=
'/'
&&
nc
!=
'*'
{
ungetrune
(
finput
,
nc
)
break
}
// a comment
putrune
(
ftable
,
c
)
putrune
(
ftable
,
nc
)
c
=
getrune
(
finput
)
for
c
!=
EOF
{
if
c
==
'\n'
{
switch
{
case
c
==
'\n'
:
lineno
++
break
swt
if
nc
==
'/'
{
// end of // comment
break
swt
}
case
c
==
'*'
&&
nc
==
'*'
:
// end of /* comment?
nnc
:=
getrune
(
finput
)
if
nnc
==
'/'
{
putrune
(
ftable
,
'*'
)
putrune
(
ftable
,
'/'
)
c
=
getrune
(
finput
)
break
swt
}
ungetrune
(
finput
,
nnc
)
}
putrune
(
ftable
,
c
)
c
=
getrune
(
finput
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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