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
3aa892c4
Commit
3aa892c4
authored
Apr 24, 2009
by
Robert Griesemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
daily snapshot:
- more work on template-driven ast printing R=r OCL=27851 CL=27851
parent
b03b541b
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
314 additions
and
149 deletions
+314
-149
usr/gri/pretty/ast.txt
usr/gri/pretty/ast.txt
+36
-10
usr/gri/pretty/format.go
usr/gri/pretty/format.go
+278
-139
No files found.
usr/gri/pretty/ast.txt
View file @
3aa892c4
//
TODO prefix decl doesn't work
//
string =
//
ast .
//
"%s" ;
ast.Ident
=
pointer
=
Value .
^ ;
a
st.Program
=
a
rray
=
"package " Name "\n" { Decls "\n\n" } .
^ ;
ast.GenDecl
=
//token.Token
=
"def " .
// "token<%d>" ; // this should be a Go-installed formatter
ast.FuncDecl =
ast
"func " .
;
\ No newline at end of file
Comments =
"comments\n" ;
Ident =
Value ;
Program =
"package " Name "\n\n" { Decls "\n\n" } ;
GenDecl =
Doc
Tok " (\n"
")\n";
FuncType =
"(" { Params } ")" ;
BlockStmt =
"{\n" "}\n" ;
FuncDecl =
"func " Name Type [ " " Body ] ;
Decl =
^ ;
\ No newline at end of file
usr/gri/pretty/format.go
View file @
3aa892c4
This diff is collapsed.
Click to expand it.
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