Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
e6cd1e44
Commit
e6cd1e44
authored
Oct 07, 2008
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove uses of *T as an implicit forward declaration of T
R=gri,r OCL=16648 CL=16652
parent
96da920f
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
70 additions
and
5 deletions
+70
-5
flag.go
src/lib/flag.go
+6
-0
bug041.go
test/bugs/bug041.go
+1
-0
bug066.go
test/fixedbugs/bug066.go
+4
-0
rob2.go
test/ken/rob2.go
+6
-0
globals.go
usr/gri/gosrc/globals.go
+7
-2
ast.go
usr/gri/pretty/ast.go
+46
-3
No files found.
src/lib/flag.go
View file @
e6cd1e44
...
...
@@ -98,6 +98,12 @@ func atob(str string) (value bool, ok bool) {
return
false
,
false
}
type
(
BoolValue
struct
;
IntValue
struct
;
StringValue
struct
;
)
// -- Bool Value
type
BoolValue
struct
{
val
bool
;
...
...
test/bugs/bug041.go
View file @
e6cd1e44
...
...
@@ -6,6 +6,7 @@
package
main
type
T
struct
type
S
struct
{
p
*
T
// BUG T never declared
}
...
...
test/fixedbugs/bug066.go
View file @
e6cd1e44
...
...
@@ -6,6 +6,10 @@
package
main
type
(
Type
struct
;
Object
struct
;
)
type
Scope
struct
{
entries
*
map
[
string
]
*
Object
;
...
...
test/ken/rob2.go
View file @
e6cd1e44
...
...
@@ -9,6 +9,12 @@ package main
const
nilchar
=
0
;
type
(
Atom
struct
;
List
struct
;
Slist
struct
;
)
type
Atom
struct
{
str
string
;
integer
int
;
...
...
usr/gri/gosrc/globals.go
View file @
e6cd1e44
...
...
@@ -13,6 +13,11 @@ package Globals
// ----------------------------------------------------------------------------
type
Type
struct
type
Scope
struct
type
Elem
struct
type
Compilation
struct
export
type
Object
struct
{
exported
bool
;
pos
int
;
// source position (< 0 if unknown position)
...
...
@@ -86,7 +91,7 @@ export type Compilation struct {
// environment
flags
*
Flags
;
env
*
Environment
;
// TODO use open arrays eventually
pkg_list
[
256
]
*
Package
;
// pkg_list[0] is the current package
pkg_ref
int
;
...
...
@@ -199,7 +204,7 @@ func (L *List) at(i int) *Elem {
for
;
i
>
0
;
i
--
{
p
=
p
.
next
;
}
return
p
;
}
...
...
usr/gri/pretty/ast.go
View file @
e6cd1e44
...
...
@@ -8,11 +8,54 @@ package AST
// ----------------------------------------------------------------------------
// Visitor
type
(
Nil
struct
;
Ident
struct
;
ArrayType
struct
;
StructType
struct
;
MapType
struct
;
ChannelType
struct
;
PointerType
struct
;
InterfaceType
struct
;
FunctionType
struct
;
VarDeclList
struct
;
ImportDecl
struct
;
ConstDecl
struct
;
TypeDecl
struct
;
VarDecl
struct
;
Declaration
struct
;
FuncDecl
struct
;
MethodDecl
struct
;
Selector
struct
;
Index
struct
;
Call
struct
;
Pair
struct
;
Binary
struct
;
Unary
struct
;
Literal
struct
;
CompositeLit
struct
;
FunctionLit
struct
;
Label
struct
;
Block
struct
;
ExprStat
struct
;
Assignment
struct
;
ControlClause
struct
;
IfStat
struct
;
ForStat
struct
;
CaseClause
struct
;
SwitchStat
struct
;
ReturnStat
struct
;
IncDecStat
struct
;
ControlFlowStat
struct
;
GoStat
struct
;
Program
struct
;
)
export
type
Visitor
interface
{
// Basics
DoNil
(
x
*
Nil
);
DoIdent
(
x
*
Ident
);
// Types
DoFunctionType
(
x
*
FunctionType
);
DoArrayType
(
x
*
ArrayType
);
...
...
@@ -21,7 +64,7 @@ export type Visitor interface {
DoChannelType
(
x
*
ChannelType
);
DoInterfaceType
(
x
*
InterfaceType
);
DoPointerType
(
x
*
PointerType
);
// Declarations
DoImportDecl
(
x
*
ImportDecl
);
DoConstDecl
(
x
*
ConstDecl
);
...
...
@@ -31,7 +74,7 @@ export type Visitor interface {
DoFuncDecl
(
x
*
FuncDecl
);
DoMethodDecl
(
x
*
MethodDecl
);
DoDeclaration
(
x
*
Declaration
);
// Expressions
DoBinary
(
x
*
Binary
);
DoUnary
(
x
*
Unary
);
...
...
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