parse_expression.py 594 B

123456789101112131415161718192021
  1. # This file is a minimal parser for simple expressions
  2. # It's used for e.g. Overlay variables
  3. # Also used to figure out the initial value of a driver for e.g. Curve Pin Node
  4. # For now I will only support basic operations.
  5. # Once I get this working it will be easy to expand
  6. tokens = {
  7. "+" : "ADD",
  8. "-" : 'SUBTRACT',
  9. "/" : 'DIVIDE',
  10. "*" : 'MULTIPLY',
  11. }
  12. #I'm too tired to work on this but I need to do it later so... I'll save the file.
  13. def parse_expression(expression):
  14. numbers = []
  15. current_number = ""
  16. # for i range len(expression):
  17. # if
  18. pass