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
47809085
Commit
47809085
authored
Sep 08, 2008
by
Robert Griesemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- adjust my code and tests to new function syntax
R=r OCL=14939 CL=14941
parent
077fe408
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
23 deletions
+23
-23
usr/gri/gosrc/decls.go
usr/gri/gosrc/decls.go
+16
-16
usr/gri/gosrc/globals.go
usr/gri/gosrc/globals.go
+4
-4
usr/gri/gosrc/parser.go
usr/gri/gosrc/parser.go
+2
-2
usr/gri/gosrc/test/c.go
usr/gri/gosrc/test/c.go
+1
-1
No files found.
usr/gri/gosrc/decls.go
View file @
47809085
...
...
@@ -37,23 +37,23 @@ type (
T5
*
T4
;
)
type
F0
func
()
type
F1
func
(
a
int
)
type
F2
func
(
a
,
b
int
,
c
float
)
type
F3
func
()
bool
type
F4
func
(
a
int
)
(
z
T5
,
ok
bool
)
type
F5
func
(
a
,
b
int
,
c
float
)
(
z
T5
,
ok
bool
)
type
F6
func
(
a
int
,
b
float
)
bool
type
F7
func
(
a
int
,
b
float
,
c
,
d
*
bool
)
bool
export
type
M0
func
(
p
T5
)
.
();
type
F0
()
type
F1
(
a
int
)
type
F2
(
a
,
b
int
,
c
float
)
type
F3
()
bool
type
F4
(
a
int
)
(
z
T5
,
ok
bool
)
type
F5
(
a
,
b
int
,
c
float
)
(
z
T5
,
ok
bool
)
type
F6
(
a
int
,
b
float
)
bool
type
F7
(
a
int
,
b
float
,
c
,
d
*
bool
)
bool
export
type
M0
(
p
T5
)
.
();
type
(
M1
func
(
p
T5
)
.
(
a
int
);
M2
func
(
p
T5
)
.
(
a
,
b
int
,
c
float
);
M3
func
(
p
T5
)
.
()
bool
;
M4
func
(
p
T5
)
.
(
a
int
)
(
z
T5
,
ok
bool
);
M1
(
p
T5
)
.
(
a
int
);
M2
(
p
T5
)
.
(
a
,
b
int
,
c
float
);
M3
(
p
T5
)
.
()
bool
;
M4
(
p
T5
)
.
(
a
int
)
(
z
T5
,
ok
bool
);
)
export
type
M5
func
(
p
T5
)
.
(
a
,
b
int
,
c
float
)
(
z
T5
,
ok
bool
);
export
type
M5
(
p
T5
)
.
(
a
,
b
int
,
c
float
)
(
z
T5
,
ok
bool
);
type
T6
chan
int
type
T7
chan
<-
*
T6
...
...
@@ -62,7 +62,7 @@ type T8 chan-< *T6
type
T9
struct
{
p
*
T9
;
q
[]
*
map
[
int
]
*
T9
;
f
*
func
(
x
,
y
*
T9
)
*
T9
;
f
*
(
x
,
y
*
T9
)
*
T9
;
}
export
type
T11
struct
{
...
...
usr/gri/gosrc/globals.go
View file @
47809085
...
...
@@ -75,10 +75,10 @@ export type Flags struct {
export
type
Environment
struct
{
Error
*
func
(
comp
*
Compilation
);
// TODO complete this
Import
*
func
(
comp
*
Compilation
,
pkg_file
string
)
*
Package
;
Export
*
func
(
comp
*
Compilation
,
pkg_file
string
);
Compile
*
func
(
comp
*
Compilation
,
src_file
string
);
Error
*
(
comp
*
Compilation
);
// TODO complete this
Import
*
(
comp
*
Compilation
,
pkg_file
string
)
*
Package
;
Export
*
(
comp
*
Compilation
,
pkg_file
string
);
Compile
*
(
comp
*
Compilation
,
src_file
string
);
}
...
...
usr/gri/gosrc/parser.go
View file @
47809085
...
...
@@ -597,7 +597,6 @@ func (P *Parser) ParseNamedSignature() (pos int, ident string, typ *Globals.Type
func
(
P
*
Parser
)
ParseFunctionType
()
*
Globals
.
Type
{
P
.
Trace
(
"FunctionType"
);
P
.
Expect
(
Scanner
.
FUNC
);
typ
:=
P
.
ParseAnonymousSignature
();
P
.
Ecart
();
...
...
@@ -796,7 +795,7 @@ func (P *Parser) TryType() *Globals.Type {
case
Scanner
.
LBRACK
:
typ
=
P
.
ParseArrayType
();
case
Scanner
.
CHAN
:
typ
=
P
.
ParseChannelType
();
case
Scanner
.
INTERFACE
:
typ
=
P
.
ParseInterfaceType
();
case
Scanner
.
FUNC
:
typ
=
P
.
ParseFunctionType
();
case
Scanner
.
LPAREN
:
typ
=
P
.
ParseFunctionType
();
case
Scanner
.
MAP
:
typ
=
P
.
ParseMapType
();
case
Scanner
.
STRUCT
:
typ
=
P
.
ParseStructType
();
case
Scanner
.
MUL
:
typ
=
P
.
ParsePointerType
();
...
...
@@ -908,6 +907,7 @@ func (P *Parser) ParseNew() Globals.Expr {
func
(
P
*
Parser
)
ParseFunctionLit
()
Globals
.
Expr
{
P
.
Trace
(
"FunctionLit"
);
P
.
Expect
(
Scanner
.
FUNC
);
typ
:=
P
.
ParseFunctionType
();
P
.
ParseBlock
(
typ
.
scope
);
...
...
usr/gri/gosrc/test/c.go
View file @
47809085
...
...
@@ -4,4 +4,4 @@ import "d"
export
type
T1
D
.
T1
;
export
type
T2
D
.
T2
;
export
type
F1
func
(
a
D
.
T1
,
b
*
D
.
T2
);
export
type
F1
(
a
D
.
T1
,
b
*
D
.
T2
);
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