Improved documentation
This commit is contained in:
@ -1,27 +1,5 @@
|
||||
package errors
|
||||
|
||||
var (
|
||||
EmptySwitch = &Base{"Empty switch"}
|
||||
ExpectedFunctionName = &Base{"Expected function name"}
|
||||
ExpectedFunctionParameters = &Base{"Expected function parameters"}
|
||||
ExpectedFunctionDefinition = &Base{"Expected function definition"}
|
||||
ExpectedIfBeforeElse = &Base{"Expected an 'if' block before 'else'"}
|
||||
InvalidNumber = &Base{"Invalid number"}
|
||||
InvalidExpression = &Base{"Invalid expression"}
|
||||
InvalidRune = &Base{"Invalid rune"}
|
||||
InvalidStatement = &Base{"Invalid statement"}
|
||||
MissingBlockStart = &Base{"Missing '{'"}
|
||||
MissingBlockEnd = &Base{"Missing '}'"}
|
||||
MissingExpression = &Base{"Missing expression"}
|
||||
MissingGroupStart = &Base{"Missing '('"}
|
||||
MissingGroupEnd = &Base{"Missing ')'"}
|
||||
MissingMainFunction = &Base{"Missing main function"}
|
||||
MissingOperand = &Base{"Missing operand"}
|
||||
MissingType = &Base{"Missing type"}
|
||||
NotImplemented = &Base{"Not implemented"}
|
||||
UnknownType = &Base{"Unknown type"}
|
||||
)
|
||||
|
||||
// Base is the base class for errors that have no parameters.
|
||||
type Base struct {
|
||||
Message string
|
||||
|
23
src/errors/Common.go
Normal file
23
src/errors/Common.go
Normal file
@ -0,0 +1,23 @@
|
||||
package errors
|
||||
|
||||
var (
|
||||
EmptySwitch = &Base{"Empty switch"}
|
||||
ExpectedFunctionName = &Base{"Expected function name"}
|
||||
ExpectedFunctionParameters = &Base{"Expected function parameters"}
|
||||
ExpectedFunctionDefinition = &Base{"Expected function definition"}
|
||||
ExpectedIfBeforeElse = &Base{"Expected an 'if' block before 'else'"}
|
||||
InvalidNumber = &Base{"Invalid number"}
|
||||
InvalidExpression = &Base{"Invalid expression"}
|
||||
InvalidRune = &Base{"Invalid rune"}
|
||||
InvalidStatement = &Base{"Invalid statement"}
|
||||
MissingBlockStart = &Base{"Missing '{'"}
|
||||
MissingBlockEnd = &Base{"Missing '}'"}
|
||||
MissingExpression = &Base{"Missing expression"}
|
||||
MissingGroupStart = &Base{"Missing '('"}
|
||||
MissingGroupEnd = &Base{"Missing ')'"}
|
||||
MissingMainFunction = &Base{"Missing main function"}
|
||||
MissingOperand = &Base{"Missing operand"}
|
||||
MissingType = &Base{"Missing type"}
|
||||
NotImplemented = &Base{"Not implemented"}
|
||||
UnknownType = &Base{"Unknown type"}
|
||||
)
|
Reference in New Issue
Block a user