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
9abf9e8a
Commit
9abf9e8a
authored
Jun 08, 2008
by
Ken Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nihon
SVN=121620
parent
b6eca353
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
15 deletions
+11
-15
src/cmd/gc/go.h
src/cmd/gc/go.h
+1
-1
src/cmd/gc/lex.c
src/cmd/gc/lex.c
+10
-14
No files found.
src/cmd/gc/go.h
View file @
9abf9e8a
...
@@ -387,7 +387,7 @@ void lexinit(void);
...
@@ -387,7 +387,7 @@ void lexinit(void);
char
*
lexname
(
int
);
char
*
lexname
(
int
);
long
getr
(
void
);
long
getr
(
void
);
int
getnsc
(
void
);
int
getnsc
(
void
);
int
escchar
(
int
,
int
*
,
vlong
*
);
int
escchar
(
int
,
vlong
*
);
int
getc
(
void
);
int
getc
(
void
);
void
ungetc
(
int
);
void
ungetc
(
int
);
void
mkpackage
(
char
*
);
void
mkpackage
(
char
*
);
...
...
src/cmd/gc/lex.c
View file @
9abf9e8a
...
@@ -175,7 +175,6 @@ yylex(void)
...
@@ -175,7 +175,6 @@ yylex(void)
vlong
v
;
vlong
v
;
char
*
cp
;
char
*
cp
;
Rune
rune
;
Rune
rune
;
int
escflag
;
Sym
*
s
;
Sym
*
s
;
l0:
l0:
...
@@ -225,19 +224,19 @@ l0:
...
@@ -225,19 +224,19 @@ l0:
caseq:
caseq:
for
(;;)
{
for
(;;)
{
if
(
escchar
(
'"'
,
&
escflag
,
&
v
))
if
(
escchar
(
'"'
,
&
v
))
break
;
break
;
if
(
escflag
)
{
if
(
v
>=
Runeself
)
{
cp
=
remal
(
cp
,
c1
,
1
);
cp
[
c1
++
]
=
v
;
}
else
{
// botch - this limits size of runes
// botch - this limits size of runes
rune
=
v
;
rune
=
v
;
c
=
runelen
(
rune
);
c
=
runelen
(
rune
);
cp
=
remal
(
cp
,
c1
,
c
);
cp
=
remal
(
cp
,
c1
,
c
);
runetochar
(
cp
+
c1
,
&
rune
);
runetochar
(
cp
+
c1
,
&
rune
);
c1
+=
c
;
c1
+=
c
;
continue
;
}
}
cp
=
remal
(
cp
,
c1
,
1
);
cp
[
c1
++
]
=
v
;
}
}
goto
catem
;
goto
catem
;
...
@@ -282,9 +281,9 @@ l0:
...
@@ -282,9 +281,9 @@ l0:
case
'\''
:
case
'\''
:
/* '.' */
/* '.' */
if
(
escchar
(
'\''
,
&
escflag
,
&
v
))
if
(
escchar
(
'\''
,
&
v
))
v
=
'\''
;
// allow '''
v
=
'\''
;
// allow '''
if
(
!
escchar
(
'\''
,
&
escflag
,
&
v
))
{
if
(
!
escchar
(
'\''
,
&
v
))
{
yyerror
(
"missing '"
);
yyerror
(
"missing '"
);
ungetc
(
v
);
ungetc
(
v
);
}
}
...
@@ -696,13 +695,12 @@ getnsc(void)
...
@@ -696,13 +695,12 @@ getnsc(void)
int
int
escchar
(
int
e
,
int
*
escflg
,
vlong
*
val
)
escchar
(
int
e
,
vlong
*
val
)
{
{
int
i
,
c
;
int
i
;
long
c
;
vlong
l
;
vlong
l
;
*
escflg
=
0
;
loop:
loop:
c
=
getr
();
c
=
getr
();
if
(
c
==
'\n'
)
{
if
(
c
==
'\n'
)
{
...
@@ -779,7 +777,6 @@ hex:
...
@@ -779,7 +777,6 @@ hex:
ungetc
(
c
);
ungetc
(
c
);
break
;
break
;
}
}
*
escflg
=
1
;
*
val
=
l
;
*
val
=
l
;
return
0
;
return
0
;
...
@@ -796,7 +793,6 @@ oct:
...
@@ -796,7 +793,6 @@ oct:
}
}
if
(
l
>
255
)
if
(
l
>
255
)
warn
(
"oct escape value > 255: %d"
,
l
);
warn
(
"oct escape value > 255: %d"
,
l
);
*
escflg
=
1
;
*
val
=
l
;
*
val
=
l
;
return
0
;
return
0
;
}
}
...
...
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