assign.lox 626 B

123456789101112131415161718192021
  1. // == code STARTING ==
  2. // 0000 1 OP_CONSTANT 1 'beignets'
  3. // 0002 | OP_DEFINE_GLOBAL 0 'breakfast'
  4. // 0004 2 OP_CONSTANT 3 'cafe au lait'
  5. // 0006 | OP_DEFINE_GLOBAL 2 'beverage'
  6. // 0008 3 OP_CONSTANT 5 'beignets with '
  7. // 0010 | OP_GET_GLOBAL 6 'beverage'
  8. // 0012 | OP_ADD
  9. // 0013 | OP_SET_GLOBAL 4 'breakfast'
  10. // 0015 | OP_POP
  11. // 0016 5 OP_GET_GLOBAL 7 'breakfast'
  12. // 0018 | OP_PRINT
  13. // 0019 | OP_RETURN
  14. // == code END ==
  15. var breakfast = "beignets";
  16. var beverage = "cafe au lait";
  17. breakfast = "beignets with " + beverage;
  18. print breakfast;