summaryrefslogtreecommitdiff
path: root/test/syntax
Commit message (Collapse)AuthorAgeFilesLines
* test: match gccgo error messagesIan Lance Taylor2013-12-124-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | const1.go:33: error: integer constant overflow <similar errors omitted> const1.go:64: error: division by zero const1.go:67: error: floating point constant overflow const1.go:68: error: floating point constant overflow const1.go:69: error: floating point constant overflow const1.go:70: error: division by zero const1.go:71: error: expected integer type const1.go:77: error: argument 1 has incompatible type (cannot use type int8 as type int) const1.go:78: error: argument 1 has incompatible type (cannot use type int8 as type int) const1.go:79: error: argument 1 has incompatible type (cannot use type uint8 as type int) const1.go:81: error: argument 1 has incompatible type (cannot use type float32 as type int) const1.go:82: error: argument 1 has incompatible type (cannot use type float64 as type int) const1.go:83: error: floating point constant truncated to integer const1.go:85: error: argument 1 has incompatible type (cannot use type float64 as type int) const1.go:86: error: argument 1 has incompatible type (cannot use type string as type int) const1.go:87: error: argument 1 has incompatible type (cannot use type bool as type int) const1.go:90: error: const initializer cannot be nil const1.go:91: error: expression is not constant const1.go:92: error: expression is not constant const1.go:93: error: invalid constant type const1.go:94: error: invalid constant type fixedbugs/bug462.go:17: error: unknown field 'os.File' in 'T' fixedbugs/issue3705.go:9: error: cannot declare init - must be func fixedbugs/issue4251.go:12: error: inverted slice range fixedbugs/issue4251.go:16: error: inverted slice range fixedbugs/issue4251.go:20: error: inverted slice range fixedbugs/issue4405.go:11: error: invalid character 0x7 in identifier fixedbugs/issue4405.go:12: error: invalid character 0x8 in identifier fixedbugs/issue4405.go:13: error: invalid character 0xb in identifier fixedbugs/issue4405.go:14: error: invalid character 0xc in identifier fixedbugs/issue4429.go:15: error: expected pointer fixedbugs/issue4517d.go:9: error: cannot import package as init fixedbugs/issue4545.go:17: error: invalid context-determined non-integer type for left operand of shift fixedbugs/issue4545.go:16: error: incompatible types in binary expression fixedbugs/issue4610.go:15: error: expected ';' or '}' or newline fixedbugs/issue4610.go:16: error: expected declaration fixedbugs/issue4654.go:15: error: value computed is not used <similar errors omitted> fixedbugs/issue4776.go:9: error: program must start with package clause fixedbugs/issue4776.go:9: error: expected ';' or newline after package clause fixedbugs/issue4813.go:31: error: index must be integer <similar errors omitted> fixedbugs/issue4847.go:22: error: initialization expression for 'matchAny' depends upon itself fixedbugs/issue5089.go:13: error: redefinition of 'bufio.Buffered': receiver name changed fixedbugs/issue5089.go:11: note: previous definition of 'bufio.Buffered' was here fixedbugs/issue5172.go:17: error: reference to undefined field or method 'bar' fixedbugs/issue5172.go:18: error: reference to undefined field or method 'bar' fixedbugs/issue5172.go:12: error: use of undefined type 'bar' fixedbugs/issue5358.go:16: error: argument 2 has incompatible type fixedbugs/issue5581.go:29: error: use of undefined type 'Blah' funcdup.go:10: error: redefinition of 'i' funcdup.go:10: note: previous definition of 'i' was here <similar errors omitted> funcdup2.go:10: error: redefinition of 'i' funcdup2.go:10: note: previous definition of 'i' was here <similar errors omitted> slice3err.go:20: error: middle index required in 3-index slice <similar errors omitted> slice3err.go:20: error: final index required in 3-index slice <similar errors omitted> slice3err.go:21: error: final index required in 3-index slice slice3err.go:46: error: invalid 3-index slice of string <similar errors omitted> slice3err.go:57: error: inverted slice range <similar errors omitted> slice3err.go:62: error: invalid slice index: capacity less than length slice3err.go:64: error: invalid slice index: capacity less than start slice3err.go:65: error: invalid slice index: capacity less than start slice3err.go:66: error: invalid slice index: capacity less than start slice3err.go:68: error: invalid slice index: capacity less than length slice3err.go:70: error: invalid slice index: capacity less than start slice3err.go:80: error: invalid slice index: capacity less than length slice3err.go:82: error: invalid slice index: capacity less than start slice3err.go:83: error: invalid slice index: capacity less than start slice3err.go:84: error: invalid slice index: capacity less than start slice3err.go:86: error: invalid slice index: capacity less than length slice3err.go:88: error: invalid slice index: capacity less than start slice3err.go:99: error: array index out of bounds <similar errors omitted> slice3err.go:106: error: invalid slice index: capacity less than length slice3err.go:107: error: invalid slice index: capacity less than start slice3err.go:118: error: invalid slice index: capacity less than length slice3err.go:119: error: invalid slice index: capacity less than start syntax/semi1.go:10: error: missing '{' after if clause syntax/semi1.go:10: error: reference to undefined name 'x' syntax/semi1.go:10: error: reference to undefined name 'y' syntax/semi1.go:12: error: reference to undefined name 'z' syntax/semi2.go:10: error: missing '{' after switch clause syntax/semi2.go:10: error: reference to undefined name 'x' syntax/semi3.go:10: error: missing '{' after for clause syntax/semi3.go:10: error: reference to undefined name 'x' syntax/semi3.go:10: error: reference to undefined name 'y' syntax/semi3.go:10: error: reference to undefined name 'z' syntax/semi3.go:12: error: reference to undefined name 'z' syntax/semi4.go:11: error: missing '{' after for clause syntax/semi4.go:10: error: reference to undefined name 'x' syntax/semi4.go:12: error: reference to undefined name 'z' typecheck.go:12: error: reference to undefined name 'b' typecheck.go:17: error: reference to undefined name 'c' typecheck.go:11: error: use of undefined type 'b' typecheck.go:16: error: not enough arguments typecheck.go:17: error: not enough arguments R=golang-dev, rsc CC=golang-dev https://codereview.appspot.com/41520044
* test: fix build (update for new error message)Russ Cox2013-09-061-2/+2
| | | | | | R=golang-dev CC=golang-dev https://codereview.appspot.com/13521044
* test: fix buildRob Pike2013-08-194-4/+4
| | | | | | | | | | | | | syntax/*: update messages sliceerr3.go: bizarre new error fixed by deleting a space. I could have sworn I ran all.bash before submitting the CL that triggered these. TBR=golang-dev@googlegroups.com R=golang-dev CC=golang-dev https://codereview.appspot.com/12812044
* gc: improve error message for composite literals with unexpected newlinesRyan Hitchman2012-04-021-0/+11
| | | | | | | | R=golang-dev, r, rsc CC=golang-dev http://codereview.appspot.com/5857045 Committer: Russ Cox <rsc@golang.org>
* test: use testlib (final 61)Russ Cox2012-02-1618-18/+18
| | | | | | | | | | | X ,s;^// \$G (\$D/)?\$F\.go *$;// compile;g X ,s;^// \$G (\$D/)?\$F\.go && \$L \$F\.\$A *$;// build;g X ,s;^// \$G (\$D/)?\$F\.go && \$L \$F\.\$A && \./\$A\.out *$;// run;g X ,s;^// errchk \$G( -e)? (\$D/)?\$F\.go *$;// errorcheck;g R=golang-dev, bradfitz CC=golang-dev http://codereview.appspot.com/5671080
* test: match gccgo error messagesIan Lance Taylor2012-01-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | complit1.go:37:34: error: may only omit types within composite literals of slice, array, or map type complit1.go:38:19: error: may only omit types within composite literals of slice, array, or map type complit1.go:18:21: error: slice of unaddressable value complit1.go:19:10: error: slice of unaddressable value complit1.go:20:9: error: slice of unaddressable value convert1.go:28:13: error: invalid type conversion convert1.go:32:12: error: invalid type conversion (cannot use type string as type Tint64) convert1.go:36:12: error: invalid type conversion convert1.go:37:13: error: invalid type conversion convert1.go:40:11: error: invalid type conversion convert1.go:41:12: error: invalid type conversion convert1.go:44:12: error: invalid type conversion convert1.go:46:13: error: invalid type conversion convert1.go:48:11: error: invalid type conversion convert1.go:50:12: error: invalid type conversion convert1.go:52:6: error: invalid type conversion convert1.go:53:12: error: invalid type conversion convert1.go:54:12: error: invalid type conversion convert1.go:56:13: error: invalid type conversion convert1.go:57:11: error: invalid type conversion convert1.go:58:11: error: invalid type conversion convert1.go:64:13: error: invalid type conversion convert1.go:68:12: error: invalid type conversion (cannot use type Tstring as type Tint64) convert1.go:72:12: error: invalid type conversion convert1.go:73:13: error: invalid type conversion convert1.go:76:11: error: invalid type conversion (cannot use type Tbyte as type Trune) convert1.go:77:12: error: invalid type conversion (cannot use type Tbyte as type Tint64) convert1.go:80:12: error: invalid type conversion convert1.go:82:13: error: invalid type conversion convert1.go:84:11: error: invalid type conversion (cannot use type Trune as type Tbyte) convert1.go:86:12: error: invalid type conversion (cannot use type Trune as type Tint64) convert1.go:88:6: error: invalid type conversion (cannot use type Tint64 as type string) convert1.go:89:12: error: invalid type conversion convert1.go:90:12: error: invalid type conversion convert1.go:92:13: error: invalid type conversion (cannot use type Tint64 as type Tstring) convert1.go:93:11: error: invalid type conversion (cannot use type Tint64 as type Tbyte) convert1.go:94:11: error: invalid type conversion (cannot use type Tint64 as type Trune) fixedbugs/bug195.go:9:21: error: interface contains embedded non-interface fixedbugs/bug195.go:12:21: error: interface contains embedded non-interface fixedbugs/bug195.go:15:15: error: interface contains embedded non-interface fixedbugs/bug195.go:18:2: error: invalid recursive interface fixedbugs/bug195.go:26:2: error: invalid recursive interface fixedbugs/bug195.go:22:2: error: invalid recursive interface fixedbugs/bug251.go:15:2: error: invalid recursive interface fixedbugs/bug251.go:11:2: error: invalid recursive interface fixedbugs/bug374.go:18:34: error: use of undefined type ?xxxx? fixedbugs/bug374.go:16:5: error: incompatible type in initialization (incompatible type for method ?m? (different number of parameters)) fixedbugs/bug383.go:11:2: error: expected boolean expression fixedbugs/bug383.go:12:2: error: expected boolean expression fixedbugs/bug386.go:10:25: error: incompatible type for return value 1 (type has no methods) fixedbugs/bug386.go:12:25: error: incompatible type for return value 1 (type has no methods) fixedbugs/bug388.go:12:10: error: invalid named/anonymous mix fixedbugs/bug388.go:17:19: error: non-name on left side of ?:=? fixedbugs/bug388.go:22:9: error: non-name on left side of ?:=? fixedbugs/bug388.go:27:10: error: expected type fixedbugs/bug388.go:32:9: error: expected type fixedbugs/bug388.go:23:14: error: reference to field ?i? in object which has no fields or methods fixedbugs/bug388.go:18:18: error: invalid use of type fixedbugs/bug389.go:12:5: error: incompatible type in initialization (different parameter types) fixedbugs/bug390.go:15:24: error: expected integer, floating, or complex type fixedbugs/bug394.go:10:1: error: expected declaration fixedbugs/bug397.go:12:2: error: incompatible type for element 2 key in map construction switch3.go:18:2: error: incompatible types in binary expression switch3.go:22:2: error: incompatible types in binary expression switch3.go:28:2: error: map can only be compared to nil switch3.go:35:2: error: slice can only be compared to nil switch3.go:42:2: error: func can only be compared to nil syntax/else.go:11:9: error: expected ?if? or ?{? typeswitch2.go:15:2: error: duplicate type in switch typeswitch2.go:19:2: error: duplicate type in switch typeswitch2.go:26:2: error: duplicate type in switch typeswitch2.go:40:9: error: ?t? declared and not used R=golang-dev, r CC=golang-dev http://codereview.appspot.com/5573073
* gc: clean up if grammarRuss Cox2011-09-121-0/+12
| | | | | | | | Fixes issue 2248. R=ken2 CC=golang-dev http://codereview.appspot.com/4978064
* test: avoid undefined error in syntax/if.go.Ian Lance Taylor2011-03-291-0/+3
| | | | | | | | | Without this the gccgo version of errchk reports an unmatched error. R=golang-dev, rsc1 CC=golang-dev http://codereview.appspot.com/4327041
* test: match gccgo error messages for syntax/chan.go.Ian Lance Taylor2011-03-291-2/+2
| | | | | | | | | | chan.go:11:1: error: unexpected ?}? in channel type chan.go:13:16: error: unexpected ?)? in channel type chan.go:16:16: error: unexpected comma in channel type R=golang-dev, rsc1 CC=golang-dev http://codereview.appspot.com/4313055
* gc: require if conditionRuss Cox2011-02-221-0/+15
| | | | | | R=ken2, r2 CC=golang-dev http://codereview.appspot.com/4195045
* gc: handle invalid name in type switchRuss Cox2011-02-011-0/+13
| | | | | | | | Fixes issue 1453. R=ken2 CC=golang-dev http://codereview.appspot.com/4125043
* gc: remove non-blocking send, receive syntaxRuss Cox2011-01-311-0/+17
| | | | | | R=ken2 CC=golang-dev http://codereview.appspot.com/4126043
* gc: syntax error for incomplete chan typeRyan Hitchman2010-12-091-0/+17
| | | | | | | | | | Fixes issue 932. R=rsc CC=golang-dev http://codereview.appspot.com/3515041 Committer: Russ Cox <rsc@golang.org>
* test: Match gccgo error messages.Ian Lance Taylor2010-09-102-2/+2
| | | | | | | | | | vareq.go:10:25: error: expected ';' or '}' or newline vareq1.go:9:24: error: expected ';' or newline after top level declaration R=rsc CC=golang-dev http://codereview.appspot.com/2132045
* test: Match gccgo error messages.Ian Lance Taylor2010-09-091-3/+3
| | | | | | | | | | | | | | | With the recursive descent parser that gccgo uses, I think that it doesn't make sense to try to match a statement where a statement is not expected. If the construct is not a statement, you will just get bizarre error messages. topexpr.go:9:1: error: expected declaration topexpr.go:14:1: error: expected declaration topexpr.go:19:1: error: expected declaration R=rsc, r2 CC=golang-dev http://codereview.appspot.com/2175041
* test: remove slice syntax testScott Lawrence2010-09-091-9/+0
| | | | | | | | R=rsc CC=golang-dev http://codereview.appspot.com/2145043 Committer: Russ Cox <rsc@golang.org>
* gc: more accurate error descriptionRuss Cox2010-05-242-2/+2
| | | | | | R=ken2 CC=golang-dev http://codereview.appspot.com/1284041
* gc: more specific error for statements at top levelRuss Cox2010-04-261-0/+20
| | | | | | R=ken2, r, ken3 CC=golang-dev http://codereview.appspot.com/1006041
* gc: more syntax errorsRuss Cox2010-03-252-0/+20
| | | | | | R=r CC=golang-dev http://codereview.appspot.com/731041
* Match gccgo error messages.Ian Lance Taylor2010-02-047-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bug121.go:12:3: error: name list not allowed in interface type bug121.go:16:2: error: expected signature or type name semi1.go:10:76: error: unexpected semicolon or newline before ?{? semi1.go:10:5: error: reference to undefined name ?x? semi1.go:10:8: error: reference to undefined name ?y? semi1.go:12:3: error: reference to undefined name ?z? semi2.go:10:79: error: unexpected semicolon or newline before ?{? semi2.go:10:9: error: reference to undefined name ?x? semi3.go:10:79: error: unexpected semicolon or newline before ?{? semi3.go:10:6: error: reference to undefined name ?x? semi3.go:10:9: error: reference to undefined name ?y? semi3.go:10:12: error: reference to undefined name ?z? semi3.go:12:3: error: reference to undefined name ?z? semi4.go:11:2: error: unexpected semicolon or newline before ?{? semi4.go:10:6: error: reference to undefined name ?x? semi4.go:12:3: error: reference to undefined name ?z? semi5.go:10:1: error: unexpected semicolon or newline before ?{? semi7.go:11:2: error: unexpected semicolon or newline before ?else? semi7.go:10:5: error: reference to undefined name ?x? slice.go:9:11: error: missing lower bound in slice expression slice.go:9:9: error: reference to undefined name ?y? slice.go:9:12: error: reference to undefined name ?z? R=rsc CC=golang-dev http://codereview.appspot.com/201061
* gc: tweak error messages, avoid internalization settings in bisonRuss Cox2010-01-288-8/+8
| | | | | | R=r CC=golang-dev http://codereview.appspot.com/194129
* gc: improved syntax errorsRuss Cox2010-01-2611-0/+143
* example-based syntax errors (go.errors) * enable bison's more specific errors and translate grammar token names into tokens like ++ * test cases R=ken2, r, ken3 CC=golang-dev http://codereview.appspot.com/194085