1
0
mirror of https://github.com/golang/go synced 2024-10-03 20:31:22 -06:00
Commit Graph

7 Commits

Author SHA1 Message Date
Robert Griesemer
89319cfbf9 - implemented heuristic for composite literals starting with a type name:
if in a if, for, or switch header, must be parenthesized
- implemented string concatenation
- simplified a lot of code
- added many more tests: can now parse all *.go files I got my hands on
- printing output currently broken in some cases, use with -s (silent) option

R=r
OCL=16932
CL=16934
2008-10-10 16:03:32 -07:00
Robert Griesemer
4fb6064c11 - fixed Makefile, added more tests
- fixed parsing of parameter lists (sigh)

R=r
DELTA=48  (22 added, 7 deleted, 19 changed)
OCL=16319
CL=16321
2008-10-01 14:31:44 -07:00
Robert Griesemer
c13c03c261 - first cut at building and printing AST
R=r
OCL=15675
CL=15675
2008-09-22 18:26:12 -07:00
Robert Griesemer
26adb31c30 - fix for out-of-bounds error found by rsc
- removed tests that may have wrong Go code from Makefile

R=r
OCL=15532
CL=15532
2008-09-19 10:56:35 -07:00
Robert Griesemer
2b70c6add3 - fixed old test cases with wrong syntax
- added more test cases to Makefile
- fixed another parser issue (possibly a 6g bug - to be tracked down)

R=r
OCL=15516
CL=15516
2008-09-18 23:09:07 -07:00
Robert Griesemer
a1ee6804dd - fixed bug which prevented parser.go from compiling
(typo in ptr decl lead to an unresolved forward declaration)
- fixed parser bugs
- fixed Makefile
- now successfully parses most code

Issues:
- composite literals (cannot be identified easily from syntax alone)
- new(T, ...) (cannot be identified easily from syntax alone since
  new is not a keyword and thus could be a different function then
  the allocation function at which point "new((x + y))" is legal,
  but the inner "(x" looks like the beginning of a function type)

R=r
OCL=15515
CL=15515
2008-09-18 22:53:54 -07:00
Robert Griesemer
81d7c51837 First cut at a Go pretty printer:
- code scavenged from Go-in-Go front-end (will merge back)
- using "symbol-table" free parsing to build AST
- no printing yet

R=r
OCL=15504
CL=15504
2008-09-18 16:58:37 -07:00