Skip to content

Commit

Permalink
Fixed Issue #1
Browse files Browse the repository at this point in the history
  • Loading branch information
astrochili committed Feb 3, 2021
1 parent eb1548d commit a4dde19
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion narrator/parser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ end

function Constructor:addConstant(constant, value)
local value = lume.deserialize(value)
self.book.constants[constant] = lume.deserialize(value)
self.book.constants[constant] = value
end

function Constructor:addKnot(knot)
Expand Down
7 changes: 6 additions & 1 deletion test/units/constants.ink
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
CONST STRING_EXAMPLE = "This is the string constant"
CONST BOOLEAN_EXAMLPE_TRUE = true
CONST BOOLEAN_EXAMLPE_FALSE = false

CONST LOBBY = 1
CONST STAIRCASE = 2
CONST HALLWAY = 3

CONST HELD_BY_AGENT = -1

VAR secret_agent_location = LOBBY
VAR suitcase_location = HALLWAY

{ STRING_EXAMPLE }. One is { BOOLEAN_EXAMLPE_TRUE }. Zero is { BOOLEAN_EXAMLPE_FALSE }.

-> report_progress

=== report_progress ===
Expand Down
1 change: 1 addition & 0 deletions test/units/constants.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
This is the string constant. One is 1. Zero is 0.
The secret agent moves forward.
The secret agent moves forward.
The secret agent grabs the suitcase!

0 comments on commit a4dde19

Please sign in to comment.