-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #91 from tsingbx/gogensig/symbol_not_found
ignore symbol not found error
- Loading branch information
Showing
9 changed files
with
101 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package dbg | ||
|
||
type dbgFlags = int | ||
|
||
var flags dbgFlags | ||
|
||
const ( | ||
DbgSymbolNotFound dbgFlags = 1 << iota | ||
DbgError // print when error ocur | ||
DbgLog // print log info | ||
DbgFlagAll = 0 | DbgError | DbgLog | ||
) | ||
|
||
func SetDebugSymbolNotFound() { | ||
flags |= DbgSymbolNotFound | ||
} | ||
|
||
func GetDebugSymbolNotFound() bool { | ||
return flags&DbgSymbolNotFound != 0 | ||
} | ||
|
||
func SetDebugError() { | ||
flags |= DbgError | ||
} | ||
|
||
func GetDebugError() bool { | ||
return flags&DbgError != 0 | ||
} | ||
|
||
func SetDebugLog() { | ||
flags |= DbgLog | ||
} | ||
|
||
func GetDebugLog() bool { | ||
return flags&DbgLog != 0 | ||
} | ||
|
||
func SetDebugAll() { | ||
flags = DbgFlagAll | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package errs | ||
|
||
import ( | ||
"fmt" | ||
) | ||
|
||
type SymbolNotFoudError struct { | ||
name string | ||
} | ||
|
||
func (p *SymbolNotFoudError) Error() string { | ||
return fmt.Sprintf("%s symbol not found", p.name) | ||
} | ||
|
||
func NewSymbolNotFoudError(name string) *SymbolNotFoudError { | ||
return &SymbolNotFoudError{name: name} | ||
} | ||
|
||
type SymbolTableNotInitializedError struct { | ||
} | ||
|
||
func (p *SymbolTableNotInitializedError) Error() string { | ||
return "symbol table not initialized" | ||
} | ||
|
||
func NewSymbolTableNotInitializedError() *SymbolTableNotInitializedError { | ||
return &SymbolTableNotInitializedError{} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters