package parsers import ( // "fmt" engine "github.com/tgckpg/mmqlengine/mmql/engine" stmtd "github.com/tgckpg/mmqlengine/mmql/statements" ) /* EXPECT: [Number] [Units] OR EXPECT: [FUNCTION]( ...params ) */ func AmountStatement( lexer *engine.Lexer ) ( istmt stmtd.IStatement, err error ) { stmt := stmtd.AmountStatement{} val, err := lexer.ReadDecimal() if err != nil { return } stmt.SetValue( val ) unit, err := lexer.ReadAlpha() if err != nil { return } stmt.SetUnit( unit ) istmt = stmt return }