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
63ed2b71
Commit
63ed2b71
authored
Oct 24, 2008
by
Robert Griesemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- missing file
R=r OCL=17813 CL=17813
parent
ad863046
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
0 deletions
+46
-0
usr/gri/pretty/compilation.go
usr/gri/pretty/compilation.go
+46
-0
No files found.
usr/gri/pretty/compilation.go
0 → 100644
View file @
63ed2b71
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package
Compilation
import
Scanner
"scanner"
import
Parser
"parser"
import
AST
"ast"
export
type
Flags
struct
{
verbose
bool
;
sixg
bool
;
deps
bool
;
columns
bool
;
testmode
bool
;
tokenchan
bool
;
}
type
Compilation
struct
{
prog
*
AST
.
Program
;
nerrors
int
;
}
export
func
Compile
(
src_file
,
src
string
,
flags
*
Flags
)
*
Compilation
{
var
scanner
Scanner
.
Scanner
;
scanner
.
Open
(
src_file
,
src
,
flags
.
columns
,
flags
.
testmode
);
var
tstream
*<-
chan
*
Scanner
.
Token
;
if
flags
.
tokenchan
{
tstream
=
scanner
.
TokenStream
();
}
var
parser
Parser
.
Parser
;
parser
.
Open
(
flags
.
verbose
,
flags
.
sixg
,
&
scanner
,
tstream
);
C
:=
new
(
Compilation
);
C
.
prog
=
parser
.
ParseProgram
();
C
.
nerrors
=
scanner
.
nerrors
;
return
C
;
}
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