Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def operand modify
- # line is an array of strings
- v = line.index { |l| l['V'] }
- line[v] = line[v].sub(/-?\d+/) { |o| modify[o.to_i] } rescue nil
- end
- # elsewhere
- operand -> o { o.send OPS[$1], arg }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement