mirror of
https://github.com/golang/go
synced 2024-11-26 16:57:14 -07:00
f8ff3b1055
- more work on template-driven ast formatting - added preliminary test suite - added documentation TBR=r OCL=27858 CL=27858
40 lines
367 B
Plaintext
40 lines
367 B
Plaintext
//string =
|
|
// "%s";
|
|
|
|
pointer =
|
|
*;
|
|
|
|
array =
|
|
*;
|
|
|
|
//token.Token =
|
|
// "token<%d>"; // this could be a Go-installed formatter
|
|
|
|
ast
|
|
;
|
|
|
|
Comments =
|
|
"comments\n";
|
|
|
|
Ident =
|
|
Value;
|
|
|
|
Program =
|
|
"package " Name "\n\n" {Decls "\n\n"};
|
|
|
|
GenDecl =
|
|
Doc
|
|
Tok " (\n"
|
|
")\n";
|
|
|
|
FuncType =
|
|
"(" ")";
|
|
|
|
BlockStmt =
|
|
"{\n" "}\n";
|
|
|
|
FuncDecl =
|
|
"func " Name Type [" " Body];
|
|
|
|
Decl =
|
|
^; |