mirror of
https://github.com/dragonheim/gagent.git
synced 2025-04-28 13:48:58 -07:00
fix: modified to fix some of the test failures.
This commit is contained in:
parent
bdeaf2ec92
commit
8f77f2258c
7 changed files with 8 additions and 8 deletions
|
@ -25,7 +25,7 @@ type parserStruct struct {
|
|||
}
|
||||
|
||||
// initParser initializes a new parserStruct instance
|
||||
func initParser(text string) *parserStruct {
|
||||
func InitParser(text string) *parserStruct {
|
||||
return &parserStruct{text: text, ln: len(text), Type: ParserTokenEOL}
|
||||
}
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ func TestParser(t *testing.T) {
|
|||
parser := picol.InitParser(tc.input)
|
||||
|
||||
for _, expectedType := range tc.expected {
|
||||
token := parser.GetToken()
|
||||
parser.GetToken()
|
||||
if parser.Type != expectedType {
|
||||
t.Errorf("Expected token type %d, got %d", expectedType, parser.Type)
|
||||
}
|
||||
|
|
|
@ -116,7 +116,7 @@ func (interp *Interpreter) RegisterCommand(name string, fn CommandFunc, privdata
|
|||
* Eval evaluates a script
|
||||
*/
|
||||
func (interp *Interpreter) Eval(script string) (string, error) {
|
||||
parser := initParser(script)
|
||||
parser := InitParser(script)
|
||||
var result string
|
||||
var err error
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue