diff --git a/narrator/parser.lua b/narrator/parser.lua index 6247983..6245976 100644 --- a/narrator/parser.lua +++ b/narrator/parser.lua @@ -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) diff --git a/test/units/constants.ink b/test/units/constants.ink index 60e6db4..ceea880 100644 --- a/test/units/constants.ink +++ b/test/units/constants.ink @@ -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 === diff --git a/test/units/constants.txt b/test/units/constants.txt index 6d434f6..84277c0 100644 --- a/test/units/constants.txt +++ b/test/units/constants.txt @@ -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! \ No newline at end of file