Browse Source

add errorcode names

master
Brett Langdon 10 years ago
parent
commit
f8ea67a844
2 changed files with 26 additions and 1 deletions
  1. +4
    -1
      errorcode/errorcode.go
  2. +22
    -0
      errorcode/names.go

+ 4
- 1
errorcode/errorcode.go View File

@ -2,6 +2,10 @@ package errorcode
type ErrorCode int
func (code ErrorCode) String() string {
return ErrorNames[code]
}
const (
E_OK ErrorCode = 10 /* No error */
E_EOF ErrorCode = 11 /* End Of File */
@ -21,5 +25,4 @@ const (
E_LINECONT ErrorCode = 25 /* Unexpected characters after a line continuation */
E_IDENTIFIER ErrorCode = 26 /* Invalid characters in identifier */
E_BADSINGLE ErrorCode = 27 /* Ill-formed single statement input */
)

+ 22
- 0
errorcode/names.go View File

@ -0,0 +1,22 @@
package errorcode
var ErrorNames = [...]string{
E_OK: "E_OK",
E_EOF: "E_EOF",
E_INTR: "E_INTR",
E_TOKEN: "E_TOKEN",
E_SYNTAX: "E_SYNTAX",
E_NOMEM: "E_NOMEM",
E_DONE: "E_DONE",
E_ERROR: "E_ERROR",
E_TABSPACE: "E_TABSPACE",
E_OVERFLOW: "E_OVERFLOW",
E_TOODEEP: "E_TOODEEP",
E_DEDENT: "E_DEDENT",
E_DECODE: "E_DECODE",
E_EOFS: "E_EOFS",
E_EOLS: "E_EOLS",
E_LINECONT: "E_LINECONT",
E_IDENTIFIER: "E_IDENTIFIER",
E_BADSINGLE: "E_BADSINGLE",
}

Loading…
Cancel
Save