Ian Lance Taylor [Tue, 21 Oct 2008 00:10:03 +0000 (17:10 -0700)]
Match error messages generated by gccgo:
convlit1.go:6:15: error: composite literal requires array, map, or struct type
convlit1.go:5:16: error: incompatible type for element 0 in composite literal
convlit1.go:10:15: error: incompatible types in binary expression
Robert Griesemer [Mon, 20 Oct 2008 23:44:03 +0000 (16:44 -0700)]
- fixed missing parens in some cases of unary expressions
- added validation test verifying that pretty output compiles with 6g again (disabled at the moment)
- replaced another recursive function with an interative solution
Russ Cox [Mon, 20 Oct 2008 20:53:56 +0000 (13:53 -0700)]
6g:
make sure methods end up immediately following
the struct they are methods on.
ar:
eliminate duplicate definitions from __.PKGDEF.
check that multiple .6 do not give different defs for same
exported type/var/func/const.
increase ar header name size from 16 to 64 bytes
Robert Griesemer [Sun, 19 Oct 2008 03:20:30 +0000 (20:20 -0700)]
- simplified parsing of composite literals and slices by
treating ":" as lowest-level binary operator
- more precise error message for composites
- added flag -columns (false) - when set, prints precise error column
- a few more tests
Robert Griesemer [Sat, 18 Oct 2008 23:42:25 +0000 (16:42 -0700)]
Added mechanism for very precise self-testing:
- in selftest mode (-t) interpret comments of the form /* ERROR */ and /* SYNC */
and validate reported errors with the error markings in a file
- added initial selftest.go file
Also:
- fixed an issue with empty blocks
- generally report better error messages
- added many more tests to the test script (essentially all .go programs which
have no syntax errors)
Russ Cox [Sat, 18 Oct 2008 00:51:29 +0000 (17:51 -0700)]
do not set t->recur on basic types.
the comment talked about printing, but now
t->recur is only used for typehash.
in typehash it is important to compute different
hashes for the different basic types.
add test that makes sure an interface { X() int8 }
cannot be used as interface { X() int64 }
Robert Griesemer [Fri, 17 Oct 2008 23:19:31 +0000 (16:19 -0700)]
- fixed a couple of corner cases (empty statements, empty composites)
- more robust printing in presence of errors
- fixed incorrect printing of function literals
Robert Griesemer [Fri, 17 Oct 2008 06:30:42 +0000 (23:30 -0700)]
- stronger syntax checks
- fixed a bug with non-eof terminated //-style comments
- collecting comments
- first experiments with reproducing comments
(works but not very pretty, disabled for now)
- idempotent for all correct .go files we have checked in
Robert Griesemer [Thu, 16 Oct 2008 21:25:23 +0000 (14:25 -0700)]
snapshot:
- typeguards, var decls, several printing bug fixed
- now fully idempotent on many files (which are accepted by 6g afterwards)
- still some detail issues
Robert Griesemer [Thu, 16 Oct 2008 00:06:28 +0000 (17:06 -0700)]
snapshot of pretty printer:
- almost there, receivers, labels, composites, comments are not yet printed
- runs through 18KLOC of Go code and prints it again
Robert Griesemer [Wed, 15 Oct 2008 01:14:01 +0000 (18:14 -0700)]
- snapshot of pretty printer work
- accepts all Go code (use -s flag)
- complete rewrite of AST, AST building, and printing
(as a result much more compact)
- printing severely screwed up at the moment, but should be
fully working in 1 more day
Robert Griesemer [Fri, 10 Oct 2008 23:03:32 +0000 (16:03 -0700)]
- 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
Robert Griesemer [Fri, 10 Oct 2008 19:45:44 +0000 (12:45 -0700)]
- Fixed bug in spec: PrimaryExpr is too restrictive in most places
(for instance *p was not allowed on the left side of "="). Changed
to Expression everywhere (this is too liberal, UnaryExpr is probably
good enough, but it seems funny, and we need to check semantically
anyway). This matches 6g yacc.
- Write expression syntac recursively to express evaluation order
and precedence syntactically.
- Organized open issues list, folded in stuff from todo.txt which
is now obsolete.
Robert Griesemer [Fri, 10 Oct 2008 00:12:09 +0000 (17:12 -0700)]
More spec progress:
- language for selectors and array/map indices
- formal description of syntax notation used
- factor out common productions to better show
symmetries in grammar
Robert Griesemer [Thu, 9 Oct 2008 00:05:30 +0000 (17:05 -0700)]
- make optional semicolons explicit in grammar in all places
except in statement list, where it is expressed in words
- allow for empty import, const, type, and var decl lists inside ()'s
- fixed grammar for inc/dec statements
- added empty statement as it appears to be accepted by 6g