core/asm: accept uppercase instructions.

This commit is contained in:
dm4 2018-04-19 15:09:11 +08:00
parent 52b046c9b6
commit 5113fd6619
No known key found for this signature in database
GPG key ID: 284633CF9C3DCF17

View file

@ -236,12 +236,12 @@ func (c *Compiler) pushBin(v interface{}) {
// isPush returns whether the string op is either any of
// push(N).
func isPush(op string) bool {
return op == "push"
return strings.ToUpper(op) == "PUSH"
}
// isJump returns whether the string op is jump(i)
func isJump(op string) bool {
return op == "jumpi" || op == "jump"
return strings.ToUpper(op) == "JUMPI" || strings.ToUpper(op) == "JUMP"
}
// toBinary converts text to a vm.OpCode