diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index bb78004e..8280d7b5 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -20,7 +20,7 @@ jobs: destination: - "3.3.4" - "3.4.5" - - "3.5" + - "3.5.2" steps: - name: "(Shared) Check out the repository" @@ -61,29 +61,29 @@ jobs: run: | ./godot -d -s --path "inkgd" "addons/gut/gut_cmdln.gd" - - name: "(Mono) Install Godot" - env: - VERSION: ${{ matrix.destination }} - run: | - wget -q https://downloads.tuxfamily.org/godotengine/${VERSION}/mono/Godot_v${VERSION}-stable_mono_linux_headless_64.zip - unzip Godot_v${VERSION}-stable_mono_linux_headless_64.zip - mv Godot_v${VERSION}-stable_mono_linux_headless_64 godot_mono - mv godot_mono/Godot_v${VERSION}-stable_mono_linux_headless.64 godot_mono/godot_mono - chmod +x godot_mono/godot_mono + # - name: "(Mono) Install Godot" + # env: + # VERSION: ${{ matrix.destination }} + # run: | + # wget -q https://downloads.tuxfamily.org/godotengine/${VERSION}/mono/Godot_v${VERSION}-stable_mono_linux_headless_64.zip + # unzip Godot_v${VERSION}-stable_mono_linux_headless_64.zip + # mv Godot_v${VERSION}-stable_mono_linux_headless_64 godot_mono + # mv godot_mono/Godot_v${VERSION}-stable_mono_linux_headless.64 godot_mono/godot_mono + # chmod +x godot_mono/godot_mono - - name: "(Mono) Install Ink Runtime" - run: | - wget -q https://github.com/inkle/ink/releases/download/v1.0.0/inklecate_windows.zip - unzip inklecate_windows.zip - mv ink-engine-runtime.dll inkgd/addons/inkgd/mono/assemblies/ink-engine-runtime.dll + # - name: "(Mono) Install Ink Runtime" + # run: | + # wget -q https://github.com/inkle/ink/releases/download/v1.0.0/inklecate_windows.zip + # unzip inklecate_windows.zip + # mv ink-engine-runtime.dll inkgd/addons/inkgd/mono/assemblies/ink-engine-runtime.dll - - name: "(Mono) Compile C# solution" - run: | - ./godot_mono/godot_mono --quit --path "inkgd" - cd inkgd - msbuild inkgd.sln /restore /t:Build /p:Configuration=Debug - cd .. + # - name: "(Mono) Compile C# solution" + # run: | + # ./godot_mono/godot_mono --quit --path "inkgd" + # cd inkgd + # msbuild inkgd.sln /restore /t:Build /p:Configuration=Debug + # cd .. - - name: "(Mono) Run tests (Mono)" - run: | - ./godot_mono/godot_mono -d -s --path "inkgd" "addons/gut/gut_cmdln.gd" + # - name: "(Mono) Run tests (Mono)" + # run: | + # ./godot_mono/godot_mono -d -s --path "inkgd" "addons/gut/gut_cmdln.gd" diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c9881f1..57d7810e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,19 @@ # Change Log Important changes to _inkgd_ will be documented in this file. -## [0.4.7](https://github.com/ephread/inkgd/releases/tag/0.4.X) +## [0.5.0](https://github.com/ephread/inkgd/releases/tag/0.5.0) +Released on 2023-01-XX. + +### Changed +- Added support for inklecate 1.1.1. +- Exposed new properties on InkPlayer (`alive_flow_names` & `current_flow_is_default_flow`). + +#### ⚠️ BREAKING CHANGE** +- [`InkPlayer`] The `prompt_choices` and `choice_made` signals as well as the `current_choices` + property now use instances of `InkChoice` instead of strings. Use the `text` property of `InkChoice` + to access the text representation. + +## [0.4.7](https://github.com/ephread/inkgd/releases/tag/0.4.7) Released on 2022-08-07. ### Fixed diff --git a/addons/inkgd/editor/panel/preview/ink_preview_panel.gd b/addons/inkgd/editor/panel/preview/ink_preview_panel.gd index 476800dc..60cac2ff 100644 --- a/addons/inkgd/editor/panel/preview/ink_preview_panel.gd +++ b/addons/inkgd/editor/panel/preview/ink_preview_panel.gd @@ -301,7 +301,7 @@ func _continue_story(): var i = 0 for choice in _ink_player.current_choices: var button = Button.new() - button.text = choice + button.text = choice.text button.connect("pressed", self, "_choice_button_pressed", [i]) _choices_container.add_child(button) diff --git a/addons/inkgd/editor/templates/ink_template.gd b/addons/inkgd/editor/templates/ink_template.gd index a2877c50..d4698800 100644 --- a/addons/inkgd/editor/templates/ink_template.gd +++ b/addons/inkgd/editor/templates/ink_template.gd @@ -66,7 +66,8 @@ func _continue_story(): %TS%if _ink_player.has_choices: %TS%%TS%# 'current_choices' contains a list of the choices, as strings. %TS%%TS%for choice in _ink_player.current_choices: -%TS%%TS%%TS%print(choice) +%TS%%TS%%TS%print(choice.text) +%TS%%TS%%TS%print(choice.tags) %TS%%TS%# '_select_choice' is a function that will take the index of %TS%%TS%# your selection and continue the story. %TS%%TS%_select_choice(0) diff --git a/addons/inkgd/ink_player.gd b/addons/inkgd/ink_player.gd index dd00eebc..be750772 100644 --- a/addons/inkgd/ink_player.gd +++ b/addons/inkgd/ink_player.gd @@ -207,11 +207,7 @@ func get_current_choices() -> Array: _push_null_story_error() return [] - var text_choices = [] - for choice in _story.current_choices: - text_choices.append(choice.text) - - return text_choices + return _story.current_choices.duplicate() ## The current tags. Empty is there are no tags for the current line. @@ -256,6 +252,26 @@ func get_current_flow_name() -> String: return _story.state.current_flow_name +## The names of all flows currently alive. +var alive_flow_names: Array setget , get_alive_flow_names +func get_alive_flow_names() -> Array: + if _story == null: + _push_null_story_error() + return [] + + return _story.alive_flow_names + + +## `true` if the current flow is the default flow. +var current_flow_is_default_flow: bool setget , get_current_flow_is_default_flow +func get_current_flow_is_default_flow() -> bool: + if _story == null: + _push_null_story_error() + return false + + return _story.current_flow_is_default_flow + + ## The current story path. var current_path: String setget , get_current_path func get_current_path() -> String: diff --git a/addons/inkgd/mono/InkPlayer.cs b/addons/inkgd/mono/InkPlayer.cs index ace49e31..b76be5be 100644 --- a/addons/inkgd/mono/InkPlayer.cs +++ b/addons/inkgd/mono/InkPlayer.cs @@ -21,8 +21,8 @@ public class InkPlayer : Node [Signal] public delegate void loaded(bool successfully); [Signal] public delegate void continued(string text, Godot.Collections.Array<string> tags); [Signal] public delegate void interrupted(); - [Signal] public delegate void prompt_choices(Godot.Collections.Array<string> choices); - [Signal] public delegate void choice_made(string choice); + [Signal] public delegate void prompt_choices(Godot.Collections.Array<Godot.Object> choices); + [Signal] public delegate void choice_made(Godot.Object choice); [Signal] public delegate void function_evaluating(Godot.Collections.Array<string> function_name, object[] arguments); [Signal] public delegate void function_evaluated(Godot.Collections.Array<string> function_name, object[] arguments, Godot.Object function_result); [Signal] public delegate void path_choosen(string path, object[] arguments); @@ -140,10 +140,8 @@ public Godot.Collections.Array<string> current_choices return new Godot.Collections.Array<string>(); } - var choices = story.currentChoices?.ConvertAll(choice => choice.text).ToArray(); - if (choices != null) { - return new Godot.Collections.Array<string>(choices); + return new Godot.Collections.Array<string>(story.currentChoices); } else { return new Godot.Collections.Array<string>(); } @@ -1045,7 +1043,7 @@ private void onDidContinue() private void onMakeChoice(Ink.Runtime.Choice choice) { - EmitSignal("choice_made", new object[] { choice.text }); + EmitSignal("choice_made", new object[] { choice }); } private void onEvaluateFunction(string functionName, object[] arguments) diff --git a/addons/inkgd/runtime/content/choices/choice.gd b/addons/inkgd/runtime/content/choices/choice.gd index d5033bbc..b3b77b9e 100644 --- a/addons/inkgd/runtime/content/choices/choice.gd +++ b/addons/inkgd/runtime/content/choices/choice.gd @@ -44,6 +44,9 @@ var original_thread_index: int = 0 var is_invisible_default: bool = false +# Array<String>? +var tags + # ############################################################################ # # GDScript extra methods # ############################################################################ # diff --git a/addons/inkgd/runtime/content/control_command.gd b/addons/inkgd/runtime/content/control_command.gd index 14d48087..e0619319 100644 --- a/addons/inkgd/runtime/content/control_command.gd +++ b/addons/inkgd/runtime/content/control_command.gd @@ -47,6 +47,8 @@ enum CommandType { LIST_FROM_INT, LIST_RANGE, LIST_RANDOM, + BEGIN_TAG, + END_TAG #---- TOTAL_VALUES } @@ -135,6 +137,12 @@ static func list_range() -> InkControlCommand: static func list_random() -> InkControlCommand: return ControlCommand().new(CommandType.LIST_RANDOM) +static func begin_tag() -> InkControlCommand: + return ControlCommand().new(CommandType.BEGIN_TAG) + +static func end_tag() -> InkControlCommand: + return ControlCommand().new(CommandType.END_TAG) + # () -> String func _to_string() -> String: var command_name: String = "" @@ -164,6 +172,8 @@ func _to_string() -> String: CommandType.LIST_FROM_INT: command_name = "LIST_FROM_INT" CommandType.LIST_RANGE: command_name = "LIST_RANGE" CommandType.LIST_RANDOM: command_name = "LIST_RANDOM" + CommandType.BEGIN_TAG: command_name = "BEGIN_TAG" + CommandType.END_TAG: command_name = "END_TAG" CommandType.TOTAL_VALUES: command_name = "TOTAL_VALUES" return "Command(%s)" % command_name diff --git a/addons/inkgd/runtime/lists/ink_list.gd b/addons/inkgd/runtime/lists/ink_list.gd index d0015afb..a609907c 100644 --- a/addons/inkgd/runtime/lists/ink_list.gd +++ b/addons/inkgd/runtime/lists/ink_list.gd @@ -33,13 +33,18 @@ func _init_from_csharp(items: Dictionary, origin_names: Array, origins: Array): _origin_names = origin_names self.origins = origins + # (InkList) -> InkList func _init_with_ink_list(other_list: InkList): _dictionary = other_list._dictionary.duplicate() - _origin_names = other_list.origin_names + var other_origin_names = other_list.origin_names + if other_origin_names != null: + _origin_names = other_list.origin_names.duplicate() + if other_list.origins != null: self.origins = other_list.origins.duplicate() + # (string, Story) -> InkList func _init_with_origin(single_origin_list_name: String, origin_story): set_initial_origin_name(single_origin_list_name) @@ -53,10 +58,12 @@ func _init_with_origin(single_origin_list_name: String, origin_story): % single_origin_list_name ) + # (InkListItem, int) -> InkList func _init_with_single_item(single_item: InkListItem, single_value: int): set_item(single_item, single_value) + # (string, Story) -> InkList static func from_string(my_list_item: String, origin_story) -> InkList: var list_value: InkListValue = origin_story.list_definitions.find_single_item_list_with_name(my_list_item) @@ -69,6 +76,7 @@ static func from_string(my_list_item: String, origin_story) -> InkList: ) return null + func add_item(item: InkListItem) -> void: if item.origin_name == null: add_item(item.item_name) @@ -93,6 +101,7 @@ func add_item(item: InkListItem) -> void: "be used, so that the int value can be found." ) + func add_item_by_string(item_name: String) -> void: var found_list_def: InkListDefinition = null @@ -118,6 +127,7 @@ func add_item_by_string(item_name: String) -> void: var item_val: int = found_list_def.value_for_item(item) set_item(item, item_val) + func contains_item_named(item_name: String) -> bool: for item_key in keys(): if item_key.item_name == item_name: @@ -125,6 +135,7 @@ func contains_item_named(item_name: String) -> bool: return false + # Array<ListDefinition> var origins = null var origin_of_max_item: InkListDefinition setget , get_origin_of_max_item @@ -139,6 +150,7 @@ func get_origin_of_max_item() -> InkListDefinition: return null + # Array<String> var origin_names setget , get_origin_names func get_origin_names(): @@ -153,11 +165,12 @@ func get_origin_names(): return _origin_names -var _origin_names = null # Array<String> +var _origin_names = null # Array<String> func set_initial_origin_name(initial_origin_name: String) -> void: _origin_names = [ initial_origin_name ] + # (Array<String>) -> void func set_initial_origin_names(initial_origin_names) -> void: if initial_origin_names == null: @@ -165,6 +178,7 @@ func set_initial_origin_names(initial_origin_names) -> void: else: _origin_names = initial_origin_names.duplicate() + # TODO: Make inspectable var max_item: InkKeyValuePair setget , get_max_item # InkKeyValuePair<InkListItem, int> func get_max_item() -> InkKeyValuePair: @@ -175,6 +189,7 @@ func get_max_item() -> InkKeyValuePair: return _max_item + # TODO: Make inspectable var min_item: InkKeyValuePair setget , get_min_item # InkKeyValuePair<InkListItem, int> func get_min_item() -> InkKeyValuePair: @@ -185,6 +200,7 @@ func get_min_item() -> InkKeyValuePair: return _min_item + # TODO: Make inspectable var inverse: InkList setget , get_inverse func get_inverse() -> InkList: @@ -197,6 +213,7 @@ func get_inverse() -> InkList: return list + # TODO: Make inspectable var all: InkList setget , get_all func get_all() -> InkList: @@ -208,6 +225,7 @@ func get_all() -> InkList: return list + # TODO: Make inspectable func union(other_list: InkList) -> InkList: var union: InkList = InkList().new_with_ink_list(self) @@ -215,6 +233,7 @@ func union(other_list: InkList) -> InkList: union._dictionary[key] = other_list._dictionary[key] return union + # TODO: Make inspectable func intersection(other_list: InkList) -> InkList: var intersection: InkList = InkList().new() @@ -223,6 +242,14 @@ func intersection(other_list: InkList) -> InkList: intersection._dictionary[key] = other_list._dictionary[key] return intersection + +func has_intersection(other_list: InkList) -> bool: + for key in other_list._dictionary: + if self._dictionary.has(key): + return true + return false + + # TODO: Make inspectable func without(list_to_remove: InkList) -> InkList: var result = InkList().new_with_ink_list(self) @@ -230,13 +257,29 @@ func without(list_to_remove: InkList) -> InkList: result._dictionary.erase(key) return result + func contains(other_list: InkList) -> bool: + if other_list._dictionary.empty() || self._dictionary.empty(): + return false + for key in other_list._dictionary: if !_dictionary.has(key): return false return true + +# In the original source code 'list_item_name' is of type (String | null), +# but the method doesn't need to allow null names. +func contains_item(list_item_name: String) -> bool: + for key in self._dictionary: + var list_item = InkListItem.from_serialized_key(key) + if list_item.item_name == list_item_name: + return true + + return false + + func greater_than(other_list: InkList) -> bool: if size() == 0: return false @@ -245,6 +288,7 @@ func greater_than(other_list: InkList) -> bool: return self.min_item.value > other_list.max_item.value + func greater_than_or_equals(other_list: InkList) -> bool: if size() == 0: return false @@ -256,6 +300,7 @@ func greater_than_or_equals(other_list: InkList) -> bool: self.max_item.value >= other_list.max_item.value ) + func less_than(other_list: InkList) -> bool: if other_list.size() == 0: return false @@ -264,6 +309,7 @@ func less_than(other_list: InkList) -> bool: return self.max_item.value < other_list.min_item.value + func less_than_or_equals(other_list: InkList) -> bool: if other_list.size() == 0: return false @@ -275,6 +321,7 @@ func less_than_or_equals(other_list: InkList) -> bool: self.min_item.value <= other_list.min_item.value ) + func max_as_list() -> InkList: if size() > 0: var _max_item: InkKeyValuePair = self.max_item @@ -282,6 +329,7 @@ func max_as_list() -> InkList: else: return InkList().new() + func min_as_list() -> InkList: if size() > 0: var _min_item: InkKeyValuePair = self.min_item @@ -289,6 +337,7 @@ func min_as_list() -> InkList: else: return InkList().new() + # (Variant, Variant) -> InkList func list_with_sub_range(min_bound, max_bound) -> InkList: if size() == 0: @@ -320,6 +369,7 @@ func list_with_sub_range(min_bound, max_bound) -> InkList: return sub_list + func equals(other: InkList) -> bool: var other_raw_list: InkList = other # Simple test to make sure the object is of the right type. @@ -337,6 +387,7 @@ func equals(other: InkList) -> bool: return true + var ordered_items: Array setget , get_ordered_items # Array<InkKeyValuePair<InkListItem, int>> func get_ordered_items(): var ordered: Array = [] @@ -346,6 +397,7 @@ func get_ordered_items(): ordered.sort_custom(KeyValueInkListItemSorter, "sort") return ordered + func _to_string() -> String: var ordered: Array = self.ordered_items @@ -361,26 +413,31 @@ func _to_string() -> String: return description + static func new_with_dictionary(other_dictionary: Dictionary) -> InkList: var ink_list: InkList = InkList().new() ink_list._init_with_dictionary(other_dictionary) return ink_list + static func new_with_ink_list(other_list: InkList) -> InkList: var ink_list: InkList = InkList().new() ink_list._init_with_ink_list(other_list) return ink_list + static func new_with_origin(single_origin_list_name: String, origin_story) -> InkList: var ink_list: InkList = InkList().new() ink_list._init_with_origin(single_origin_list_name, origin_story) return ink_list + static func new_with_single_item(single_item: InkListItem, single_value: int) -> InkList: var ink_list: InkList = InkList().new() ink_list._init_with_single_item(single_item, single_value) return ink_list + class KeyValueInkListItemSorter: static func sort(a, b): if a.value == b.value: @@ -388,6 +445,7 @@ class KeyValueInkListItemSorter: else: return a.value <= b.value + # ############################################################################ # # Originally, this class would inherit Dictionary. This isn't possible in # GDScript. Instead, this class will encapsulate a dictionary and forward @@ -396,18 +454,22 @@ class KeyValueInkListItemSorter: var _dictionary: Dictionary = {} + # Name set_item instead of set to prevent shadowing 'Object.set'. func set_item(key: InkListItem, value: int) -> void: _dictionary[key.serialized()] = value + # Name get_item instead of get to prevent shadowing 'Object.get'. func get_item(key: InkListItem, default = null): return _dictionary.get(key.serialized(), default) + # Name has_item instead of has to prevent shadowing 'Object.get'. func has_item(key: InkListItem) -> bool: return _dictionary.has(key.serialized()) + func keys() -> Array: var deserialized_keys = [] for key in _dictionary.keys(): @@ -415,9 +477,11 @@ func keys() -> Array: return deserialized_keys + func size() -> int: return _dictionary.size() + # ############################################################################ # # Additional methods # ############################################################################ # @@ -428,30 +492,36 @@ func set_raw(key: String, value: int) -> void: _dictionary[key] = value + func erase_raw(key: String) -> bool: if OS.is_debug_build() && !(key is String): print("Warning: Expected serialized key in InkList.erase_raw().") return _dictionary.erase(key) + func get_raw(key: String, default = null): if OS.is_debug_build() && !(key is String): print("Warning: Expected serialized key in InkList.get_raw().") return _dictionary.get(key, default) + func has_raw(key: String) -> bool: if OS.is_debug_build() && !(key is String): print("Warning: Expected serialized key in InkList.has_raw().") return _dictionary.has(key) + func has_all_raw(keys: Array) -> bool: return _dictionary.has_all(keys) + func raw_keys() -> Array: return _dictionary.keys() + # ############################################################################ # # GDScript extra methods # ############################################################################ # @@ -459,5 +529,7 @@ func raw_keys() -> Array: func is_class(type: String) -> bool: return type == "InkList" || .is_class(type) + func get_class() -> String: return "InkList" + diff --git a/addons/inkgd/runtime/static/json.gd b/addons/inkgd/runtime/static/json.gd index 878298f5..ed5ff1df 100644 --- a/addons/inkgd/runtime/static/json.gd +++ b/addons/inkgd/runtime/static/json.gd @@ -237,6 +237,7 @@ func write_runtime_object(writer, obj: InkObject) -> void: writer.write("void") return + # Legacy Tags (replaced in 1.1+) var tag = Utils.as_or_null(obj, "Tag") if tag: writer.write_object_start() @@ -410,6 +411,7 @@ func jtoken_to_runtime_object(token) -> InkObject: var_ass.is_global = is_global_var return var_ass + # Legacy Tags with texts (replaced in 1.1+) if obj.has("#"): prop_value = obj["#"] return InkTag.new(str(prop_value)) @@ -626,6 +628,8 @@ func _init(native_function_call): _control_command_names.append("listInt") # LIST_FROM_INT _control_command_names.append("range") # LIST_RANGE _control_command_names.append("lrnd") # LIST_RANDOM + _control_command_names.append("#") # BEGIN_TAG + _control_command_names.append("/#") # END_TAG var i = 0 while i < InkControlCommand.CommandType.TOTAL_VALUES: diff --git a/addons/inkgd/runtime/story.gd b/addons/inkgd/runtime/story.gd index d2bc35a8..7e2f7a3a 100644 --- a/addons/inkgd/runtime/story.gd +++ b/addons/inkgd/runtime/story.gd @@ -14,7 +14,7 @@ extends InkObject class_name InkStory -const INK_VERSION_CURRENT := 20 +const INK_VERSION_CURRENT := 21 const INK_VERSION_MINIMUM_COMPATIBLE := 18 # ############################################################################ # @@ -48,6 +48,7 @@ var InkListValue := load("res://addons/inkgd/runtime/values/list_value.gd") as G var InkList := load("res://addons/inkgd/runtime/lists/ink_list.gd") as GDScript var InkChoice := load("res://addons/inkgd/runtime/content/choices/choice.gd") as GDScript +var InkTag := load("res://addons/inkgd/runtime/content/tag.gd") as GDScript var InkStoryState := load("res://addons/inkgd/runtime/story_state.gd") as GDScript @@ -485,7 +486,7 @@ func calculate_newline_output_state_change( prev_tag_count: int, curr_tag_count: int ) -> int: - var newline_still_exists = curr_text.length() >= prev_text.length() && curr_text[prev_text.length() - 1] == "\n" + var newline_still_exists = curr_text.length() >= prev_text.length() && prev_text.length() > 0 && curr_text[prev_text.length() - 1] == "\n" if (prev_tag_count == curr_tag_count && prev_text.length() == curr_text.length() && newline_still_exists): return OutputStateChange.NO_CHANGE @@ -716,24 +717,43 @@ func visit_changed_containers_due_to_divert() -> void: current_container_ancestor = Utils.as_or_null(current_container_ancestor.parent, "InkContainer") +# The original implementation would return the choice string and update the +# array of tags passed in parameter. Since in/out (ref) parameters are not supported +# in GDScript, the method returns a tuple (array) instead. +# (Array<String>) -> [String, Array<String>] +func pop_choice_string_and_tags(tags) -> Array: + var choice_only_str_val = Utils.cast(self.state.pop_evaluation_stack(), "StringValue") + + while self.state.evaluation_stack.size() > 0 and Utils.is_ink_class(state.peek_evaluation_stack(), "Tag"): + if tags == null: + tags = [] + var tag = Utils.cast(self.state.pop_evaluation_stack(), "Tag") + tags.insert(0, tag.text) + + return [choice_only_str_val.value, tags] + + func process_choice(choice_point: InkChoicePoint) -> InkChoice: - var show_choice = true + var show_choice := true if choice_point.has_condition: var condition_value = self.state.pop_evaluation_stack() if !self.is_truthy(condition_value): show_choice = false - var start_text = "" - var choice_only_text = "" + var start_text := "" + var choice_only_text := "" + var tags = null if choice_point.has_choice_only_content: - var choice_only_str_val = Utils.as_or_null(self.state.pop_evaluation_stack(), "StringValue") - choice_only_text = choice_only_str_val.value + var choice_strings_and_tags = self.pop_choice_string_and_tags(tags) + choice_only_text = choice_strings_and_tags[0] + tags = choice_strings_and_tags[1] if choice_point.has_start_content: - var start_str_val = Utils.as_or_null(self.state.pop_evaluation_stack(), "StringValue") - start_text = start_str_val.value + var choice_strings_and_tags = self.pop_choice_string_and_tags(tags) + start_text = choice_strings_and_tags[0] + tags = choice_strings_and_tags[1] if choice_point.once_only: var visit_count = self.state.visit_count_for_container(choice_point.choice_target) @@ -747,6 +767,7 @@ func process_choice(choice_point: InkChoicePoint) -> InkChoice: choice.target_path = choice_point.path_on_choice choice.source_path = choice_point.path._to_string() choice.is_invisible_default = choice_point.is_invisible_default + choice.tags = tags choice.thread_at_generation = self.state.callstack.fork_thread() choice.text = Utils.trim(start_text + choice_only_text, [" ", "\t"]) @@ -912,10 +933,51 @@ func perform_logic_and_flow_control(content_obj: InkObject) -> bool: ) self.state.in_expression_evaluation = false + InkControlCommand.CommandType.BEGIN_TAG: + self.state.push_to_output_stream(eval_command) + + InkControlCommand.CommandType.END_TAG: + if self.state.in_string_evaluation: + var content_stack_for_tag := [] # Stack<InkObject> + var output_count_consumed := 0 + + var i = self.state.output_stream.size() - 1 + while i >= 0: + var obj = self.state.output_stream[i] + + output_count_consumed += 1 + + var command = Utils.as_or_null(obj, "ControlCommand") + if command != null: + if command.command_type == InkControlCommand.CommandType.BEGIN_TAG: + break + else: + self.error("Unexpected ControlCommand while extracting tag from choice") + break + + if Utils.is_ink_class(obj, "StringValue"): + content_stack_for_tag.push_front(obj) + + i -= 1 + + self.state.pop_from_output_stream(output_count_consumed) + + var sb = "" + for str_val in content_stack_for_tag: + sb += str_val.value + + var choice_tag = InkTag.new(self.state.clean_output_whitespace(sb)) + + self.state.push_evaluation_stack(choice_tag) + else: + self.state.push_to_output_stream(eval_command) + + InkControlCommand.CommandType.END_STRING: - var content_stack_for_string = [] # Stack<InkObject> + var content_stack_for_string := [] # Stack<InkObject> + var content_to_retain := [] # Stack<InkObject> - var output_count_consumed = 0 + var output_count_consumed := 0 var i = self.state.output_stream.size() - 1 while (i >= 0): var obj = self.state.output_stream[i] @@ -927,6 +989,9 @@ func perform_logic_and_flow_control(content_obj: InkObject) -> bool: command.command_type == InkControlCommand.CommandType.BEGIN_STRING): break + if Utils.is_ink_class(obj, "Tag"): + content_to_retain.push_front(obj) + if Utils.is_ink_class(obj, "StringValue"): content_stack_for_string.push_front(obj) @@ -934,7 +999,10 @@ func perform_logic_and_flow_control(content_obj: InkObject) -> bool: self.state.pop_from_output_stream(output_count_consumed) - var _str = "" + for rescued_tag in content_to_retain: + state.push_to_output_stream(rescued_tag) + + var _str := "" for c in content_stack_for_string: _str += c._to_string() @@ -1583,13 +1651,30 @@ func tags_at_start_of_flow_container_with_path_string(path_string: String): flow_container = first_content else: break + var in_tag := false var tags = null # Array<String> for c in flow_container.content: - var tag = Utils.as_or_null(c , "Tag") - if tag: - if tags == null: tags = [] # Array<String> () - tags.append(tag.text) - else: break + var command = Utils.as_or_null(c, "ControlCommand") + if command != null: + if command.command_type == InkControlCommand.CommandType.BEGIN_TAG: + in_tag = true + elif command.command_type == InkControlCommand.CommandType.END_TAG: + in_tag = false + elif in_tag: + var _str = Utils.as_or_null(c, "StringValue") + if _str != null: + if tags == null: + tags = [] # Array<String> + tags.append(_str.value) + print(str("\"", _str.value, "\"")) + else: + self.error(str( + "Tag contained non-text content. Only plain text is allowed when using ", + "globalTags or TagsAtContentPath. If you want to evaluate dynamic ", + "content, you need to use story.Continue()." + )) + else: + break return tags diff --git a/addons/inkgd/runtime/story_state.gd b/addons/inkgd/runtime/story_state.gd index fb4239b5..cae4a105 100644 --- a/addons/inkgd/runtime/story_state.gd +++ b/addons/inkgd/runtime/story_state.gd @@ -45,7 +45,7 @@ static func InkStoryState() -> GDScript: # ############################################################################ # -const INK_SAVE_STATE_VERSION: int = 9 +const INK_SAVE_STATE_VERSION: int = 10 const MIN_COMPATIBLE_LOAD_VERSION: int = 8 # ############################################################################ # @@ -236,12 +236,20 @@ func get_has_warning() -> bool: var current_text: String setget , get_current_text func get_current_text(): if self._output_stream_text_dirty: - var _str = "" + var _str := "" + var in_tag := false for output_obj in self.output_stream: - var text_content: InkStringValue = Utils.as_or_null(output_obj, "StringValue") - if text_content != null: + var text_content = Utils.as_or_null(output_obj, "StringValue") + if !in_tag && text_content != null: _str += text_content.value + else: + var control_command = Utils.as_or_null(output_obj, "ControlCommand") + if control_command != null: + if control_command.command_type == InkControlCommand.CommandType.BEGIN_TAG: + in_tag = true + elif control_command.command_type == InkControlCommand.CommandType.END_TAG: + in_tag = false self._current_text = self.clean_output_whitespace(_str) @@ -289,10 +297,38 @@ func get_current_tags(): if self._output_stream_tags_dirty: self._current_tags = [] + var in_tag := false + var sb := "" + for output_obj in self.output_stream: - var tag = Utils.as_or_null(output_obj, "Tag") - if tag != null: - self._current_tags.append(tag.text) + var control_command = Utils.as_or_null(output_obj, "ControlCommand") + + if control_command != null: + if control_command.command_type == InkControlCommand.CommandType.BEGIN_TAG: + if in_tag && sb.length() > 0: + var txt = self.clean_output_whitespace(sb) + self._current_tags.append(txt) + sb = "" + in_tag = true + elif control_command.command_type == InkControlCommand.CommandType.END_TAG: + if sb.length() > 0: + var txt = self.clean_output_whitespace(sb) + self._current_tags.append(txt) + sb = "" + in_tag = false + elif in_tag: + var str_val = Utils.as_or_null(output_obj, "StringValue") + if str_val != null: + sb += str_val.value + else: + var tag = Utils.as_or_null(output_obj, "Tag") + if tag != null && tag.text != null && !tag.text.empty(): + self._current_tags.append(tag.text) + + if !sb.empty(): + var txt = self.clean_output_whitespace(sb) + self._current_tags.append(txt) + sb = "" self._output_stream_tags_dirty = false @@ -305,6 +341,26 @@ var current_flow_name: String setget , get_current_flow_name func get_current_flow_name() -> String: return self._current_flow.name +var current_flow_is_default_flow: bool setget , get_current_flow_is_default_flow +func get_current_flow_is_default_flow() -> bool: + return self._current_flow.name == DEFAULT_FLOW_NAME + +var alive_flow_names: Array setget , get_alive_flow_names +func get_alive_flow_names() -> Array: + if self._alive_flow_names_dirty: + self._alive_flow_names = [] + + if self._named_flows != null: + for flow_name in self._named_flows.keys(): + if flow_name != DEFAULT_FLOW_NAME: + self._alive_flow_names.append(flow_name) + + self._alive_flow_names_dirty = false + + return self._alive_flow_names + +var _alive_flow_names: Array = [] + var in_expression_evaluation: bool setget \ set_in_expression_evaluation, \ get_in_expression_evaluation @@ -322,6 +378,7 @@ func _init(story): self._current_flow = InkFlow.new_with_name(DEFAULT_FLOW_NAME, story) self.output_stream_dirty() + self._alive_flow_names_dirty = true self.evaluation_stack = [] @@ -360,6 +417,7 @@ func switch_flow_internal(flow_name: String) -> void: else: flow = InkFlow.new_with_name(flow_name, self.story) self._named_flows[flow_name] = flow + self._alive_flow_names_dirty = true self._current_flow = flow self.variables_state.callstack = self._current_flow.callstack @@ -387,6 +445,7 @@ func remove_flow_internal(flow_name: String) -> void: self.switch_to_default_flow_internal() self._named_flows.erase(flow_name) + self._alive_flow_names_dirty = true # () -> InkStoryState func copy_and_start_patching(): @@ -406,6 +465,7 @@ func copy_and_start_patching(): var named_flow_value = self._named_flows[named_flow_key] copy._named_flows[named_flow_key] = named_flow_value copy._named_flows[self._current_flow.name] = copy._current_flow + copy._alive_flow_names_dirty = true if self.has_error: copy.current_errors = [] # Array<String> @@ -547,6 +607,7 @@ func load_json_obj(jobject: Dictionary) -> void: self._current_flow.load_flow_choice_threads(jchoice_threads_obj, self.story) self.output_stream_dirty() + self._alive_flow_names_dirty = true self.variables_state.set_json_token(jobject["variablesState"]) self.variables_state.callstack = self._current_flow.callstack @@ -952,11 +1013,11 @@ func pass_arguments_to_evaluation_stack(arguments) -> void: if arguments != null: var i = 0 while (i < arguments.size()): - if !(arguments[i] is int || arguments[i] is float || arguments[i] is String || ((arguments[i] is Object) && arguments[i].is_class("InkList"))): + if !(arguments[i] is int || arguments[i] is float || arguments[i] is String || arguments[i] is bool || ((arguments[i] is Object) && arguments[i].is_class("InkList"))): Utils.throw_argument_exception( "ink arguments when calling EvaluateFunction / " + "ChoosePathStringWithParameters must be int, " + - "float, string or InkList. Argument was " + + "float, string, bool or InkList. Argument was " + ("null" if arguments[i] == null else Utils.typename_of(arguments[i])) ) return @@ -1040,6 +1101,7 @@ var _patch # StatePatch? var _current_flow = null # Flow? var _named_flows = null # Dictionary<String, Flow>? const DEFAULT_FLOW_NAME: String = "DEFAULT_FLOW" # String +var _alive_flow_names_dirty := true # C# Actions & Delegates ##################################################### # diff --git a/docs/source/classes/class_inkplayer.rst b/docs/source/classes/class_inkplayer.rst index 43844516..44b121f9 100644 --- a/docs/source/classes/class_inkplayer.rst +++ b/docs/source/classes/class_inkplayer.rst @@ -60,6 +60,10 @@ Read Only Properties +------------+---------------------------------------------------------------------------------------------+--------------------+ | bool_ | :ref:`current_flow_name<class_inkplayer_current_flow_name>` | ``"DEFAULT_FLOW"`` | +------------+---------------------------------------------------------------------------------------------+--------------------+ +| bool_ | :ref:`alive_flow_names<class_inkplayer_alive_flow_names>` | ``[]`` | ++------------+---------------------------------------------------------------------------------------------+--------------------+ +| bool_ | :ref:`current_flow_is_default_flow<class_inkplayer_current_flow_is_default_flow>` | ``true`` | ++------------+---------------------------------------------------------------------------------------------+--------------------+ | bool_ | :ref:`current_current_path<class_inkplayer_current_current_path>` | ``""`` | +------------+---------------------------------------------------------------------------------------------+--------------------+ @@ -266,9 +270,9 @@ any resource, it should be an instance of *InkResource*. - bool_ **loads_in_background** -+-----------+----------------------------------+ -| *Default* | ``true`` | -+-----------+----------------------------------+ ++-----------+------------------------------------+ +| *Default* | ``true`` | ++-----------+------------------------------------+ When ``true`` the story will be created in a separate threads, to prevent the UI from freezing if the story is too big. Note that on platforms where threads @@ -280,13 +284,13 @@ aren't available, the value of this property is ignored. - bool_ **allow_external_function_fallbacks** -+-----------+----------------------------------+ -| *Default* | ``true`` | -+-----------+----------------------------------+ -| *Setter* | set_aeff(value) | -+-----------+----------------------------------+ -| *Getter* | get_aeff() | -+-----------+----------------------------------+ ++-----------+------------------------------------+ +| *Default* | ``true`` | ++-----------+------------------------------------+ +| *Setter* | set_aeff(value) | ++-----------+------------------------------------+ +| *Getter* | get_aeff() | ++-----------+------------------------------------+ ``true`` to allow external function fallbacks, ``false`` otherwise. If this property is ``false`` and the appropriate function hasn't been binded, the @@ -298,13 +302,13 @@ story will output an error. - bool_ **do_not_save_default_values** -+-----------+----------------------------------+ -| *Default* | ``true`` | -+-----------+----------------------------------+ -| *Setter* | set_dnsdv(value) | -+-----------+----------------------------------+ -| *Getter* | get_dnsdv() | -+-----------+----------------------------------+ ++-----------+------------------------------------+ +| *Default* | ``true`` | ++-----------+------------------------------------+ +| *Setter* | set_dnsdv(value) | ++-----------+------------------------------------+ +| *Getter* | get_dnsdv() | ++-----------+------------------------------------+ When set to ``true``, *inkgd* skips saving global values that remain equal to the initial values that were declared in ink. This property matches @@ -316,13 +320,13 @@ the static property declared in `VariablesState.cs`_. - bool_ **stop_execution_on_exception** -+-----------+----------------------------------+ -| *Default* | ``true`` | -+-----------+----------------------------------+ -| *Setter* | set_speoex(value) | -+-----------+----------------------------------+ -| *Getter* | get_speoex() | -+-----------+----------------------------------+ ++-----------+------------------------------------+ +| *Default* | ``true`` | ++-----------+------------------------------------+ +| *Setter* | set_speoex(value) | ++-----------+------------------------------------+ +| *Getter* | get_speoex() | ++-----------+------------------------------------+ When set to ``true``, *inkgd* uses ``assert()`` instead of ``push_error`` to report exceptions, thus making them more explicit during development. @@ -333,13 +337,13 @@ report exceptions, thus making them more explicit during development. - bool_ **stop_execution_on_error** -+-----------+----------------------------------+ -| *Default* | ``true`` | -+-----------+----------------------------------+ -| *Setter* | set_speoer(value) | -+-----------+----------------------------------+ -| *Getter* | get_speoer() | -+-----------+----------------------------------+ ++-----------+------------------------------------+ +| *Default* | ``true`` | ++-----------+------------------------------------+ +| *Setter* | set_speoer(value) | ++-----------+------------------------------------+ +| *Getter* | get_speoer() | ++-----------+------------------------------------+ When set to ``true``, *inkgd* uses ``assert()`` instead of ``push_error`` to report errors, thus making them more explicit during development. @@ -350,11 +354,11 @@ report errors, thus making them more explicit during development. - bool_ **story** -+-----------+----------------------------------+ -| *Default* | ``null`` | -+-----------+----------------------------------+ -| *Getter* | get_can_story() | -+-----------+----------------------------------+ ++-----------+------------------------------------+ +| *Default* | ``null`` | ++-----------+------------------------------------+ +| *Getter* | get_can_story() | ++-----------+------------------------------------+ The underlying story, exposed for convenience. For instance, you may want to create a new InkList, which in certain acses needs a reference to the @@ -366,11 +370,11 @@ story to be constructed. - bool_ **can_continue** -+-----------+----------------------------------+ -| *Default* | ``false`` | -+-----------+----------------------------------+ -| *Getter* | get_can_continue() | -+-----------+----------------------------------+ ++-----------+------------------------------------+ +| *Default* | ``false`` | ++-----------+------------------------------------+ +| *Getter* | get_can_continue() | ++-----------+------------------------------------+ ``true`` if the story can continue (i. e. is not expecting a choice to be choosen and hasn't reached the end). @@ -381,11 +385,11 @@ choosen and hasn't reached the end). - bool_ **async_continue_complete** -+-----------+----------------------------------+ -| *Default* | ``false`` | -+-----------+----------------------------------+ -| *Getter* | get_async_continue_complete() | -+-----------+----------------------------------+ ++-----------+------------------------------------+ +| *Default* | ``false`` | ++-----------+------------------------------------+ +| *Getter* | get_async_continue_complete() | ++-----------+------------------------------------+ If ``continue_async`` was called (with milliseconds limit > 0) then this property will return false if the ink evaluation isn't yet finished, and @@ -397,11 +401,11 @@ you need to call it again in order for the continue to fully complete. - String_ **current_text** -+-----------+----------------------------------+ -| *Default* | ``""`` | -+-----------+----------------------------------+ -| *Getter* | get_current_text() | -+-----------+----------------------------------+ ++-----------+------------------------------------+ +| *Default* | ``""`` | ++-----------+------------------------------------+ +| *Getter* | get_current_text() | ++-----------+------------------------------------+ The content of the current line. @@ -411,11 +415,11 @@ The content of the current line. - Array_ **current_choices** -+-----------+----------------------------------+ -| *Default* | ``""`` | -+-----------+----------------------------------+ -| *Getter* | get_current_choices() | -+-----------+----------------------------------+ ++-----------+------------------------------------+ +| *Default* | ``""`` | ++-----------+------------------------------------+ +| *Getter* | get_current_choices() | ++-----------+------------------------------------+ The current choices. Empty is there are no choices for the current line. @@ -425,11 +429,11 @@ The current choices. Empty is there are no choices for the current line. - Array_ **current_tags** -+-----------+----------------------------------+ -| *Default* | ``[]`` | -+-----------+----------------------------------+ -| *Getter* | get_current_tags() | -+-----------+----------------------------------+ ++-----------+------------------------------------+ +| *Default* | ``[]`` | ++-----------+------------------------------------+ +| *Getter* | get_current_tags() | ++-----------+------------------------------------+ The current tags. Empty is there are no tags for the current line. @@ -439,11 +443,11 @@ The current tags. Empty is there are no tags for the current line. - Array_ **global_tags** -+-----------+----------------------------------+ -| *Default* | ``[]`` | -+-----------+----------------------------------+ -| *Getter* | get_global_tags() | -+-----------+----------------------------------+ ++-----------+------------------------------------+ +| *Default* | ``[]`` | ++-----------+------------------------------------+ +| *Getter* | get_global_tags() | ++-----------+------------------------------------+ The global tags for the story. Empty if none have been declared. @@ -453,11 +457,11 @@ The global tags for the story. Empty if none have been declared. - bool_ **has_choices** -+-----------+----------------------------------+ -| *Default* | ``false`` | -+-----------+----------------------------------+ -| *Getter* | get_has_choices() | -+-----------+----------------------------------+ ++-----------+------------------------------------+ +| *Default* | ``false`` | ++-----------+------------------------------------+ +| *Getter* | get_has_choices() | ++-----------+------------------------------------+ ``true`` if the story currently has choices, ``false`` otherwise. @@ -467,25 +471,53 @@ The global tags for the story. Empty if none have been declared. - bool_ **current_flow_name** -+-----------+----------------------------------+ -| *Default* | ``"DEFAULT_FLOW"`` | -+-----------+----------------------------------+ -| *Getter* | get_current_flow_name() | -+-----------+----------------------------------+ ++-----------+------------------------------------+ +| *Default* | ``"DEFAULT_FLOW"`` | ++-----------+------------------------------------+ +| *Getter* | get_current_flow_name() | ++-----------+------------------------------------+ The name of the current flow. ---- +.. _class_inkplayer_alive_flow_names: + +- bool_ **alive_flow_names** + ++-----------+------------------------------------+ +| *Default* | ``[]`` | ++-----------+------------------------------------+ +| *Getter* | get_alive_flow_names() | ++-----------+------------------------------------+ + +The names of all flows currently alive. + +---- + +.. _class_inkplayer_current_flow_is_default_flow: + +- bool_ **current_flow_is_default_flow** + ++-----------+------------------------------------+ +| *Default* | ``true`` | ++-----------+------------------------------------+ +| *Getter* | get_current_flow_is_default_flow() | ++-----------+------------------------------------+ + +``true`` if the current flow is the default flow. + +---- + .. _class_inkplayer_current_current_path: - bool_ **current_current_path** -+-----------+----------------------------------+ -| *Default* | ``""`` | -+-----------+----------------------------------+ -| *Getter* | get_current_path() | -+-----------+----------------------------------+ ++-----------+------------------------------------+ +| *Default* | ``""`` | ++-----------+------------------------------------+ +| *Getter* | get_current_path() | ++-----------+------------------------------------+ The current story path. diff --git a/examples/scenes/common/choice_container.gd b/examples/scenes/common/choice_container.gd index 1269af85..01609646 100644 --- a/examples/scenes/common/choice_container.gd +++ b/examples/scenes/common/choice_container.gd @@ -33,7 +33,7 @@ var _buttons = [] func create_choices(choices): for choice in choices: var button = ChoiceButton.instance() - button.text = choice + button.text = choice.text button.connect("pressed", self, "_button_pressed", [button]) _buttons.append(button) diff --git a/test/fixture/compiled/player/error_and_exceptions.ink.json b/test/fixture/compiled/player/error_and_exceptions.ink.json index 2ba1bba3..fe52e122 100644 --- a/test/fixture/compiled/player/error_and_exceptions.ink.json +++ b/test/fixture/compiled/player/error_and_exceptions.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[["done",{"#n":"g-0"}],null],"done",{"knot":["^This is a knot","\n","done",{"stitch":[["^This is a stitch","\n",["^This is a gather ",{"#":"tag1"},{"#":"tag2"},"\n","^Result: ","ev",{"VAR?":"aVariable"},"lrnd","out","/ev","\n","end",{"#n":"gather"}],null],null]}],"choices":[[["ev",{"^->":"choices.0.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^Choice 1",{"->":"$r","var":true},null]}],["ev",{"^->":"choices.0.1.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-1","flg":18},{"s":["^Choice 2",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"choices.0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.0.s"},[{"#n":"$r2"}],"\n","^Choice ",{"#":"1"},"\n",{"->":".^.^.g-0"},{"#f":5}],"c-1":["ev",{"^->":"choices.0.c-1.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.1.s"},[{"#n":"$r2"}],"\n","^Choice ",{"#":"2"},"\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":["end",null]}],null],"knot_with_arguments":[{"temp=":"arg1"},"^Argument: ","ev",{"VAR?":"arg1"},"out","/ev","\n","end",null],"global decl":["ev",3,{"VAR=":"aVariable"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[["done",{"#n":"g-0"}],null],"done",{"knot":["^This is a knot","\n","done",{"stitch":[["^This is a stitch","\n",["^This is a gather ","#","^tag1 ","/#","#","^tag2","/#","\n","^Result: ","ev",{"VAR?":"aVariable"},"lrnd","out","/ev","\n","end",{"#n":"gather"}],null],null]}],"choices":[[["ev",{"^->":"choices.0.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^Choice 1",{"->":"$r","var":true},null]}],["ev",{"^->":"choices.0.1.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-1","flg":18},{"s":["^Choice 2",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"choices.0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.0.s"},[{"#n":"$r2"}],"\n","^Choice ","#","^1","/#","\n",{"->":".^.^.g-0"},{"#f":5}],"c-1":["ev",{"^->":"choices.0.c-1.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.1.s"},[{"#n":"$r2"}],"\n","^Choice ","#","^2","/#","\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":["end",null]}],null],"knot_with_arguments":[{"temp=":"arg1"},"^Argument: ","ev",{"VAR?":"arg1"},"out","/ev","\n","end",null],"global decl":["ev",3,{"VAR=":"aVariable"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/player/flow.ink.json b/test/fixture/compiled/player/flow.ink.json index d0d5573c..fee743d6 100644 --- a/test/fixture/compiled/player/flow.ink.json +++ b/test/fixture/compiled/player/flow.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[{"#":"globalTag1"},{"#":"globalTag2"},{"->":"prologue"},["done",{"#n":"g-0"}],null],"done",{"prologue":[[{"#":"startTag1"},"^Hello ",{"#":"helloTag1"},"\n",["ev",{"^->":"prologue.0.4.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^Choice 1",{"->":"$r","var":true},null]}],["ev",{"^->":"prologue.0.5.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-1","flg":18},{"s":["^Choice 2",{"->":"$r","var":true},null]}],["ev",{"^->":"prologue.0.6.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-2","flg":18},{"s":["^Choice 3",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"prologue.0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.4.s"},[{"#n":"$r2"}],"\n",{"->":".^.^.^.chapter0"},{"#f":5}],"c-1":["ev",{"^->":"prologue.0.c-1.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.5.s"},[{"#n":"$r2"}],"\n",{"->":"chapter1"},{"#f":5}],"c-2":["ev",{"^->":"prologue.0.c-2.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.6.s"},[{"#n":"$r2"}],"\n",{"->":"epilogue"},"done",{"#f":5}]}],{"chapter0":[[{"#":"chapter0Tag1"},{"#":"chapter0Tag2"},["^This is chapter 0","\n","done",{"#n":"chapter0Gather"}],null],null]}],"chapter1":["^This is chapter 1","\n","done",null],"epilogue":[{"#":"epilogue1Tag1"},{"#":"epilogue1Tag2"},"^This is the end","\n","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["#","^globalTag1","/#","#","^globalTag2","/#",{"->":"prologue"},["done",{"#n":"g-0"}],null],"done",{"prologue":[["#","^startTag1","/#","^Hello ","#","^helloTag1","/#","\n",["ev",{"^->":"prologue.0.8.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^Choice 1 ","#","^choice1_tag1 ","/#","#","^choice1_tag2","/#",{"->":"$r","var":true},null]}],["ev",{"^->":"prologue.0.9.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-1","flg":18},{"s":["^Choice 2 ","#","^choice2_tag2","/#",{"->":"$r","var":true},null]}],["ev",{"^->":"prologue.0.10.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-2","flg":18},{"s":["^Choice 3 ","#","^choice3_tag3","/#",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"prologue.0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.8.s"},[{"#n":"$r2"}],"\n",{"->":".^.^.^.chapter0"},{"#f":5}],"c-1":["ev",{"^->":"prologue.0.c-1.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.9.s"},[{"#n":"$r2"}],"\n",{"->":"chapter1"},{"#f":5}],"c-2":["ev",{"^->":"prologue.0.c-2.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.10.s"},[{"#n":"$r2"}],"\n",{"->":"epilogue"},"done",{"#f":5}]}],{"chapter0":[["#","^chapter0Tag1","/#","#","^chapter0Tag2","/#",["^This is chapter 0","\n","done",{"#n":"chapter0Gather"}],null],null]}],"chapter1":["^This is chapter 1","\n","done",null],"epilogue":["#","^epilogue1Tag1","/#","#","^epilogue1Tag2","/#","^This is the end","\n","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/player/functions.ink.json b/test/fixture/compiled/player/functions.ink.json index ccc13eeb..fec6ea7e 100644 --- a/test/fixture/compiled/player/functions.ink.json +++ b/test/fixture/compiled/player/functions.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[{"->":"start"},["done",{"#n":"g-0"}],null],"done",{"external_function":[{"temp=":"count"},"ev",{"VAR?":"count"},3,"+","/ev","~ret",null],"the_function":[{"temp=":"count"},"^Hello World!","\n","ev",{"VAR?":"count"},4,"+","/ev","~ret",null],"start":["^The count is ","ev",4,{"x()":"external_function","exArgs":1},"out","/ev","\n","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[{"->":"start"},["done",{"#n":"g-0"}],null],"done",{"external_function":[{"temp=":"count"},"ev",{"VAR?":"count"},3,"+","/ev","~ret",null],"the_function":[{"temp=":"count"},"^Hello World!","\n","ev",{"VAR?":"count"},4,"+","/ev","~ret",null],"start":["^The count is ","ev",4,{"x()":"external_function","exArgs":1},"out","/ev","\n","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/player/ink_error.ink.json b/test/fixture/compiled/player/ink_error.ink.json index c09f14da..c477087e 100644 --- a/test/fixture/compiled/player/ink_error.ink.json +++ b/test/fixture/compiled/player/ink_error.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",{"VAR?":"variable"},"lrnd","out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev",0,{"VAR=":"variable"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",{"VAR?":"variable"},"lrnd","out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev",0,{"VAR=":"variable"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/player/ink_list_roundtrip.ink.json b/test/fixture/compiled/player/ink_list_roundtrip.ink.json index 7f1e4ac7..9418b62d 100644 --- a/test/fixture/compiled/player/ink_list_roundtrip.ink.json +++ b/test/fixture/compiled/player/ink_list_roundtrip.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["^Hello World.","\n",["done",{"#n":"g-0"}],null],"done",{"knot1":[{"->":".^.stitch1"},{"stitch1":[[["^Hi!","\n","done",{"#f":7,"#n":"gather1"}],null],null]}],"global decl":["ev",{"list":{},"origins":["breads"]},{"VAR=":"breads"},{"list":{},"origins":["pastas"]},{"VAR=":"pastas"},{"list":{},"origins":["drinks"]},{"VAR=":"drinks"},{"list":{"breads.Brioche":3,"breads.Fougasse":4,"breads.PainDeCampagne":5}},{"VAR=":"tastyBreads"},{"list":{"pastas.Ravioli":5,"pastas.Spaghetti":2,"pastas.Penne":1}},{"VAR=":"tastyPastas"},{"list":{"breads.Baguette":1,"pastas.Macaroni":4,"pastas.Ravioli":5,"drinks.StillWater":1,"drinks.SparklingWater":2}},{"VAR=":"tastyMealItems"},{"^->":"knot1.stitch1.0.gather1"},{"VAR=":"coolDivert"},"/ev","end",null]}],"listDefs":{"breads":{"Baguette":1,"Ficelle":2,"Brioche":3,"Fougasse":4,"PainDeCampagne":5},"pastas":{"Penne":1,"Spaghetti":2,"Fusilli":3,"Macaroni":4,"Ravioli":5,"Cannelloni":6},"drinks":{"StillWater":1,"SparklingWater":2,"IcedTea":3,"Soda":4}}} \ No newline at end of file +{"inkVersion":21,"root":[["^Hello World.","\n",["done",{"#n":"g-0"}],null],"done",{"knot1":[{"->":".^.stitch1"},{"stitch1":[[["^Hi!","\n","done",{"#f":7,"#n":"gather1"}],null],null]}],"global decl":["ev",{"list":{},"origins":["breads"]},{"VAR=":"breads"},{"list":{},"origins":["pastas"]},{"VAR=":"pastas"},{"list":{},"origins":["drinks"]},{"VAR=":"drinks"},{"list":{"breads.Brioche":3,"breads.Fougasse":4,"breads.PainDeCampagne":5}},{"VAR=":"tastyBreads"},{"list":{"pastas.Ravioli":5,"pastas.Spaghetti":2,"pastas.Penne":1}},{"VAR=":"tastyPastas"},{"list":{"breads.Baguette":1,"pastas.Macaroni":4,"pastas.Ravioli":5,"drinks.StillWater":1,"drinks.SparklingWater":2}},{"VAR=":"tastyMealItems"},{"^->":"knot1.stitch1.0.gather1"},{"VAR=":"coolDivert"},"/ev","end",null]}],"listDefs":{"breads":{"Baguette":1,"Ficelle":2,"Brioche":3,"Fougasse":4,"PainDeCampagne":5},"pastas":{"Penne":1,"Spaghetti":2,"Fusilli":3,"Macaroni":4,"Ravioli":5,"Cannelloni":6},"drinks":{"StillWater":1,"SparklingWater":2,"IcedTea":3,"Soda":4}}} \ No newline at end of file diff --git a/test/fixture/compiled/player/variable_observation.ink.json b/test/fixture/compiled/player/variable_observation.ink.json index ce7abebe..07bd2aac 100644 --- a/test/fixture/compiled/player/variable_observation.ink.json +++ b/test/fixture/compiled/player/variable_observation.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[{"->":"aKnot"},["done",{"#n":"g-0"}],null],"done",{"aKnot":["^aBoolean = true","\n","^aString = \"Bye\"","\n","^anInteger = 2","\n","^aFloat = 1.2","\n","^aDivert = ",{"->":"otherKnot"},"\n",{"->":"aDivert","var":true},{"#f":3}],"otherKnot":["^aBoolean = true","\n","^aString = \"Bye\"","\n","^anInteger = 2","\n","^aFloat = 1.2","\n","^aDivert = ",{"->":"aKnot"},"\n","done",null],"global decl":["ev",false,{"VAR=":"aBoolean"},"str","^Hello","/str",{"VAR=":"aString"},3,{"VAR=":"anInteger"},4.3,{"VAR=":"aFloat"},{"^->":"aKnot"},{"VAR=":"aDivert"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[{"->":"aKnot"},["done",{"#n":"g-0"}],null],"done",{"aKnot":["^aBoolean = true","\n","^aString = \"Bye\"","\n","^anInteger = 2","\n","^aFloat = 1.2","\n","^aDivert = ",{"->":"otherKnot"},"\n",{"->":"aDivert","var":true},{"#f":3}],"otherKnot":["^aBoolean = true","\n","^aString = \"Bye\"","\n","^anInteger = 2","\n","^aFloat = 1.2","\n","^aDivert = ",{"->":"aKnot"},"\n","done",null],"global decl":["ev",false,{"VAR=":"aBoolean"},"str","^Hello","/str",{"VAR=":"aString"},3,{"VAR=":"anInteger"},4.3,{"VAR=":"aFloat"},{"^->":"aKnot"},{"VAR=":"aDivert"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/player/variables.ink.json b/test/fixture/compiled/player/variables.ink.json index f5641da9..e1f40596 100644 --- a/test/fixture/compiled/player/variables.ink.json +++ b/test/fixture/compiled/player/variables.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[{"->":"aKnot"},["done",{"#n":"g-0"}],null],"done",{"aKnot":[["^Hello World!","\n",["ev",{"^->":"aKnot.0.2.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":2},{"s":["^Choice 1",{"->":"$r","var":true},null]}],["ev",{"^->":"aKnot.0.3.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-1","flg":2},{"s":["^Choice 2",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"aKnot.0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.2.s"},[{"#n":"$r2"}],"\n","^Goodbye","\n",{"->":".^.^.g-0"},null],"c-1":["ev",{"^->":"aKnot.0.c-1.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.3.s"},[{"#n":"$r2"}],"\n","ev",true,"/ev",{"VAR=":"aBoolean","re":true},"ev","str","^Goodbye","/str","/ev",{"VAR=":"aString","re":true},"ev",0,"/ev",{"VAR=":"anInteger","re":true},"ev",1.2,"/ev",{"VAR=":"aFloat","re":true},"ev",{"^->":"otherKnot"},"/ev",{"VAR=":"aDivert","re":true},"^Goodbye","\n",{"->":".^.^.g-0"},null],"g-0":[{"->":"aDivert","var":true},"done",null]}],{"#f":3}],"otherKnot":["ev",false,"/ev",{"VAR=":"aBoolean","re":true},"ev","str","^Why?","/str","/ev",{"VAR=":"aString","re":true},"ev",6,"/ev",{"VAR=":"anInteger","re":true},"ev",8.5,"/ev",{"VAR=":"aFloat","re":true},"ev",{"^->":"aKnot"},"/ev",{"VAR=":"aDivert","re":true},"^Other Knot","\n","done",{"#f":3}],"global decl":["ev",false,{"VAR=":"aBoolean"},"str","^Hello","/str",{"VAR=":"aString"},3,{"VAR=":"anInteger"},4.3,{"VAR=":"aFloat"},{"^->":"aKnot"},{"VAR=":"aDivert"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[{"->":"aKnot"},["done",{"#n":"g-0"}],null],"done",{"aKnot":[["^Hello World!","\n",["ev",{"^->":"aKnot.0.2.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":2},{"s":["^Choice 1",{"->":"$r","var":true},null]}],["ev",{"^->":"aKnot.0.3.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-1","flg":2},{"s":["^Choice 2",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"aKnot.0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.2.s"},[{"#n":"$r2"}],"\n","^Goodbye","\n",{"->":".^.^.g-0"},null],"c-1":["ev",{"^->":"aKnot.0.c-1.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.3.s"},[{"#n":"$r2"}],"\n","ev",true,"/ev",{"VAR=":"aBoolean","re":true},"ev","str","^Goodbye","/str","/ev",{"VAR=":"aString","re":true},"ev",0,"/ev",{"VAR=":"anInteger","re":true},"ev",1.2,"/ev",{"VAR=":"aFloat","re":true},"ev",{"^->":"otherKnot"},"/ev",{"VAR=":"aDivert","re":true},"^Goodbye","\n",{"->":".^.^.g-0"},null],"g-0":[{"->":"aDivert","var":true},"done",null]}],{"#f":3}],"otherKnot":["ev",false,"/ev",{"VAR=":"aBoolean","re":true},"ev","str","^Why?","/str","/ev",{"VAR=":"aString","re":true},"ev",6,"/ev",{"VAR=":"anInteger","re":true},"ev",8.5,"/ev",{"VAR=":"aFloat","re":true},"ev",{"^->":"aKnot"},"/ev",{"VAR=":"aDivert","re":true},"^Other Knot","\n","done",{"#f":3}],"global decl":["ev",false,{"VAR=":"aBoolean"},"str","^Hello","/str",{"VAR=":"aString"},3,{"VAR=":"anInteger"},4.3,{"VAR=":"aFloat"},{"^->":"aKnot"},{"VAR=":"aDivert"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/bindings/external_binding.ink.json b/test/fixture/compiled/runtime/bindings/external_binding.ink.json index 1d025ae6..435628a1 100644 --- a/test/fixture/compiled/runtime/bindings/external_binding.ink.json +++ b/test/fixture/compiled/runtime/bindings/external_binding.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev","str","^hello world","/str",{"x()":"message","exArgs":1},"pop","/ev","\n","ev",5.0,3,{"x()":"multiply","exArgs":2},"out","/ev","\n","ev",3,"str","^knock ","/str",{"x()":"times","exArgs":2},"out","/ev","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev","str","^hello world","/str",{"x()":"message","exArgs":1},"pop","/ev","\n","ev",5.0,3,{"x()":"multiply","exArgs":2},"out","/ev","\n","ev",3,"str","^knock ","/str",{"x()":"times","exArgs":2},"out","/ev","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/bindings/game_ink_back_and_forth.ink.json b/test/fixture/compiled/runtime/bindings/game_ink_back_and_forth.ink.json index 19cc86e4..e2e4d3e5 100644 --- a/test/fixture/compiled/runtime/bindings/game_ink_back_and_forth.ink.json +++ b/test/fixture/compiled/runtime/bindings/game_ink_back_and_forth.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[["done",{"#n":"g-0"}],null],"done",{"topExternal":[{"temp=":"x"},"^In top external","\n","ev",{"VAR?":"x"},{"x()":"gameInc","exArgs":1},"/ev","~ret","\n",null],"inkInc":[{"temp=":"x"},"ev",{"VAR?":"x"},1,"+","/ev","~ret",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[["done",{"#n":"g-0"}],null],"done",{"topExternal":[{"temp=":"x"},"^In top external","\n","ev",{"VAR?":"x"},{"x()":"gameInc","exArgs":1},"/ev","~ret","\n",null],"inkInc":[{"temp=":"x"},"ev",{"VAR?":"x"},1,"+","/ev","~ret",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/bindings/lookup_safe_or_not.ink.json b/test/fixture/compiled/runtime/bindings/lookup_safe_or_not.ink.json index 99339bec..9e9a76ab 100644 --- a/test/fixture/compiled/runtime/bindings/lookup_safe_or_not.ink.json +++ b/test/fixture/compiled/runtime/bindings/lookup_safe_or_not.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["^One","\n","ev",{"x()":"myAction"},"pop","/ev","\n","^Two","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["^One","\n","ev",{"x()":"myAction"},"pop","/ev","\n","^Two","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/bindings/lookup_safe_or_not_with_post_glue.ink.json b/test/fixture/compiled/runtime/bindings/lookup_safe_or_not_with_post_glue.ink.json index e58b1b3b..900c62e7 100644 --- a/test/fixture/compiled/runtime/bindings/lookup_safe_or_not_with_post_glue.ink.json +++ b/test/fixture/compiled/runtime/bindings/lookup_safe_or_not_with_post_glue.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["^One","\n","ev",{"x()":"myAction"},"pop","/ev","\n","<>","^ Two","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["^One","\n","ev",{"x()":"myAction"},"pop","/ev","\n","<>","^ Two","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/bindings/variable_observer.ink.json b/test/fixture/compiled/runtime/bindings/variable_observer.ink.json index 2aef588d..5c4fb93b 100644 --- a/test/fixture/compiled/runtime/bindings/variable_observer.ink.json +++ b/test/fixture/compiled/runtime/bindings/variable_observer.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["^Hello world!","\n","ev",15,"/ev",{"VAR=":"testVar","re":true},"ev",100,"/ev",{"VAR=":"testVar2","re":true},"^Hello world 2!","\n",["ev",{"^->":"0.12.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":"0.c-0","flg":18},{"s":["^choice",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":"0.12.s"},[{"#n":"$r2"}],"\n","ev",25,"/ev",{"VAR=":"testVar","re":true},"ev",200,"/ev",{"VAR=":"testVar2","re":true},"end",{"->":"0.g-0"},{"#f":5}],"g-0":["done",null]}],"done",{"global decl":["ev",5,{"VAR=":"testVar"},10,{"VAR=":"testVar2"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["^Hello world!","\n","ev",15,"/ev",{"VAR=":"testVar","re":true},"ev",100,"/ev",{"VAR=":"testVar2","re":true},"^Hello world 2!","\n",["ev",{"^->":"0.12.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":"0.c-0","flg":18},{"s":["^choice",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":"0.12.s"},[{"#n":"$r2"}],"\n","ev",25,"/ev",{"VAR=":"testVar","re":true},"ev",200,"/ev",{"VAR=":"testVar2","re":true},"end",{"->":"0.g-0"},{"#f":5}],"g-0":["done",null]}],"done",{"global decl":["ev",5,{"VAR=":"testVar"},10,{"VAR=":"testVar2"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/booleans/false_plus_false.ink.json b/test/fixture/compiled/runtime/booleans/false_plus_false.ink.json index 5ae85d69..97f2b453 100644 --- a/test/fixture/compiled/runtime/booleans/false_plus_false.ink.json +++ b/test/fixture/compiled/runtime/booleans/false_plus_false.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",false,false,"+","out","/ev","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",false,false,"+","out","/ev","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/booleans/list_hasnt.ink.json b/test/fixture/compiled/runtime/booleans/list_hasnt.ink.json index bf0cc97d..13c1d283 100644 --- a/test/fixture/compiled/runtime/booleans/list_hasnt.ink.json +++ b/test/fixture/compiled/runtime/booleans/list_hasnt.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",{"VAR?":"list"},{"list":{"list.c":3}},"!?","out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev",{"list":{"list.b":2,"list.d":4}},{"VAR=":"list"},"/ev","end",null]}],"listDefs":{"list":{"a":1,"b":2,"c":3,"d":4,"e":5}}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",{"VAR?":"list"},{"list":{"list.c":3}},"!?","out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev",{"list":{"list.b":2,"list.d":4}},{"VAR=":"list"},"/ev","end",null]}],"listDefs":{"list":{"a":1,"b":2,"c":3,"d":4,"e":5}}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/booleans/not_one.ink.json b/test/fixture/compiled/runtime/booleans/not_one.ink.json index ad83e8de..f1dfd6b9 100644 --- a/test/fixture/compiled/runtime/booleans/not_one.ink.json +++ b/test/fixture/compiled/runtime/booleans/not_one.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",false,"out","/ev","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",false,"out","/ev","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/booleans/not_true.ink.json b/test/fixture/compiled/runtime/booleans/not_true.ink.json index ad83e8de..f1dfd6b9 100644 --- a/test/fixture/compiled/runtime/booleans/not_true.ink.json +++ b/test/fixture/compiled/runtime/booleans/not_true.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",false,"out","/ev","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",false,"out","/ev","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/booleans/three_greater_than_one.ink.json b/test/fixture/compiled/runtime/booleans/three_greater_than_one.ink.json index b9362201..4633fb85 100644 --- a/test/fixture/compiled/runtime/booleans/three_greater_than_one.ink.json +++ b/test/fixture/compiled/runtime/booleans/three_greater_than_one.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",3,1,">","out","/ev","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",3,1,">","out","/ev","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/booleans/true.ink.json b/test/fixture/compiled/runtime/booleans/true.ink.json index 4cb12ebb..b60fca7d 100644 --- a/test/fixture/compiled/runtime/booleans/true.ink.json +++ b/test/fixture/compiled/runtime/booleans/true.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",true,"out","/ev","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",true,"out","/ev","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/booleans/true_equals_one.ink.json b/test/fixture/compiled/runtime/booleans/true_equals_one.ink.json index c764e47e..933e1a0d 100644 --- a/test/fixture/compiled/runtime/booleans/true_equals_one.ink.json +++ b/test/fixture/compiled/runtime/booleans/true_equals_one.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",true,1,"==","out","/ev","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",true,1,"==","out","/ev","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/booleans/true_plus_one.ink.json b/test/fixture/compiled/runtime/booleans/true_plus_one.ink.json index f7e9ee28..3bdfd9d6 100644 --- a/test/fixture/compiled/runtime/booleans/true_plus_one.ink.json +++ b/test/fixture/compiled/runtime/booleans/true_plus_one.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",true,1,"+","out","/ev","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",true,1,"+","out","/ev","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/booleans/true_plus_true.ink.json b/test/fixture/compiled/runtime/booleans/true_plus_true.ink.json index 6a512a27..5ef3e049 100644 --- a/test/fixture/compiled/runtime/booleans/true_plus_true.ink.json +++ b/test/fixture/compiled/runtime/booleans/true_plus_true.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",true,true,"+","out","/ev","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",true,true,"+","out","/ev","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/booleans/two_plus_true.ink.json b/test/fixture/compiled/runtime/booleans/two_plus_true.ink.json index a814b555..6e5c040f 100644 --- a/test/fixture/compiled/runtime/booleans/two_plus_true.ink.json +++ b/test/fixture/compiled/runtime/booleans/two_plus_true.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",2,true,"+","out","/ev","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",2,true,"+","out","/ev","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/builtins/floor_ceiling_and_casts.ink.json b/test/fixture/compiled/runtime/builtins/floor_ceiling_and_casts.ink.json index 13d231ef..b9518f7f 100644 --- a/test/fixture/compiled/runtime/builtins/floor_ceiling_and_casts.ink.json +++ b/test/fixture/compiled/runtime/builtins/floor_ceiling_and_casts.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",1.2,"FLOOR","out","/ev","\n","ev",1.2,"INT","out","/ev","\n","ev",1.2,"CEILING","out","/ev","\n","ev",1.2,"CEILING",3,"/","out","/ev","\n","ev",1.2,"CEILING","INT",3,"/","out","/ev","\n","ev",1,"FLOOR","out","/ev","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",1.2,"FLOOR","out","/ev","\n","ev",1.2,"INT","out","/ev","\n","ev",1.2,"CEILING","out","/ev","\n","ev",1.2,"CEILING",3,"/","out","/ev","\n","ev",1.2,"CEILING","INT",3,"/","out","/ev","\n","ev",1,"FLOOR","out","/ev","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/builtins/read_count_across_callstack.ink.json b/test/fixture/compiled/runtime/builtins/read_count_across_callstack.ink.json index 1ea2917d..c189737b 100644 --- a/test/fixture/compiled/runtime/builtins/read_count_across_callstack.ink.json +++ b/test/fixture/compiled/runtime/builtins/read_count_across_callstack.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[{"->":"first"},["done",{"#n":"g-0"}],null],"done",{"first":["^1) Seen first ","ev",{"CNT?":".^"},"out","/ev","^ times.","\n",{"->t->":"second"},"^2) Seen first ","ev",{"CNT?":".^"},"out","/ev","^ times.","\n","done",{"#f":1}],"second":["^In second.","\n","ev","void","/ev","->->",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[{"->":"first"},["done",{"#n":"g-0"}],null],"done",{"first":["^1) Seen first ","ev",{"CNT?":".^"},"out","/ev","^ times.","\n",{"->t->":"second"},"^2) Seen first ","ev",{"CNT?":".^"},"out","/ev","^ times.","\n","done",{"#f":1}],"second":["^In second.","\n","ev","void","/ev","->->",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/builtins/read_count_across_threads.ink.json b/test/fixture/compiled/runtime/builtins/read_count_across_threads.ink.json index 5e031f57..be4cd1cc 100644 --- a/test/fixture/compiled/runtime/builtins/read_count_across_threads.ink.json +++ b/test/fixture/compiled/runtime/builtins/read_count_across_threads.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[{"->":"top"},["done",{"#n":"g-0"}],null],"done",{"top":["ev",{"CNT?":".^"},"out","/ev","\n","thread",{"->":"aside"},"ev",{"CNT?":".^"},"out","/ev","\n","done",{"#f":1}],"aside":[[["ev",{"^->":"aside.0.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str",false,"/ev",{"*":".^.^.c-0","flg":19},{"s":["^DONE",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"aside.0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.0.s"},[{"#n":"$r2"}],"\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":["done",null]}],null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[{"->":"top"},["done",{"#n":"g-0"}],null],"done",{"top":["ev",{"CNT?":".^"},"out","/ev","\n","thread",{"->":"aside"},"ev",{"CNT?":".^"},"out","/ev","\n","done",{"#f":1}],"aside":[[["ev",{"^->":"aside.0.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str",false,"/ev",{"*":".^.^.c-0","flg":19},{"s":["^DONE",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"aside.0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.0.s"},[{"#n":"$r2"}],"\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":["done",null]}],null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/builtins/read_count_dot_separated_path.ink.json b/test/fixture/compiled/runtime/builtins/read_count_dot_separated_path.ink.json index a226719c..6ccf36a0 100644 --- a/test/fixture/compiled/runtime/builtins/read_count_dot_separated_path.ink.json +++ b/test/fixture/compiled/runtime/builtins/read_count_dot_separated_path.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[{"->t->":"hi"},{"->t->":"hi"},{"->t->":"hi"},"ev",{"CNT?":"hi.stitch_to_count"},"out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"hi":[{"->":"hi.stitch_to_count"},{"stitch_to_count":["^hi","\n","ev","void","/ev","->->",{"#f":1}]}]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[{"->t->":"hi"},{"->t->":"hi"},{"->t->":"hi"},"ev",{"CNT?":"hi.stitch_to_count"},"out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"hi":[{"->":"hi.stitch_to_count"},{"stitch_to_count":["^hi","\n","ev","void","/ev","->->",{"#f":1}]}]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/builtins/read_count_variable_target.ink.json b/test/fixture/compiled/runtime/builtins/read_count_variable_target.ink.json index fb6df8cd..ae262e16 100644 --- a/test/fixture/compiled/runtime/builtins/read_count_variable_target.ink.json +++ b/test/fixture/compiled/runtime/builtins/read_count_variable_target.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["^Count start: ","ev",{"VAR?":"x"},"readc","out","/ev","^ ","ev",{"^->":"knot"},"readc","out","/ev","^ ","ev",{"CNT?":"knot"},"out","/ev","\n","ev",1,"/ev",{"->t->":"x","var":true},"ev",2,"/ev",{"->t->":"x","var":true},"ev",3,"/ev",{"->t->":"x","var":true},"^Count end: ","ev",{"VAR?":"x"},"readc","out","/ev","^ ","ev",{"^->":"knot"},"readc","out","/ev","^ ","ev",{"CNT?":"knot"},"out","/ev","\n","end",["done",{"#f":5,"#n":"g-0"}],null],"done",{"knot":[{"temp=":"a"},"ev",{"VAR?":"a"},"out","/ev","\n","ev","void","/ev","->->",{"#f":3}],"global decl":["ev",{"^->":"knot"},{"VAR=":"x"},"/ev","end",null],"#f":1}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["^Count start: ","ev",{"VAR?":"x"},"readc","out","/ev","^ ","ev",{"^->":"knot"},"readc","out","/ev","^ ","ev",{"CNT?":"knot"},"out","/ev","\n","ev",1,"/ev",{"->t->":"x","var":true},"ev",2,"/ev",{"->t->":"x","var":true},"ev",3,"/ev",{"->t->":"x","var":true},"^Count end: ","ev",{"VAR?":"x"},"readc","out","/ev","^ ","ev",{"^->":"knot"},"readc","out","/ev","^ ","ev",{"CNT?":"knot"},"out","/ev","\n","end",["done",{"#f":5,"#n":"g-0"}],null],"done",{"knot":[{"temp=":"a"},"ev",{"VAR?":"a"},"out","/ev","\n","ev","void","/ev","->->",{"#f":3}],"global decl":["ev",{"^->":"knot"},{"VAR=":"x"},"/ev","end",null],"#f":1}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/builtins/turns.ink.json b/test/fixture/compiled/runtime/builtins/turns.ink.json index 2355aece..4522c31f 100644 --- a/test/fixture/compiled/runtime/builtins/turns.ink.json +++ b/test/fixture/compiled/runtime/builtins/turns.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[{"->":"0.top.c-0"},["ev","str","^choice","/str","/ev",{"*":".^.c-0","flg":4},{"c-0":["\n","ev","turn","out","/ev","\n",{"->":".^.^"},{"->":"0.g-0"},null],"#n":"top"}],{"g-0":["done",null]}],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[{"->":"0.top.c-0"},["ev","str","^choice","/str","/ev",{"*":".^.c-0","flg":4},{"c-0":["\n","ev","turn","out","/ev","\n",{"->":".^.^"},{"->":"0.g-0"},null],"#n":"top"}],{"g-0":["done",null]}],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/builtins/turns_since.ink.json b/test/fixture/compiled/runtime/builtins/turns_since.ink.json index 74efa37a..cb8bd11e 100644 --- a/test/fixture/compiled/runtime/builtins/turns_since.ink.json +++ b/test/fixture/compiled/runtime/builtins/turns_since.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",{"^->":"test"},"turns","out","/ev","\n","ev",{"f()":"test"},"pop","/ev","\n","ev",{"^->":"test"},"turns","out","/ev","\n","ev","str","^choice 1","/str","/ev",{"*":"0.c-0","flg":20},{"c-0":["\n",{"->":"0.g-0"},{"#f":5}],"g-0":["ev",{"^->":"test"},"turns","out","/ev","\n","ev","str","^choice 2","/str","/ev",{"*":".^.c-1","flg":20},{"c-1":["\n",{"->":"0.g-1"},{"#f":5}]}],"g-1":["ev",{"^->":"test"},"turns","out","/ev","\n",["done",{"#n":"g-2"}],null]}],"done",{"test":["ev","void","/ev","~ret",{"#f":2}]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",{"^->":"test"},"turns","out","/ev","\n","ev",{"f()":"test"},"pop","/ev","\n","ev",{"^->":"test"},"turns","out","/ev","\n","ev","str","^choice 1","/str","/ev",{"*":"0.c-0","flg":20},{"c-0":["\n",{"->":"0.g-0"},{"#f":5}],"g-0":["ev",{"^->":"test"},"turns","out","/ev","\n","ev","str","^choice 2","/str","/ev",{"*":".^.c-1","flg":20},{"c-1":["\n",{"->":"0.g-1"},{"#f":5}]}],"g-1":["ev",{"^->":"test"},"turns","out","/ev","\n",["done",{"#n":"g-2"}],null]}],"done",{"test":["ev","void","/ev","~ret",{"#f":2}]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/builtins/turns_since_nested.ink.json b/test/fixture/compiled/runtime/builtins/turns_since_nested.ink.json index 37e9132d..eb7d333d 100644 --- a/test/fixture/compiled/runtime/builtins/turns_since_nested.ink.json +++ b/test/fixture/compiled/runtime/builtins/turns_since_nested.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[{"->":"empty_world"},["done",{"#n":"g-0"}],null],"done",{"empty_world":[["ev",{"^->":"empty_world.0.c-0"},"turns","out","/ev","^ = -1","\n",["ev",{"^->":"empty_world.0.7.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^stuff",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"empty_world.0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.7.s"},[{"#n":"$r2"}],"\n","ev",{"^->":"empty_world.0.c-0"},"turns","out","/ev","^ = 0","\n",[["ev",{"^->":"empty_world.0.c-0.14.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^more stuff",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"empty_world.0.c-0.14.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.0.s"},[{"#n":"$r2"}],"\n","ev",{"^->":"empty_world.0.c-0"},"turns","out","/ev","^ = 1","\n","done",{"#f":5}]}],{"#f":7}]}],null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[{"->":"empty_world"},["done",{"#n":"g-0"}],null],"done",{"empty_world":[["ev",{"^->":"empty_world.0.c-0"},"turns","out","/ev","^ = -1","\n",["ev",{"^->":"empty_world.0.7.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^stuff",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"empty_world.0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.7.s"},[{"#n":"$r2"}],"\n","ev",{"^->":"empty_world.0.c-0"},"turns","out","/ev","^ = 0","\n",[["ev",{"^->":"empty_world.0.c-0.14.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^more stuff",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"empty_world.0.c-0.14.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.0.s"},[{"#n":"$r2"}],"\n","ev",{"^->":"empty_world.0.c-0"},"turns","out","/ev","^ = 1","\n","done",{"#f":5}]}],{"#f":7}]}],null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/builtins/turns_since_with_variable_target.ink.json b/test/fixture/compiled/runtime/builtins/turns_since_with_variable_target.ink.json index dbf24e15..bf49bd12 100644 --- a/test/fixture/compiled/runtime/builtins/turns_since_with_variable_target.ink.json +++ b/test/fixture/compiled/runtime/builtins/turns_since_with_variable_target.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[{"->":"start"},["done",{"#f":5,"#n":"g-0"}],null],"done",{"start":[["ev",{"^->":"start"},{"f()":"beats"},"out","/ev","\n","ev",{"^->":"start"},{"f()":"beats"},"out","/ev","\n","ev","str","^Choice","/str","/ev",{"*":".^.c-0","flg":20},{"c-0":["^ ",{"->":"start.next"},"\n",{"#f":5}]}],{"next":["ev",{"^->":"start"},{"f()":"beats"},"out","/ev","\n","end",{"#f":1}],"#f":3}],"beats":[{"temp=":"x"},"ev",{"VAR?":"x"},"turns","/ev","~ret","\n",{"#f":1}],"#f":1}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[{"->":"start"},["done",{"#f":5,"#n":"g-0"}],null],"done",{"start":[["ev",{"^->":"start"},{"f()":"beats"},"out","/ev","\n","ev",{"^->":"start"},{"f()":"beats"},"out","/ev","\n","ev","str","^Choice","/str","/ev",{"*":".^.c-0","flg":20},{"c-0":["^ ",{"->":"start.next"},"\n",{"#f":5}]}],{"next":["ev",{"^->":"start"},{"f()":"beats"},"out","/ev","\n","end",{"#f":1}],"#f":3}],"beats":[{"temp=":"x"},"ev",{"VAR?":"x"},"turns","/ev","~ret","\n",{"#f":1}],"#f":1}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/builtins/visit_count_bug_due_to_nested_containers.ink.json b/test/fixture/compiled/runtime/builtins/visit_count_bug_due_to_nested_containers.ink.json index 566c456d..4ce8967a 100644 --- a/test/fixture/compiled/runtime/builtins/visit_count_bug_due_to_nested_containers.ink.json +++ b/test/fixture/compiled/runtime/builtins/visit_count_bug_due_to_nested_containers.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[["ev",{"CNT?":".^"},"out","/ev","\n",["ev",{"^->":"0.gather.5.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^choice",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"0.gather.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.5.s"},[{"#n":"$r2"}],"\n",{"->":"0.g-0"},{"#f":5}],"#f":5,"#n":"gather"}],{"g-0":["ev",{"CNT?":"0.gather"},"out","/ev","\n",["done",{"#n":"g-1"}],null]}],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[["ev",{"CNT?":".^"},"out","/ev","\n",["ev",{"^->":"0.gather.5.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^choice",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"0.gather.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.5.s"},[{"#n":"$r2"}],"\n",{"->":"0.g-0"},{"#f":5}],"#f":5,"#n":"gather"}],{"g-0":["ev",{"CNT?":"0.gather"},"out","/ev","\n",["done",{"#n":"g-1"}],null]}],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/builtins/visit_counts_when_choosing.ink.json b/test/fixture/compiled/runtime/builtins/visit_counts_when_choosing.ink.json index 05c67e20..3142b7f3 100644 --- a/test/fixture/compiled/runtime/builtins/visit_counts_when_choosing.ink.json +++ b/test/fixture/compiled/runtime/builtins/visit_counts_when_choosing.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[["done",{"#f":5,"#n":"g-0"}],null],"done",{"TestKnot":[["^this is a test","\n","ev","str","^Next","/str","/ev",{"*":".^.c-0","flg":4},{"c-0":["^ ",{"->":"TestKnot2"},"\n",{"#f":5}]}],{"#f":1}],"TestKnot2":["^this is the end","\n","end",{"#f":1}],"#f":1}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[["done",{"#f":5,"#n":"g-0"}],null],"done",{"TestKnot":[["^this is a test","\n","ev","str","^Next","/str","/ev",{"*":".^.c-0","flg":4},{"c-0":["^ ",{"->":"TestKnot2"},"\n",{"#f":5}]}],{"#f":1}],"TestKnot2":["^this is the end","\n","end",{"#f":1}],"#f":1}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/callstack/callstack_evaluation.ink.json b/test/fixture/compiled/runtime/callstack/callstack_evaluation.ink.json index 1a6445af..78746ee3 100644 --- a/test/fixture/compiled/runtime/callstack/callstack_evaluation.ink.json +++ b/test/fixture/compiled/runtime/callstack/callstack_evaluation.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",{"f()":"six"},{"f()":"two"},"+","out","/ev","\n","end",["done",{"#n":"g-0"}],null],"done",{"six":["ev",{"f()":"four"},{"f()":"two"},"+","/ev","~ret","\n",null],"four":["ev",{"f()":"two"},{"f()":"two"},"+","/ev","~ret","\n",null],"two":["ev",2,"/ev","~ret",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",{"f()":"six"},{"f()":"two"},"+","out","/ev","\n","end",["done",{"#n":"g-0"}],null],"done",{"six":["ev",{"f()":"four"},{"f()":"two"},"+","/ev","~ret","\n",null],"four":["ev",{"f()":"two"},{"f()":"two"},"+","/ev","~ret","\n",null],"two":["ev",2,"/ev","~ret",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/callstack/clean_callstack_reset_on_path_choice.ink.json b/test/fixture/compiled/runtime/callstack/clean_callstack_reset_on_path_choice.ink.json index 6eaf78aa..c9055a5d 100644 --- a/test/fixture/compiled/runtime/callstack/clean_callstack_reset_on_path_choice.ink.json +++ b/test/fixture/compiled/runtime/callstack/clean_callstack_reset_on_path_choice.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",{"f()":"RunAThing"},"out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"RunAThing":["^The first line.","\n","^The second line.","\n",null],"SomewhereElse":["ev","str","^somewhere else","/str","out","/ev","\n","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",{"f()":"RunAThing"},"out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"RunAThing":["^The first line.","\n","^The second line.","\n",null],"SomewhereElse":["ev","str","^somewhere else","/str","out","/ev","\n","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/choices/choice_count.ink.json b/test/fixture/compiled/runtime/choices/choice_count.ink.json index 29217e22..09eb716a 100644 --- a/test/fixture/compiled/runtime/choices/choice_count.ink.json +++ b/test/fixture/compiled/runtime/choices/choice_count.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["thread",{"->":"choices"},"ev","choiceCnt","out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"end":["end",null],"choices":[[["ev",{"^->":"choices.0.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^one ",{"->":"$r","var":true},null]}],["ev",{"^->":"choices.0.1.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-1","flg":18},{"s":["^two ",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"choices.0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.0.s"},[{"#n":"$r2"}],{"->":"end"},"\n",{"#f":5}],"c-1":["ev",{"^->":"choices.0.c-1.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.1.s"},[{"#n":"$r2"}],{"->":"end"},"\n",{"#f":5}]}],null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["thread",{"->":"choices"},"ev","choiceCnt","out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"end":["end",null],"choices":[[["ev",{"^->":"choices.0.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^one ",{"->":"$r","var":true},null]}],["ev",{"^->":"choices.0.1.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-1","flg":18},{"s":["^two ",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"choices.0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.0.s"},[{"#n":"$r2"}],{"->":"end"},"\n",{"#f":5}],"c-1":["ev",{"^->":"choices.0.c-1.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.1.s"},[{"#n":"$r2"}],{"->":"end"},"\n",{"#f":5}]}],null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/choices/choice_diverts_to_done.ink.json b/test/fixture/compiled/runtime/choices/choice_diverts_to_done.ink.json index b9e8bbde..4dcb982c 100644 --- a/test/fixture/compiled/runtime/choices/choice_diverts_to_done.ink.json +++ b/test/fixture/compiled/runtime/choices/choice_diverts_to_done.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[["ev",{"^->":"0.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":"0.c-0","flg":18},{"s":["^choice ",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":"0.0.s"},[{"#n":"$r2"}],"done","\n",{"->":"0.g-0"},{"#f":5}],"g-0":["done",null]}],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[["ev",{"^->":"0.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":"0.c-0","flg":18},{"s":["^choice ",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":"0.0.s"},[{"#n":"$r2"}],"done","\n",{"->":"0.g-0"},{"#f":5}],"g-0":["done",null]}],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/choices/choice_thread_forking.ink.json b/test/fixture/compiled/runtime/choices/choice_thread_forking.ink.json index 7d7cbe8b..555df293 100644 --- a/test/fixture/compiled/runtime/choices/choice_thread_forking.ink.json +++ b/test/fixture/compiled/runtime/choices/choice_thread_forking.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",1,"/ev",{"->t->":"generate_choice"},["done",{"#n":"g-0"}],null],"done",{"generate_choice":[{"temp=":"x"},"ev",true,"/ev",[{"->":".^.b","c":true},{"b":["\n",["ev",{"^->":"generate_choice.4.b.1.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":2},{"s":["^A choice",{"->":"$r","var":true},null]}],{"->":".^.^.^.5"},{"c-0":["ev",{"^->":"generate_choice.4.b.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.1.s"},[{"#n":"$r2"}],"\n","^Vaue of local var is: ","ev",{"VAR?":"x"},"out","/ev","\n","end",null]}]}],"nop","\n","ev","void","/ev","->->",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",1,"/ev",{"->t->":"generate_choice"},["done",{"#n":"g-0"}],null],"done",{"generate_choice":[{"temp=":"x"},"ev",true,"/ev",[{"->":".^.b","c":true},{"b":["\n",["ev",{"^->":"generate_choice.4.b.1.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":2},{"s":["^A choice",{"->":"$r","var":true},null]}],{"->":".^.^.^.5"},{"c-0":["ev",{"^->":"generate_choice.4.b.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.1.s"},[{"#n":"$r2"}],"\n","^Vaue of local var is: ","ev",{"VAR?":"x"},"out","/ev","\n","end",null]}]}],"nop","\n","ev","void","/ev","->->",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/choices/choice_with_brackets_only.ink.json b/test/fixture/compiled/runtime/choices/choice_with_brackets_only.ink.json index 5d986da0..e36e0af5 100644 --- a/test/fixture/compiled/runtime/choices/choice_with_brackets_only.ink.json +++ b/test/fixture/compiled/runtime/choices/choice_with_brackets_only.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev","str","^Option","/str","/ev",{"*":"0.c-0","flg":20},{"c-0":["\n","^Text","\n",{"->":"0.g-0"},{"#f":5}],"g-0":["done",null]}],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev","str","^Option","/str","/ev",{"*":"0.c-0","flg":20},{"c-0":["\n","^Text","\n",{"->":"0.g-0"},{"#f":5}],"g-0":["done",null]}],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/choices/conditional_choices.ink.json b/test/fixture/compiled/runtime/choices/conditional_choices.ink.json index 9748d1ad..80585667 100644 --- a/test/fixture/compiled/runtime/choices/conditional_choices.ink.json +++ b/test/fixture/compiled/runtime/choices/conditional_choices.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[["ev",{"^->":"0.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str",true,false,"&&","/ev",{"*":"0.c-0","flg":19},{"s":["^not displayed",{"->":"$r","var":true},null]}],["ev",{"^->":"0.1.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str",true,true,"&&",true,true,"&&","&&","/ev",{"*":"0.c-1","flg":19},{"s":["^one",{"->":"$r","var":true},null]}],["ev",{"^->":"0.2.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str",false,"/ev",{"*":"0.c-2","flg":19},{"s":["^not displayed",{"->":"$r","var":true},null]}],["ev",{"^->":"0.3.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str",true,"/ev",{"*":"0.c-3","flg":19},{"s":["^two",{"->":"$r","var":true},null]}],["ev",{"^->":"0.4.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str",true,true,"&&","/ev",{"*":"0.c-4","flg":19},{"s":["^three",{"->":"$r","var":true},null]}],["ev",{"^->":"0.5.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str",true,"/ev",{"*":"0.c-5","flg":19},{"s":["^four",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":"0.0.s"},[{"#n":"$r2"}],"\n",{"->":"0.g-0"},{"#f":5}],"c-1":["ev",{"^->":"0.c-1.$r2"},"/ev",{"temp=":"$r"},{"->":"0.1.s"},[{"#n":"$r2"}],"\n",{"->":"0.g-0"},{"#f":5}],"c-2":["ev",{"^->":"0.c-2.$r2"},"/ev",{"temp=":"$r"},{"->":"0.2.s"},[{"#n":"$r2"}],"\n",{"->":"0.g-0"},{"#f":5}],"c-3":["ev",{"^->":"0.c-3.$r2"},"/ev",{"temp=":"$r"},{"->":"0.3.s"},[{"#n":"$r2"}],"\n",{"->":"0.g-0"},{"#f":5}],"c-4":["ev",{"^->":"0.c-4.$r2"},"/ev",{"temp=":"$r"},{"->":"0.4.s"},[{"#n":"$r2"}],"\n",{"->":"0.g-0"},{"#f":5}],"c-5":["ev",{"^->":"0.c-5.$r2"},"/ev",{"temp=":"$r"},{"->":"0.5.s"},[{"#n":"$r2"}],"\n",{"->":"0.g-0"},{"#f":5}],"g-0":["done",null]}],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[["ev",{"^->":"0.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str",true,false,"&&","/ev",{"*":"0.c-0","flg":19},{"s":["^not displayed",{"->":"$r","var":true},null]}],["ev",{"^->":"0.1.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str",true,true,"&&",true,true,"&&","&&","/ev",{"*":"0.c-1","flg":19},{"s":["^one",{"->":"$r","var":true},null]}],["ev",{"^->":"0.2.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str",false,"/ev",{"*":"0.c-2","flg":19},{"s":["^not displayed",{"->":"$r","var":true},null]}],["ev",{"^->":"0.3.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str",true,"/ev",{"*":"0.c-3","flg":19},{"s":["^two",{"->":"$r","var":true},null]}],["ev",{"^->":"0.4.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str",true,true,"&&","/ev",{"*":"0.c-4","flg":19},{"s":["^three",{"->":"$r","var":true},null]}],["ev",{"^->":"0.5.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str",true,"/ev",{"*":"0.c-5","flg":19},{"s":["^four",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":"0.0.s"},[{"#n":"$r2"}],"\n",{"->":"0.g-0"},{"#f":5}],"c-1":["ev",{"^->":"0.c-1.$r2"},"/ev",{"temp=":"$r"},{"->":"0.1.s"},[{"#n":"$r2"}],"\n",{"->":"0.g-0"},{"#f":5}],"c-2":["ev",{"^->":"0.c-2.$r2"},"/ev",{"temp=":"$r"},{"->":"0.2.s"},[{"#n":"$r2"}],"\n",{"->":"0.g-0"},{"#f":5}],"c-3":["ev",{"^->":"0.c-3.$r2"},"/ev",{"temp=":"$r"},{"->":"0.3.s"},[{"#n":"$r2"}],"\n",{"->":"0.g-0"},{"#f":5}],"c-4":["ev",{"^->":"0.c-4.$r2"},"/ev",{"temp=":"$r"},{"->":"0.4.s"},[{"#n":"$r2"}],"\n",{"->":"0.g-0"},{"#f":5}],"c-5":["ev",{"^->":"0.c-5.$r2"},"/ev",{"temp=":"$r"},{"->":"0.5.s"},[{"#n":"$r2"}],"\n",{"->":"0.g-0"},{"#f":5}],"g-0":["done",null]}],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/choices/default_choices.ink.json b/test/fixture/compiled/runtime/choices/default_choices.ink.json index e592497e..504137a5 100644 --- a/test/fixture/compiled/runtime/choices/default_choices.ink.json +++ b/test/fixture/compiled/runtime/choices/default_choices.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[["ev","str","^Choice 1","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Choice 2","/str","/ev",{"*":".^.c-1","flg":20},["ev",{"^->":"0.start.12.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str",false,"/ev",{"*":".^.^.c-2","flg":19},{"s":["^Impossible choice",{"->":"$r","var":true},null]}],{"*":".^.c-3","flg":24},{"c-0":["\n",{"->":"0.g-0"},{"#f":5}],"c-1":["\n",{"->":"0.g-0"},{"#f":5}],"c-2":["ev",{"^->":"0.start.c-2.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.12.s"},[{"#n":"$r2"}],"\n",{"->":"0.g-0"},{"#f":5}],"c-3":[{"->":"default"},"\n",{"->":"0.g-0"},{"#f":5}],"#n":"start"}],{"g-0":["^After choice","\n",{"->":"0.start"},["done",{"#n":"g-1"}],null]}],"done",{"default":["^This is default.","\n","done",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[["ev","str","^Choice 1","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Choice 2","/str","/ev",{"*":".^.c-1","flg":20},["ev",{"^->":"0.start.12.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str",false,"/ev",{"*":".^.^.c-2","flg":19},{"s":["^Impossible choice",{"->":"$r","var":true},null]}],{"*":".^.c-3","flg":24},{"c-0":["\n",{"->":"0.g-0"},{"#f":5}],"c-1":["\n",{"->":"0.g-0"},{"#f":5}],"c-2":["ev",{"^->":"0.start.c-2.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.12.s"},[{"#n":"$r2"}],"\n",{"->":"0.g-0"},{"#f":5}],"c-3":[{"->":"default"},"\n",{"->":"0.g-0"},{"#f":5}],"#n":"start"}],{"g-0":["^After choice","\n",{"->":"0.start"},["done",{"#n":"g-1"}],null]}],"done",{"default":["^This is default.","\n","done",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/choices/default_simple_gather.ink.json b/test/fixture/compiled/runtime/choices/default_simple_gather.ink.json index 884f0755..c13eeb58 100644 --- a/test/fixture/compiled/runtime/choices/default_simple_gather.ink.json +++ b/test/fixture/compiled/runtime/choices/default_simple_gather.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[{"*":"0.c-0","flg":24},{"c-0":["\n",{"->":"0.g-0"},{"#f":5}],"g-0":["^x","\n","done",["done",{"#n":"g-1"}],null]}],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[{"*":"0.c-0","flg":24},{"c-0":["\n",{"->":"0.g-0"},{"#f":5}],"g-0":["^x","\n","done",["done",{"#n":"g-1"}],null]}],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/choices/fallback_choice_on_thread.ink.json b/test/fixture/compiled/runtime/choices/fallback_choice_on_thread.ink.json index 261bed33..a6885663 100644 --- a/test/fixture/compiled/runtime/choices/fallback_choice_on_thread.ink.json +++ b/test/fixture/compiled/runtime/choices/fallback_choice_on_thread.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["thread",{"->":"knot"},["done",{"#n":"g-0"}],null],"done",{"knot":[["ev",1,"/ev",{"temp=":"x"},{"*":".^.c-0","flg":24},{"c-0":["\n","^Should be 1 not 0: ","ev",{"VAR?":"x"},"out","/ev","^.","\n","done",{"#f":5}]}],null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["thread",{"->":"knot"},["done",{"#n":"g-0"}],null],"done",{"knot":[["ev",1,"/ev",{"temp=":"x"},{"*":".^.c-0","flg":24},{"c-0":["\n","^Should be 1 not 0: ","ev",{"VAR?":"x"},"out","/ev","^.","\n","done",{"#f":5}]}],null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/choices/gather_choice_same_line.ink.json b/test/fixture/compiled/runtime/choices/gather_choice_same_line.ink.json index 7546e699..2922db2d 100644 --- a/test/fixture/compiled/runtime/choices/gather_choice_same_line.ink.json +++ b/test/fixture/compiled/runtime/choices/gather_choice_same_line.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[[["ev",{"^->":"0.g-0.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^hello",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"0.g-0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.0.s"},[{"#n":"$r2"}],"\n",{"->":"0.g-1"},{"#f":5}],"#n":"g-0"}],{"g-1":[["ev",{"^->":"0.g-1.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-1","flg":18},{"s":["^world",{"->":"$r","var":true},null]}],{"c-1":["ev",{"^->":"0.g-1.c-1.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.0.s"},[{"#n":"$r2"}],"\n",{"->":"0.g-2"},{"#f":5}]}],"g-2":["done",null]}],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[[["ev",{"^->":"0.g-0.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^hello",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"0.g-0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.0.s"},[{"#n":"$r2"}],"\n",{"->":"0.g-1"},{"#f":5}],"#n":"g-0"}],{"g-1":[["ev",{"^->":"0.g-1.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-1","flg":18},{"s":["^world",{"->":"$r","var":true},null]}],{"c-1":["ev",{"^->":"0.g-1.c-1.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.0.s"},[{"#n":"$r2"}],"\n",{"->":"0.g-2"},{"#f":5}]}],"g-2":["done",null]}],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/choices/has_read_on_choice.ink.json b/test/fixture/compiled/runtime/choices/has_read_on_choice.ink.json index 5e62a49e..82f0d983 100644 --- a/test/fixture/compiled/runtime/choices/has_read_on_choice.ink.json +++ b/test/fixture/compiled/runtime/choices/has_read_on_choice.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[["ev",{"^->":"0.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str",{"CNT?":"test"},"!","/ev",{"*":"0.c-0","flg":19},{"s":["^visible choice",{"->":"$r","var":true},null]}],["ev",{"^->":"0.1.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str",{"CNT?":"test"},"/ev",{"*":"0.c-1","flg":19},{"s":["^visible choice",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":"0.0.s"},[{"#n":"$r2"}],"\n",{"->":"0.g-0"},{"#f":5}],"c-1":["ev",{"^->":"0.c-1.$r2"},"/ev",{"temp=":"$r"},{"->":"0.1.s"},[{"#n":"$r2"}],"\n",{"->":"0.g-0"},{"#f":5}],"g-0":["done",null]}],"done",{"test":["end",{"#f":1}]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[["ev",{"^->":"0.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str",{"CNT?":"test"},"!","/ev",{"*":"0.c-0","flg":19},{"s":["^visible choice",{"->":"$r","var":true},null]}],["ev",{"^->":"0.1.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str",{"CNT?":"test"},"/ev",{"*":"0.c-1","flg":19},{"s":["^visible choice",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":"0.0.s"},[{"#n":"$r2"}],"\n",{"->":"0.g-0"},{"#f":5}],"c-1":["ev",{"^->":"0.c-1.$r2"},"/ev",{"temp=":"$r"},{"->":"0.1.s"},[{"#n":"$r2"}],"\n",{"->":"0.g-0"},{"#f":5}],"g-0":["done",null]}],"done",{"test":["end",{"#f":1}]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/choices/logic_in_choices.ink.json b/test/fixture/compiled/runtime/choices/logic_in_choices.ink.json index c4654187..bb6f43e5 100644 --- a/test/fixture/compiled/runtime/choices/logic_in_choices.ink.json +++ b/test/fixture/compiled/runtime/choices/logic_in_choices.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[["ev",{"^->":"0.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","str","^, your name is ","ev",{"f()":"name"},"out","/ev","^.'","/str","/ev",{"*":"0.c-0","flg":22},{"s":["^'Hello ","ev",{"f()":"name"},"out","/ev",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":"0.0.s"},[{"#n":"$r2"}],"^,' I said, knowing full well that his name was ","ev",{"f()":"name"},"out","/ev","^.","\n","done",{"->":"0.g-0"},{"#f":5}],"g-0":["done",null]}],"done",{"name":["^Joe","\n",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[["ev",{"^->":"0.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","str","^, your name is ","ev",{"f()":"name"},"out","/ev","^.'","/str","/ev",{"*":"0.c-0","flg":22},{"s":["^'Hello ","ev",{"f()":"name"},"out","/ev",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":"0.0.s"},[{"#n":"$r2"}],"^,' I said, knowing full well that his name was ","ev",{"f()":"name"},"out","/ev","^.","\n","done",{"->":"0.g-0"},{"#f":5}],"g-0":["done",null]}],"done",{"name":["^Joe","\n",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/choices/non_text_in_choice_inner_content.ink.json b/test/fixture/compiled/runtime/choices/non_text_in_choice_inner_content.ink.json index 83d066e7..2e7c3b86 100644 --- a/test/fixture/compiled/runtime/choices/non_text_in_choice_inner_content.ink.json +++ b/test/fixture/compiled/runtime/choices/non_text_in_choice_inner_content.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[{"->":"knot"},["done",{"#n":"g-0"}],null],"done",{"knot":[[["ev",{"^->":"knot.0.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^option text",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"knot.0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.0.s"},[{"#n":"$r2"}],"^. ","ev",true,"/ev",[{"->":".^.b","c":true},{"b":["^ Conditional bit.",{"->":".^.^.^.11"},null]}],"nop","^ ",{"->":"next"},"\n","done",{"#f":5}]}],null],"next":["^Next.","\n","done",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[{"->":"knot"},["done",{"#n":"g-0"}],null],"done",{"knot":[[["ev",{"^->":"knot.0.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^option text",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"knot.0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.0.s"},[{"#n":"$r2"}],"^. ","ev",true,"/ev",[{"->":".^.b","c":true},{"b":["^ Conditional bit.",{"->":".^.^.^.11"},null]}],"nop","^ ",{"->":"next"},"\n","done",{"#f":5}]}],null],"next":["^Next.","\n","done",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/choices/once_only_choices_can_link_back_to_self.ink.json b/test/fixture/compiled/runtime/choices/once_only_choices_can_link_back_to_self.ink.json index 38246d89..072ebeb7 100644 --- a/test/fixture/compiled/runtime/choices/once_only_choices_can_link_back_to_self.ink.json +++ b/test/fixture/compiled/runtime/choices/once_only_choices_can_link_back_to_self.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[{"->":"opts"},["done",{"#n":"g-0"}],null],"done",{"opts":[["ev","str","^First choice","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Second choice","/str",{"CNT?":".^.c-0"},"/ev",{"*":".^.c-1","flg":21},{"*":".^.c-2","flg":24},{"c-0":["^ ",{"->":"opts"},"\n",{"->":".^.^.end"},{"#f":5}],"c-1":["^ ",{"->":"opts"},"\n",{"->":".^.^.end"},{"#f":5}],"c-2":[{"->":".^.^.end"},"\n",{"->":".^.^.end"},{"#f":5}],"end":["end",null]}],null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[{"->":"opts"},["done",{"#n":"g-0"}],null],"done",{"opts":[["ev","str","^First choice","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Second choice","/str",{"CNT?":".^.c-0"},"/ev",{"*":".^.c-1","flg":21},{"*":".^.c-2","flg":24},{"c-0":["^ ",{"->":"opts"},"\n",{"->":".^.^.end"},{"#f":5}],"c-1":["^ ",{"->":"opts"},"\n",{"->":".^.^.end"},{"#f":5}],"c-2":[{"->":".^.^.end"},"\n",{"->":".^.^.end"},{"#f":5}],"end":["end",null]}],null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/choices/once_only_choices_with_own_content.ink.json b/test/fixture/compiled/runtime/choices/once_only_choices_with_own_content.ink.json index 894d445c..763054ea 100644 --- a/test/fixture/compiled/runtime/choices/once_only_choices_with_own_content.ink.json +++ b/test/fixture/compiled/runtime/choices/once_only_choices_with_own_content.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[{"->":"home"},["done",{"#n":"g-0"}],null],"done",{"home":["ev",{"VAR?":"times"},1,"-","/ev",{"VAR=":"times","re":true},"ev",{"VAR?":"times"},0,">=","/ev",[{"->":".^.b","c":true},{"b":[{"->":"eat"},{"->":"home.12"},null]}],"nop","\n","^I've finished eating now.","\n","end",null],"eat":[["^This is the ",["ev","visit",2,"MIN","/ev","ev","du",0,"==","/ev",{"->":".^.s0","c":true},"ev","du",1,"==","/ev",{"->":".^.s1","c":true},"ev","du",2,"==","/ev",{"->":".^.s2","c":true},"nop",{"s0":["pop","^first",{"->":".^.^.23"},null],"s1":["pop","^second",{"->":".^.^.23"},null],"s2":["pop","^third",{"->":".^.^.23"},null],"#f":5}],"^ time.","\n",["ev",{"^->":"eat.0.4.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^Eat ice-cream",{"->":"$r","var":true},null]}],["ev",{"^->":"eat.0.5.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-1","flg":18},{"s":["^Drink coke",{"->":"$r","var":true},null]}],["ev",{"^->":"eat.0.6.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-2","flg":18},{"s":["^Munch cookies",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"eat.0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.4.s"},[{"#n":"$r2"}],"\n",{"->":".^.^.g-0"},{"#f":5}],"c-1":["ev",{"^->":"eat.0.c-1.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.5.s"},[{"#n":"$r2"}],"\n",{"->":".^.^.g-0"},{"#f":5}],"c-2":["ev",{"^->":"eat.0.c-2.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.6.s"},[{"#n":"$r2"}],"\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":[{"->":"home"},null]}],null],"global decl":["ev",3,{"VAR=":"times"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[{"->":"home"},["done",{"#n":"g-0"}],null],"done",{"home":["ev",{"VAR?":"times"},1,"-","/ev",{"VAR=":"times","re":true},"ev",{"VAR?":"times"},0,">=","/ev",[{"->":".^.b","c":true},{"b":[{"->":"eat"},{"->":"home.12"},null]}],"nop","\n","^I've finished eating now.","\n","end",null],"eat":[["^This is the ",["ev","visit",2,"MIN","/ev","ev","du",0,"==","/ev",{"->":".^.s0","c":true},"ev","du",1,"==","/ev",{"->":".^.s1","c":true},"ev","du",2,"==","/ev",{"->":".^.s2","c":true},"nop",{"s0":["pop","^first",{"->":".^.^.23"},null],"s1":["pop","^second",{"->":".^.^.23"},null],"s2":["pop","^third",{"->":".^.^.23"},null],"#f":5}],"^ time.","\n",["ev",{"^->":"eat.0.4.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^Eat ice-cream",{"->":"$r","var":true},null]}],["ev",{"^->":"eat.0.5.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-1","flg":18},{"s":["^Drink coke",{"->":"$r","var":true},null]}],["ev",{"^->":"eat.0.6.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-2","flg":18},{"s":["^Munch cookies",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"eat.0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.4.s"},[{"#n":"$r2"}],"\n",{"->":".^.^.g-0"},{"#f":5}],"c-1":["ev",{"^->":"eat.0.c-1.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.5.s"},[{"#n":"$r2"}],"\n",{"->":".^.^.g-0"},{"#f":5}],"c-2":["ev",{"^->":"eat.0.c-2.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.6.s"},[{"#n":"$r2"}],"\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":[{"->":"home"},null]}],null],"global decl":["ev",3,{"VAR=":"times"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/choices/should_not_gather_due_to_choice.ink.json b/test/fixture/compiled/runtime/choices/should_not_gather_due_to_choice.ink.json index e2f33086..a26d0f12 100644 --- a/test/fixture/compiled/runtime/choices/should_not_gather_due_to_choice.ink.json +++ b/test/fixture/compiled/runtime/choices/should_not_gather_due_to_choice.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[["ev",{"^->":"0.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":"0.c-0","flg":18},{"s":["^opt",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":"0.0.s"},[{"#n":"$r2"}],"\n",[["^text","\n",["ev",{"^->":"0.c-0.7.g-0.2.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str",false,"/ev",{"*":".^.^.c-0","flg":19},{"s":["^impossible",{"->":"$r","var":true},null]}],{"*":".^.c-1","flg":24},{"c-0":["ev",{"^->":"0.c-0.7.g-0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.2.s"},[{"#n":"$r2"}],"\n",{"->":"0.g-0"},{"#f":5}],"c-1":["end","\n",{"->":"0.g-0"},{"#f":5}],"#n":"g-0"}],null],{"#f":5}],"g-0":["^gather","\n",["done",{"#n":"g-1"}],null]}],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[["ev",{"^->":"0.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":"0.c-0","flg":18},{"s":["^opt",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":"0.0.s"},[{"#n":"$r2"}],"\n",[["^text","\n",["ev",{"^->":"0.c-0.7.g-0.2.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str",false,"/ev",{"*":".^.^.c-0","flg":19},{"s":["^impossible",{"->":"$r","var":true},null]}],{"*":".^.c-1","flg":24},{"c-0":["ev",{"^->":"0.c-0.7.g-0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.2.s"},[{"#n":"$r2"}],"\n",{"->":"0.g-0"},{"#f":5}],"c-1":["end","\n",{"->":"0.g-0"},{"#f":5}],"#n":"g-0"}],null],{"#f":5}],"g-0":["^gather","\n",["done",{"#n":"g-1"}],null]}],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/choices/state_rollback_over_default_choice.ink.json b/test/fixture/compiled/runtime/choices/state_rollback_over_default_choice.ink.json index 5ac98dcf..15ba5826 100644 --- a/test/fixture/compiled/runtime/choices/state_rollback_over_default_choice.ink.json +++ b/test/fixture/compiled/runtime/choices/state_rollback_over_default_choice.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["thread",{"->":"make_default_choice"},"^Text.","\n",["done",{"#n":"g-0"}],null],"done",{"make_default_choice":[[{"*":".^.c-0","flg":24},{"c-0":["\n","ev",5,"out","/ev","\n","end",{"#f":5}]}],null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["thread",{"->":"make_default_choice"},"^Text.","\n",["done",{"#n":"g-0"}],null],"done",{"make_default_choice":[[{"*":".^.c-0","flg":24},{"c-0":["\n","ev",5,"out","/ev","\n","end",{"#f":5}]}],null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/choices/sticky_choices_stay_sticky.ink.json b/test/fixture/compiled/runtime/choices/sticky_choices_stay_sticky.ink.json index 5a16b5cd..c10e1624 100644 --- a/test/fixture/compiled/runtime/choices/sticky_choices_stay_sticky.ink.json +++ b/test/fixture/compiled/runtime/choices/sticky_choices_stay_sticky.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[{"->":"test"},["done",{"#n":"g-0"}],null],"done",{"test":[["^First line.","\n","^Second line.","\n",["ev",{"^->":"test.0.4.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":2},{"s":["^Choice 1",{"->":"$r","var":true},null]}],["ev",{"^->":"test.0.5.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-1","flg":2},{"s":["^Choice 2",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"test.0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.4.s"},[{"#n":"$r2"}],"\n",{"->":".^.^.g-0"},null],"c-1":["ev",{"^->":"test.0.c-1.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.5.s"},[{"#n":"$r2"}],"\n",{"->":".^.^.g-0"},null],"g-0":[{"->":"test"},null]}],null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[{"->":"test"},["done",{"#n":"g-0"}],null],"done",{"test":[["^First line.","\n","^Second line.","\n",["ev",{"^->":"test.0.4.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":2},{"s":["^Choice 1",{"->":"$r","var":true},null]}],["ev",{"^->":"test.0.5.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-1","flg":2},{"s":["^Choice 2",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"test.0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.4.s"},[{"#n":"$r2"}],"\n",{"->":".^.^.g-0"},null],"c-1":["ev",{"^->":"test.0.c-1.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.5.s"},[{"#n":"$r2"}],"\n",{"->":".^.^.g-0"},null],"g-0":[{"->":"test"},null]}],null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/choices/various_default_choices.ink.json b/test/fixture/compiled/runtime/choices/various_default_choices.ink.json index d6c80028..296787f3 100644 --- a/test/fixture/compiled/runtime/choices/various_default_choices.ink.json +++ b/test/fixture/compiled/runtime/choices/various_default_choices.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[{"*":"0.c-0","flg":24},{"c-0":[{"->":"0.hello"},"\n","^Unreachable","\n",{"->":"0.hello"},{"#f":5}],"hello":["^1","\n",{"*":".^.c-1","flg":24},{"c-1":["\n",[["^2","\n",{"->":"0.g-0"},{"#n":"g-0"}],null],{"#f":5}]}],"g-0":["^3","\n","end",["done",{"#n":"g-1"}],null]}],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[{"*":"0.c-0","flg":24},{"c-0":[{"->":"0.hello"},"\n","^Unreachable","\n",{"->":"0.hello"},{"#f":5}],"hello":["^1","\n",{"*":".^.c-1","flg":24},{"c-1":["\n",[["^2","\n",{"->":"0.g-0"},{"#n":"g-0"}],null],{"#f":5}]}],"g-0":["^3","\n","end",["done",{"#n":"g-1"}],null]}],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/conditions/all_switch_branches_fail_is_clean.ink.json b/test/fixture/compiled/runtime/conditions/all_switch_branches_fail_is_clean.ink.json index 0214a315..9e193542 100644 --- a/test/fixture/compiled/runtime/conditions/all_switch_branches_fail_is_clean.ink.json +++ b/test/fixture/compiled/runtime/conditions/all_switch_branches_fail_is_clean.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",1,"/ev",["du","ev",2,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^x","\n",{"->":"0.6"},null]}],["du","ev",3,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^y","\n",{"->":"0.6"},null]}],"pop","nop","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",1,"/ev",["du","ev",2,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^x","\n",{"->":"0.6"},null]}],["du","ev",3,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^y","\n",{"->":"0.6"},null]}],"pop","nop","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/conditions/conditionals.ink.json b/test/fixture/compiled/runtime/conditions/conditionals.ink.json index 24f6f727..d8c15c63 100644 --- a/test/fixture/compiled/runtime/conditions/conditionals.ink.json +++ b/test/fixture/compiled/runtime/conditions/conditionals.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",false,"/ev",[{"->":".^.b","c":true},{"b":["^not true",{"->":"0.5"},null]}],[{"->":".^.b"},{"b":["^true",{"->":"0.5"},null]}],"nop","\n",["ev",4,5,">","/ev",{"->":".^.b","c":true},{"b":["\n","^not true","\n",{"->":"0.9"},null]}],["ev",5,4,">","/ev",{"->":".^.b","c":true},{"b":["\n","^true","\n",{"->":"0.9"},null]}],"nop","\n","ev",2,2,"*",3,">","/ev",[{"->":".^.b","c":true},{"b":["\n","^true","\n",{"->":"0.20"},null]}],[{"->":".^.b"},{"b":["\n","^not true","\n",{"->":"0.20"},null]}],"nop","\n",["ev",1,3,">","/ev",{"->":".^.b","c":true},{"b":["\n","^not true","\n",{"->":"0.24"},null]}],[{"->":".^.b"},{"b":["\n","ev",2,2,"+",4,"==","/ev",[{"->":".^.b","c":true},{"b":["\n","^true","\n",{"->":"0.23.b.10"},null]}],[{"->":".^.b"},{"b":["\n","^not true","\n",{"->":"0.23.b.10"},null]}],"nop","\n",{"->":"0.24"},null]}],"nop","\n","ev",2,3,"*","/ev",["du","ev",1,7,"+","==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^not true","\n",{"->":"0.36"},null]}],["du","ev",9,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^not true","\n",{"->":"0.36"},null]}],["du","ev",1,1,"+",1,"+",3,"+","==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^true","\n",{"->":"0.36"},null]}],["du","ev",9,3,"-","==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^also true but not printed","\n",{"->":"0.36"},null]}],"pop","nop","\n","ev",true,"/ev",[{"->":".^.b","c":true},{"b":["\n","^great","\n","^right?","\n",{"->":"0.42"},null]}],"nop","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",false,"/ev",[{"->":".^.b","c":true},{"b":["^not true",{"->":"0.5"},null]}],[{"->":".^.b"},{"b":["^true",{"->":"0.5"},null]}],"nop","\n",["ev",4,5,">","/ev",{"->":".^.b","c":true},{"b":["\n","^not true","\n",{"->":"0.9"},null]}],["ev",5,4,">","/ev",{"->":".^.b","c":true},{"b":["\n","^true","\n",{"->":"0.9"},null]}],"nop","\n","ev",2,2,"*",3,">","/ev",[{"->":".^.b","c":true},{"b":["\n","^true","\n",{"->":"0.20"},null]}],[{"->":".^.b"},{"b":["\n","^not true","\n",{"->":"0.20"},null]}],"nop","\n",["ev",1,3,">","/ev",{"->":".^.b","c":true},{"b":["\n","^not true","\n",{"->":"0.24"},null]}],[{"->":".^.b"},{"b":["\n","ev",2,2,"+",4,"==","/ev",[{"->":".^.b","c":true},{"b":["\n","^true","\n",{"->":"0.23.b.10"},null]}],[{"->":".^.b"},{"b":["\n","^not true","\n",{"->":"0.23.b.10"},null]}],"nop","\n",{"->":"0.24"},null]}],"nop","\n","ev",2,3,"*","/ev",["du","ev",1,7,"+","==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^not true","\n",{"->":"0.36"},null]}],["du","ev",9,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^not true","\n",{"->":"0.36"},null]}],["du","ev",1,1,"+",1,"+",3,"+","==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^true","\n",{"->":"0.36"},null]}],["du","ev",9,3,"-","==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^also true but not printed","\n",{"->":"0.36"},null]}],"pop","nop","\n","ev",true,"/ev",[{"->":".^.b","c":true},{"b":["\n","^great","\n","^right?","\n",{"->":"0.42"},null]}],"nop","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/conditions/else_branches.ink.json b/test/fixture/compiled/runtime/conditions/else_branches.ink.json index 4eae02f1..a0ace4e3 100644 --- a/test/fixture/compiled/runtime/conditions/else_branches.ink.json +++ b/test/fixture/compiled/runtime/conditions/else_branches.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[["ev",{"VAR?":"x"},1,"==","/ev",{"->":".^.b","c":true},{"b":["\n","^one","\n",{"->":"0.3"},null]}],["ev",{"VAR?":"x"},2,"==","/ev",{"->":".^.b","c":true},{"b":["\n","^two","\n",{"->":"0.3"},null]}],[{"->":".^.b"},{"b":["\n","^other","\n",{"->":"0.3"},null]}],"nop","\n",["ev",{"VAR?":"x"},1,"==","/ev",{"->":".^.b","c":true},{"b":["\n","^one","\n",{"->":"0.8"},null]}],["ev",{"VAR?":"x"},2,"==","/ev",{"->":".^.b","c":true},{"b":["\n","^two","\n",{"->":"0.8"},null]}],[{"->":".^.b"},{"b":["\n","^other","\n",{"->":"0.8"},null]}],"nop","\n","ev",{"VAR?":"x"},4,"==","/ev",[{"->":".^.b","c":true},{"b":["\n","^The main clause","\n",{"->":"0.17"},null]}],[{"->":".^.b"},{"b":["\n","^other","\n",{"->":"0.17"},null]}],"nop","\n","ev",{"VAR?":"x"},4,"==","/ev",[{"->":".^.b","c":true},{"b":["\n","^The main clause","\n",{"->":"0.26"},null]}],[{"->":".^.b"},{"b":["\n","^other","\n",{"->":"0.26"},null]}],"nop","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev",3,{"VAR=":"x"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[["ev",{"VAR?":"x"},1,"==","/ev",{"->":".^.b","c":true},{"b":["\n","^one","\n",{"->":"0.3"},null]}],["ev",{"VAR?":"x"},2,"==","/ev",{"->":".^.b","c":true},{"b":["\n","^two","\n",{"->":"0.3"},null]}],[{"->":".^.b"},{"b":["\n","^other","\n",{"->":"0.3"},null]}],"nop","\n",["ev",{"VAR?":"x"},1,"==","/ev",{"->":".^.b","c":true},{"b":["\n","^one","\n",{"->":"0.8"},null]}],["ev",{"VAR?":"x"},2,"==","/ev",{"->":".^.b","c":true},{"b":["\n","^two","\n",{"->":"0.8"},null]}],[{"->":".^.b"},{"b":["\n","^other","\n",{"->":"0.8"},null]}],"nop","\n","ev",{"VAR?":"x"},4,"==","/ev",[{"->":".^.b","c":true},{"b":["\n","^The main clause","\n",{"->":"0.17"},null]}],[{"->":".^.b"},{"b":["\n","^other","\n",{"->":"0.17"},null]}],"nop","\n","ev",{"VAR?":"x"},4,"==","/ev",[{"->":".^.b","c":true},{"b":["\n","^The main clause","\n",{"->":"0.26"},null]}],[{"->":".^.b"},{"b":["\n","^other","\n",{"->":"0.26"},null]}],"nop","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev",3,{"VAR=":"x"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/conditions/empty_multiline_conditional_branch.ink.json b/test/fixture/compiled/runtime/conditions/empty_multiline_conditional_branch.ink.json index 2c4b3ef4..79e8ab4f 100644 --- a/test/fixture/compiled/runtime/conditions/empty_multiline_conditional_branch.ink.json +++ b/test/fixture/compiled/runtime/conditions/empty_multiline_conditional_branch.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",3,"/ev",["du","ev",3,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n",{"->":"0.6"},null]}],["du","ev",4,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^txt","\n",{"->":"0.6"},null]}],"pop","nop","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",3,"/ev",["du","ev",3,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n",{"->":"0.6"},null]}],["du","ev",4,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^txt","\n",{"->":"0.6"},null]}],"pop","nop","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/conditions/trivial_condition.ink.json b/test/fixture/compiled/runtime/conditions/trivial_condition.ink.json index 465e2768..f06f9252 100644 --- a/test/fixture/compiled/runtime/conditions/trivial_condition.ink.json +++ b/test/fixture/compiled/runtime/conditions/trivial_condition.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[["ev",false,"/ev",{"->":".^.b","c":true},{"b":["\n","^beep","\n",{"->":"0.1"},null]}],"nop","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[["ev",false,"/ev",{"->":".^.b","c":true},{"b":["\n","^beep","\n",{"->":"0.1"},null]}],"nop","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/diverts/basic_tunnel.ink.json b/test/fixture/compiled/runtime/diverts/basic_tunnel.ink.json index 48dc2eea..b4c35f57 100644 --- a/test/fixture/compiled/runtime/diverts/basic_tunnel.ink.json +++ b/test/fixture/compiled/runtime/diverts/basic_tunnel.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[{"->t->":"f"},"<>","^ world","\n",["done",{"#n":"g-0"}],null],"done",{"f":["^Hello","\n","ev","void","/ev","->->",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[{"->t->":"f"},"<>","^ world","\n",["done",{"#n":"g-0"}],null],"done",{"f":["^Hello","\n","ev","void","/ev","->->",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/diverts/compare_divert_targets.ink.json b/test/fixture/compiled/runtime/diverts/compare_divert_targets.ink.json index 6c3952b4..f44ef22e 100644 --- a/test/fixture/compiled/runtime/diverts/compare_divert_targets.ink.json +++ b/test/fixture/compiled/runtime/diverts/compare_divert_targets.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",{"VAR?":"to_one"},{"VAR?":"to_two"},"==","/ev",[{"->":".^.b","c":true},{"b":["^same knot",{"->":"0.7"},null]}],[{"->":".^.b"},{"b":["^different knot",{"->":"0.7"},null]}],"nop","\n","ev",{"VAR?":"to_one"},{"VAR?":"to_one"},"==","/ev",[{"->":".^.b","c":true},{"b":["^same knot",{"->":"0.16"},null]}],[{"->":".^.b"},{"b":["^different knot",{"->":"0.16"},null]}],"nop","\n","ev",{"VAR?":"to_two"},{"VAR?":"to_two"},"==","/ev",[{"->":".^.b","c":true},{"b":["^same knot",{"->":"0.25"},null]}],[{"->":".^.b"},{"b":["^different knot",{"->":"0.25"},null]}],"nop","\n","ev",{"^->":"one"},{"^->":"two"},"==","/ev",[{"->":".^.b","c":true},{"b":["^same knot",{"->":"0.34"},null]}],[{"->":".^.b"},{"b":["^different knot",{"->":"0.34"},null]}],"nop","\n","ev",{"^->":"one"},{"VAR?":"to_one"},"==","/ev",[{"->":".^.b","c":true},{"b":["^same knot",{"->":"0.43"},null]}],[{"->":".^.b"},{"b":["^different knot",{"->":"0.43"},null]}],"nop","\n","ev",{"VAR?":"to_one"},{"^->":"one"},"==","/ev",[{"->":".^.b","c":true},{"b":["^same knot",{"->":"0.52"},null]}],[{"->":".^.b"},{"b":["^different knot",{"->":"0.52"},null]}],"nop","\n",["done",{"#n":"g-0"}],null],"done",{"one":["^One","\n","done",{"#f":3}],"two":["^Two","\n","done",{"#f":3}],"global decl":["ev",{"^->":"one"},{"VAR=":"to_one"},{"^->":"two"},{"VAR=":"to_two"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",{"VAR?":"to_one"},{"VAR?":"to_two"},"==","/ev",[{"->":".^.b","c":true},{"b":["^same knot",{"->":"0.7"},null]}],[{"->":".^.b"},{"b":["^different knot",{"->":"0.7"},null]}],"nop","\n","ev",{"VAR?":"to_one"},{"VAR?":"to_one"},"==","/ev",[{"->":".^.b","c":true},{"b":["^same knot",{"->":"0.16"},null]}],[{"->":".^.b"},{"b":["^different knot",{"->":"0.16"},null]}],"nop","\n","ev",{"VAR?":"to_two"},{"VAR?":"to_two"},"==","/ev",[{"->":".^.b","c":true},{"b":["^same knot",{"->":"0.25"},null]}],[{"->":".^.b"},{"b":["^different knot",{"->":"0.25"},null]}],"nop","\n","ev",{"^->":"one"},{"^->":"two"},"==","/ev",[{"->":".^.b","c":true},{"b":["^same knot",{"->":"0.34"},null]}],[{"->":".^.b"},{"b":["^different knot",{"->":"0.34"},null]}],"nop","\n","ev",{"^->":"one"},{"VAR?":"to_one"},"==","/ev",[{"->":".^.b","c":true},{"b":["^same knot",{"->":"0.43"},null]}],[{"->":".^.b"},{"b":["^different knot",{"->":"0.43"},null]}],"nop","\n","ev",{"VAR?":"to_one"},{"^->":"one"},"==","/ev",[{"->":".^.b","c":true},{"b":["^same knot",{"->":"0.52"},null]}],[{"->":".^.b"},{"b":["^different knot",{"->":"0.52"},null]}],"nop","\n",["done",{"#n":"g-0"}],null],"done",{"one":["^One","\n","done",{"#f":3}],"two":["^Two","\n","done",{"#f":3}],"global decl":["ev",{"^->":"one"},{"VAR=":"to_one"},{"^->":"two"},{"VAR=":"to_two"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/diverts/complex_tunnels.ink.json b/test/fixture/compiled/runtime/diverts/complex_tunnels.ink.json index 89f21782..39938d6e 100644 --- a/test/fixture/compiled/runtime/diverts/complex_tunnels.ink.json +++ b/test/fixture/compiled/runtime/diverts/complex_tunnels.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",1,"/ev",{"->t->":"one"},"ev",2,"/ev",{"->t->":"two"},"^three (3)","\n",["done",{"#n":"g-0"}],null],"done",{"one":[{"temp=":"num"},"^one (","ev",{"VAR?":"num"},"out","/ev","^)","\n","ev",1.5,"/ev",{"->t->":"oneAndAHalf"},"ev","void","/ev","->->",null],"oneAndAHalf":[{"temp=":"num"},"^one and a half (","ev",{"VAR?":"num"},"out","/ev","^)","\n","ev","void","/ev","->->",null],"two":[{"temp=":"num"},"^two (","ev",{"VAR?":"num"},"out","/ev","^)","\n","ev","void","/ev","->->",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",1,"/ev",{"->t->":"one"},"ev",2,"/ev",{"->t->":"two"},"^three (3)","\n",["done",{"#n":"g-0"}],null],"done",{"one":[{"temp=":"num"},"^one (","ev",{"VAR?":"num"},"out","/ev","^)","\n","ev",1.5,"/ev",{"->t->":"oneAndAHalf"},"ev","void","/ev","->->",null],"oneAndAHalf":[{"temp=":"num"},"^one and a half (","ev",{"VAR?":"num"},"out","/ev","^)","\n","ev","void","/ev","->->",null],"two":[{"temp=":"num"},"^two (","ev",{"VAR?":"num"},"out","/ev","^)","\n","ev","void","/ev","->->",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/diverts/divert_in_conditional.ink.json b/test/fixture/compiled/runtime/diverts/divert_in_conditional.ink.json index 0a0ee4b1..15f5549b 100644 --- a/test/fixture/compiled/runtime/diverts/divert_in_conditional.ink.json +++ b/test/fixture/compiled/runtime/diverts/divert_in_conditional.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[["done",{"#n":"g-0"}],null],"done",{"intro":[{"->":".^.top"},{"top":["ev",{"CNT?":".^.^.main"},"/ev",[{"->":".^.b","c":true},{"b":["^ ",{"->":"intro.done"},{"->":".^.^.^.4"},null]}],"nop","\n","end",null],"main":[{"->":".^.^.top"},{"#f":1}],"done":["end",null]}]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[["done",{"#n":"g-0"}],null],"done",{"intro":[{"->":".^.top"},{"top":["ev",{"CNT?":".^.^.main"},"/ev",[{"->":".^.b","c":true},{"b":["^ ",{"->":"intro.done"},{"->":".^.^.^.4"},null]}],"nop","\n","end",null],"main":[{"->":".^.^.top"},{"#f":1}],"done":["end",null]}]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/diverts/divert_targets_with_parameters.ink.json b/test/fixture/compiled/runtime/diverts/divert_targets_with_parameters.ink.json index b73302f5..cd0c0c88 100644 --- a/test/fixture/compiled/runtime/diverts/divert_targets_with_parameters.ink.json +++ b/test/fixture/compiled/runtime/diverts/divert_targets_with_parameters.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",5,"/ev",{"->":"x","var":true},["done",{"#n":"g-0"}],null],"done",{"place":[{"temp=":"a"},"ev",{"VAR?":"a"},"out","/ev","\n","done",{"#f":3}],"global decl":["ev",{"^->":"place"},{"VAR=":"x"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",5,"/ev",{"->":"x","var":true},["done",{"#n":"g-0"}],null],"done",{"place":[{"temp=":"a"},"ev",{"VAR?":"a"},"out","/ev","\n","done",{"#f":3}],"global decl":["ev",{"^->":"place"},{"VAR=":"x"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/diverts/divert_to_weave_points.ink.json b/test/fixture/compiled/runtime/diverts/divert_to_weave_points.ink.json index ed2a2b0a..a42e6774 100644 --- a/test/fixture/compiled/runtime/diverts/divert_to_weave_points.ink.json +++ b/test/fixture/compiled/runtime/diverts/divert_to_weave_points.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[{"->":"knot.stitch.0.gather"},["done",{"#n":"g-0"}],null],"done",{"knot":[{"->":".^.stitch"},{"stitch":[[["^hello","\n",["ev",{"^->":"knot.stitch.0.g-0.2.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^test",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"knot.stitch.0.g-0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.2.s"},[{"#n":"$r2"}],"\n","^choice content","\n",{"->":".^.^.^.gather"},{"#f":5}],"#n":"g-0"}],{"gather":["^gather","\n",["ev","visit",1,"MIN","/ev","ev","du",0,"==","/ev",{"->":".^.s0","c":true},"ev","du",1,"==","/ev",{"->":".^.s1","c":true},"nop",{"s0":["pop","\n",{"->":".^.^.^.^.g-0.c-0"},{"->":".^.^.17"},null],"s1":["pop","\n","^second time round","\n",{"->":".^.^.17"},null],"#f":5}],"\n","end",null]}],null]}]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[{"->":"knot.stitch.0.gather"},["done",{"#n":"g-0"}],null],"done",{"knot":[{"->":".^.stitch"},{"stitch":[[["^hello","\n",["ev",{"^->":"knot.stitch.0.g-0.2.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^test",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"knot.stitch.0.g-0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.2.s"},[{"#n":"$r2"}],"\n","^choice content","\n",{"->":".^.^.^.gather"},{"#f":5}],"#n":"g-0"}],{"gather":["^gather","\n",["ev","visit",1,"MIN","/ev","ev","du",0,"==","/ev",{"->":".^.s0","c":true},"ev","du",1,"==","/ev",{"->":".^.s1","c":true},"nop",{"s0":["pop","\n",{"->":".^.^.^.^.g-0.c-0"},{"->":".^.^.17"},null],"s1":["pop","\n","^second time round","\n",{"->":".^.^.17"},null],"#f":5}],"\n","end",null]}],null]}]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/diverts/done_stops_thread.ink.json b/test/fixture/compiled/runtime/diverts/done_stops_thread.ink.json index c4eec4e1..efcac8b8 100644 --- a/test/fixture/compiled/runtime/diverts/done_stops_thread.ink.json +++ b/test/fixture/compiled/runtime/diverts/done_stops_thread.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["done","^This content is inaccessible.","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["done","^This content is inaccessible.","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/diverts/path_to_self.ink.json b/test/fixture/compiled/runtime/diverts/path_to_self.ink.json index 963e972d..a0053630 100644 --- a/test/fixture/compiled/runtime/diverts/path_to_self.ink.json +++ b/test/fixture/compiled/runtime/diverts/path_to_self.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[[{"->t->":"tunnel"},{"->":".^"},["done",{"#n":"g-0"}],{"#n":"dododo"}],null],"done",{"tunnel":[[["ev",{"^->":"tunnel.0.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":2},{"s":["^A",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"tunnel.0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.0.s"},[{"#n":"$r2"}],"\n","ev","void","/ev","->->",null]}],null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[[{"->t->":"tunnel"},{"->":".^"},["done",{"#n":"g-0"}],{"#n":"dododo"}],null],"done",{"tunnel":[[["ev",{"^->":"tunnel.0.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":2},{"s":["^A",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"tunnel.0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.0.s"},[{"#n":"$r2"}],"\n","ev","void","/ev","->->",null]}],null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/diverts/same_line_divert_is_inline.ink.json b/test/fixture/compiled/runtime/diverts/same_line_divert_is_inline.ink.json index f7cc9b5a..a84ee230 100644 --- a/test/fixture/compiled/runtime/diverts/same_line_divert_is_inline.ink.json +++ b/test/fixture/compiled/runtime/diverts/same_line_divert_is_inline.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[{"->":"hurry_home"},["done",{"#n":"g-0"}],null],"done",{"hurry_home":["^We hurried home to Savile Row ",{"->":"as_fast_as_we_could"},"\n",null],"as_fast_as_we_could":["^as fast as we could.","\n","done",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[{"->":"hurry_home"},["done",{"#n":"g-0"}],null],"done",{"hurry_home":["^We hurried home to Savile Row ",{"->":"as_fast_as_we_could"},"\n",null],"as_fast_as_we_could":["^as fast as we could.","\n","done",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/diverts/tunnel_onwards_after_tunnel.ink.json b/test/fixture/compiled/runtime/diverts/tunnel_onwards_after_tunnel.ink.json index 4aee5d83..50212ab3 100644 --- a/test/fixture/compiled/runtime/diverts/tunnel_onwards_after_tunnel.ink.json +++ b/test/fixture/compiled/runtime/diverts/tunnel_onwards_after_tunnel.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[{"->t->":"tunnel1"},"^The End.","\n","end",["done",{"#n":"g-0"}],null],"done",{"tunnel1":["^Hello...","\n",{"->t->":"tunnel2"},"ev","void","/ev","->->",null],"tunnel2":["^...world.","\n","ev","void","/ev","->->",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[{"->t->":"tunnel1"},"^The End.","\n","end",["done",{"#n":"g-0"}],null],"done",{"tunnel1":["^Hello...","\n",{"->t->":"tunnel2"},"ev","void","/ev","->->",null],"tunnel2":["^...world.","\n","ev","void","/ev","->->",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/diverts/tunnel_onwards_divert_after_with_arg.ink.json b/test/fixture/compiled/runtime/diverts/tunnel_onwards_divert_after_with_arg.ink.json index a5e80037..7d2c657d 100644 --- a/test/fixture/compiled/runtime/diverts/tunnel_onwards_divert_after_with_arg.ink.json +++ b/test/fixture/compiled/runtime/diverts/tunnel_onwards_divert_after_with_arg.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[{"->t->":"a"},["done",{"#n":"g-0"}],null],"done",{"a":["ev",5,3,"+",{"^->":"b"},"/ev","->->",null],"b":[{"temp=":"x"},"ev",{"VAR?":"x"},"out","/ev","\n","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[{"->t->":"a"},["done",{"#n":"g-0"}],null],"done",{"a":["ev",5,3,"+",{"^->":"b"},"/ev","->->",null],"b":[{"temp=":"x"},"ev",{"VAR?":"x"},"out","/ev","\n","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/diverts/tunnel_onwards_divert_override.ink.json b/test/fixture/compiled/runtime/diverts/tunnel_onwards_divert_override.ink.json index 744d80fd..621c7da8 100644 --- a/test/fixture/compiled/runtime/diverts/tunnel_onwards_divert_override.ink.json +++ b/test/fixture/compiled/runtime/diverts/tunnel_onwards_divert_override.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[{"->t->":"A"},"^We will never return to here!","\n",["done",{"#n":"g-0"}],null],"done",{"A":["^This is A","\n","ev",{"^->":"B"},"/ev","->->",null],"B":["^Now in B.","\n","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[{"->t->":"A"},"^We will never return to here!","\n",["done",{"#n":"g-0"}],null],"done",{"A":["^This is A","\n","ev",{"^->":"B"},"/ev","->->",null],"B":["^Now in B.","\n","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/diverts/tunnel_onwards_to_variable_divert_target.ink.json b/test/fixture/compiled/runtime/diverts/tunnel_onwards_to_variable_divert_target.ink.json new file mode 100644 index 00000000..f04a7c32 --- /dev/null +++ b/test/fixture/compiled/runtime/diverts/tunnel_onwards_to_variable_divert_target.ink.json @@ -0,0 +1 @@ +{"inkVersion":21,"root":[[{"->t->":"outer"},["done",{"#n":"g-0"}],null],"done",{"outer":["^This is outer","\n","ev",{"^->":"the_esc"},"/ev",{"->":"cut_to"},null],"cut_to":[{"temp=":"escape"},"ev",{"VAR?":"escape"},"/ev","->->",null],"the_esc":["^This is the_esc","\n","end",{"#f":3}]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/diverts/tunnel_onwards_with_param_default_choice.ink.json b/test/fixture/compiled/runtime/diverts/tunnel_onwards_with_param_default_choice.ink.json index 1b9dc168..64e15b27 100644 --- a/test/fixture/compiled/runtime/diverts/tunnel_onwards_with_param_default_choice.ink.json +++ b/test/fixture/compiled/runtime/diverts/tunnel_onwards_with_param_default_choice.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[{"->t->":"tunnel"},["done",{"#n":"g-0"}],null],"done",{"tunnel":[[{"*":".^.c-0","flg":24},{"c-0":["ev",8,{"^->":"elsewhere"},"/ev","->->","\n",{"#f":5}]}],null],"elsewhere":[{"temp=":"x"},"ev",{"VAR?":"x"},"out","/ev","\n","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[{"->t->":"tunnel"},["done",{"#n":"g-0"}],null],"done",{"tunnel":[[{"*":".^.c-0","flg":24},{"c-0":["ev",8,{"^->":"elsewhere"},"/ev","->->","\n",{"#f":5}]}],null],"elsewhere":[{"temp=":"x"},"ev",{"VAR?":"x"},"out","/ev","\n","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/diverts/tunnel_vs_thread_behaviour.ink.json b/test/fixture/compiled/runtime/diverts/tunnel_vs_thread_behaviour.ink.json index bdf55fe5..48b09b54 100644 --- a/test/fixture/compiled/runtime/diverts/tunnel_vs_thread_behaviour.ink.json +++ b/test/fixture/compiled/runtime/diverts/tunnel_vs_thread_behaviour.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[{"->t->":"knot_with_options"},"^Finished tunnel.","\n","^Starting thread.","\n","thread",{"->":"thread_with_options"},["ev",{"^->":"0.7.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":"0.c-0","flg":18},{"s":["^E",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":"0.7.s"},[{"#n":"$r2"}],"\n",{"->":"0.g-0"},{"#f":5}],"g-0":["^Done.","\n",["done",{"#n":"g-1"}],null]}],"done",{"knot_with_options":[[["ev",{"^->":"knot_with_options.0.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^A",{"->":"$r","var":true},null]}],["ev",{"^->":"knot_with_options.0.1.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-1","flg":18},{"s":["^B",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"knot_with_options.0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.0.s"},[{"#n":"$r2"}],"\n",{"->":".^.^.g-0"},{"#f":5}],"c-1":["ev",{"^->":"knot_with_options.0.c-1.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.1.s"},[{"#n":"$r2"}],"\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":["ev","void","/ev","->->",null]}],null],"thread_with_options":[[["ev",{"^->":"thread_with_options.0.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^C",{"->":"$r","var":true},null]}],["ev",{"^->":"thread_with_options.0.1.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-1","flg":18},{"s":["^D",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"thread_with_options.0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.0.s"},[{"#n":"$r2"}],"\n",{"->":".^.^.g-0"},{"#f":5}],"c-1":["ev",{"^->":"thread_with_options.0.c-1.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.1.s"},[{"#n":"$r2"}],"\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":["done",null]}],null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[{"->t->":"knot_with_options"},"^Finished tunnel.","\n","^Starting thread.","\n","thread",{"->":"thread_with_options"},["ev",{"^->":"0.7.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":"0.c-0","flg":18},{"s":["^E",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":"0.7.s"},[{"#n":"$r2"}],"\n",{"->":"0.g-0"},{"#f":5}],"g-0":["^Done.","\n",["done",{"#n":"g-1"}],null]}],"done",{"knot_with_options":[[["ev",{"^->":"knot_with_options.0.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^A",{"->":"$r","var":true},null]}],["ev",{"^->":"knot_with_options.0.1.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-1","flg":18},{"s":["^B",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"knot_with_options.0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.0.s"},[{"#n":"$r2"}],"\n",{"->":".^.^.g-0"},{"#f":5}],"c-1":["ev",{"^->":"knot_with_options.0.c-1.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.1.s"},[{"#n":"$r2"}],"\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":["ev","void","/ev","->->",null]}],null],"thread_with_options":[[["ev",{"^->":"thread_with_options.0.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^C",{"->":"$r","var":true},null]}],["ev",{"^->":"thread_with_options.0.1.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-1","flg":18},{"s":["^D",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"thread_with_options.0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.0.s"},[{"#n":"$r2"}],"\n",{"->":".^.^.g-0"},{"#f":5}],"c-1":["ev",{"^->":"thread_with_options.0.c-1.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.1.s"},[{"#n":"$r2"}],"\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":["done",null]}],null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/evaluation/arithmetic.ink.json b/test/fixture/compiled/runtime/evaluation/arithmetic.ink.json index 6484ce60..db9ef52a 100644 --- a/test/fixture/compiled/runtime/evaluation/arithmetic.ink.json +++ b/test/fixture/compiled/runtime/evaluation/arithmetic.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",2,3,"*",5,6,"*","+","out","/ev","\n","ev",8,3,"%","out","/ev","\n","ev",13,5,"%","out","/ev","\n","ev",7,3,"/","out","/ev","\n","ev",7,3.0,"/","out","/ev","\n","ev",10,2,"-","out","/ev","\n","ev",2,5,1,"-","*","out","/ev","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",2,3,"*",5,6,"*","+","out","/ev","\n","ev",8,3,"%","out","/ev","\n","ev",13,5,"%","out","/ev","\n","ev",7,3,"/","out","/ev","\n","ev",7,3.0,"/","out","/ev","\n","ev",10,2,"-","out","/ev","\n","ev",2,5,1,"-","*","out","/ev","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/evaluation/basic_string_literals.ink.json b/test/fixture/compiled/runtime/evaluation/basic_string_literals.ink.json index 0d740eb1..dd7ab784 100644 --- a/test/fixture/compiled/runtime/evaluation/basic_string_literals.ink.json +++ b/test/fixture/compiled/runtime/evaluation/basic_string_literals.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",{"VAR?":"x"},"out","/ev","\n","^Hello ","ev","str","^world","/str","out","/ev","^ 2.","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev","str","^Hello world 1","/str",{"VAR=":"x"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",{"VAR?":"x"},"out","/ev","\n","^Hello ","ev","str","^world","/str","out","/ev","^ 2.","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev","str","^Hello world 1","/str",{"VAR=":"x"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/evaluation/evaluating_function_variable_state_bug.ink.json b/test/fixture/compiled/runtime/evaluation/evaluating_function_variable_state_bug.ink.json index f6ff0a09..97debc1a 100644 --- a/test/fixture/compiled/runtime/evaluation/evaluating_function_variable_state_bug.ink.json +++ b/test/fixture/compiled/runtime/evaluation/evaluating_function_variable_state_bug.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["^Start","\n",{"->t->":"tunnel"},"^End","\n","end",["done",{"#n":"g-0"}],null],"done",{"tunnel":["^In tunnel.","\n","ev","void","/ev","->->",null],"function_to_evaluate":["ev",1,{"f()":"zero_equals_"},"/ev",[{"->":".^.b","c":true},{"b":["\n","ev","str","^WRONG","/str","/ev","~ret",{"->":".^.^.^.6"},null]}],[{"->":".^.b"},{"b":["\n","ev","str","^RIGHT","/str","/ev","~ret",{"->":".^.^.^.6"},null]}],"nop","\n",null],"zero_equals_":[{"temp=":"k"},"ev",0,{"f()":"do_nothing"},"pop","/ev","\n","ev",0,{"VAR?":"k"},"==","/ev","~ret",null],"do_nothing":[{"temp=":"k"},"ev",0,"/ev","~ret",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["^Start","\n",{"->t->":"tunnel"},"^End","\n","end",["done",{"#n":"g-0"}],null],"done",{"tunnel":["^In tunnel.","\n","ev","void","/ev","->->",null],"function_to_evaluate":["ev",1,{"f()":"zero_equals_"},"/ev",[{"->":".^.b","c":true},{"b":["\n","ev","str","^WRONG","/str","/ev","~ret",{"->":".^.^.^.6"},null]}],[{"->":".^.b"},{"b":["\n","ev","str","^RIGHT","/str","/ev","~ret",{"->":".^.^.^.6"},null]}],"nop","\n",null],"zero_equals_":[{"temp=":"k"},"ev",0,{"f()":"do_nothing"},"pop","/ev","\n","ev",0,{"VAR?":"k"},"==","/ev","~ret",null],"do_nothing":[{"temp=":"k"},"ev",0,"/ev","~ret",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/evaluation/evaluating_ink_functions_from_game.ink.json b/test/fixture/compiled/runtime/evaluation/evaluating_ink_functions_from_game.ink.json index 32353605..223e2a15 100644 --- a/test/fixture/compiled/runtime/evaluation/evaluating_ink_functions_from_game.ink.json +++ b/test/fixture/compiled/runtime/evaluation/evaluating_ink_functions_from_game.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["^Top level content","\n",["ev",{"^->":"0.2.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":"0.c-0","flg":18},{"s":["^choice",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":"0.2.s"},[{"#n":"$r2"}],"\n",{"->":"0.g-0"},{"#f":5}],"g-0":["done",null]}],"done",{"somewhere":[{"->":".^.here"},{"here":["done",{"#f":3}]}],"test":["ev",{"^->":"somewhere.here"},"/ev","~ret",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["^Top level content","\n",["ev",{"^->":"0.2.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":"0.c-0","flg":18},{"s":["^choice",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":"0.2.s"},[{"#n":"$r2"}],"\n",{"->":"0.g-0"},{"#f":5}],"g-0":["done",null]}],"done",{"somewhere":[{"->":".^.here"},{"here":["done",{"#f":3}]}],"test":["ev",{"^->":"somewhere.here"},"/ev","~ret",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/evaluation/evaluating_ink_functions_from_game_2.ink.json b/test/fixture/compiled/runtime/evaluation/evaluating_ink_functions_from_game_2.ink.json index 16fa48c3..218e9916 100644 --- a/test/fixture/compiled/runtime/evaluation/evaluating_ink_functions_from_game_2.ink.json +++ b/test/fixture/compiled/runtime/evaluation/evaluating_ink_functions_from_game_2.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["^One","\n","^Two","\n","^Three","\n",["done",{"#n":"g-0"}],null],"done",{"func1":["^This is a function","\n","ev",5,"/ev","~ret",null],"func2":["^This is a function without a return value","\n","ev","void","/ev","~ret",null],"add":[{"temp=":"y"},{"temp=":"x"},"^x = ","ev",{"VAR?":"x"},"out","/ev","^, y = ","ev",{"VAR?":"y"},"out","/ev","\n","ev",{"VAR?":"x"},{"VAR?":"y"},"+","/ev","~ret",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["^One","\n","^Two","\n","^Three","\n",["done",{"#n":"g-0"}],null],"done",{"func1":["^This is a function","\n","ev",5,"/ev","~ret",null],"func2":["^This is a function without a return value","\n","ev","void","/ev","~ret",null],"add":[{"temp=":"y"},{"temp=":"x"},"^x = ","ev",{"VAR?":"x"},"out","/ev","^, y = ","ev",{"VAR?":"y"},"out","/ev","\n","ev",{"VAR?":"x"},{"VAR?":"y"},"+","/ev","~ret",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/evaluation/evaluation_stack_leaks.ink.json b/test/fixture/compiled/runtime/evaluation/evaluation_stack_leaks.ink.json index 534ca3ed..71f28936 100644 --- a/test/fixture/compiled/runtime/evaluation/evaluation_stack_leaks.ink.json +++ b/test/fixture/compiled/runtime/evaluation/evaluation_stack_leaks.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",false,"/ev",[{"->":".^.b","c":true},{"b":["\n",{"->":"0.5"},null]}],[{"->":".^.b"},{"b":["\n","^else","\n",{"->":"0.5"},null]}],"nop","\n","ev",6,"/ev",["du","ev",5,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^five","\n",{"->":"0.12"},null]}],[{"->":".^.b"},{"b":["pop","\n","^else","\n",{"->":"0.12"},null]}],"nop","\n",{"->t->":"onceTest"},{"->t->":"onceTest"},["done",{"#n":"g-0"}],null],"done",{"onceTest":[["ev","visit",1,"MIN","/ev","ev","du",0,"==","/ev",{"->":".^.s0","c":true},"ev","du",1,"==","/ev",{"->":".^.s1","c":true},"nop",{"s0":["pop","\n","^hi","\n",{"->":".^.^.17"},null],"s1":["pop",{"->":".^.^.17"},null],"#f":5}],"\n","ev","void","/ev","->->",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",false,"/ev",[{"->":".^.b","c":true},{"b":["\n",{"->":"0.5"},null]}],[{"->":".^.b"},{"b":["\n","^else","\n",{"->":"0.5"},null]}],"nop","\n","ev",6,"/ev",["du","ev",5,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^five","\n",{"->":"0.12"},null]}],[{"->":".^.b"},{"b":["pop","\n","^else","\n",{"->":"0.12"},null]}],"nop","\n",{"->t->":"onceTest"},{"->t->":"onceTest"},["done",{"#n":"g-0"}],null],"done",{"onceTest":[["ev","visit",1,"MIN","/ev","ev","du",0,"==","/ev",{"->":".^.s0","c":true},"ev","du",1,"==","/ev",{"->":".^.s1","c":true},"nop",{"s0":["pop","\n","^hi","\n",{"->":".^.^.17"},null],"s1":["pop",{"->":".^.^.17"},null],"#f":5}],"\n","ev","void","/ev","->->",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/evaluation/factorial_by_reference.ink.json b/test/fixture/compiled/runtime/evaluation/factorial_by_reference.ink.json index 4da3d859..76222de2 100644 --- a/test/fixture/compiled/runtime/evaluation/factorial_by_reference.ink.json +++ b/test/fixture/compiled/runtime/evaluation/factorial_by_reference.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",{"^var":"result","ci":-1},5,{"f()":"factorialByRef"},"pop","/ev","\n","ev",{"VAR?":"result"},"out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"factorialByRef":[{"temp=":"n"},{"temp=":"r"},"ev",{"VAR?":"r"},0,"==","/ev",[{"->":".^.b","c":true},{"b":["\n","ev",1,"/ev",{"temp=":"r","re":true},{"->":".^.^.^.8"},null]}],"nop","\n","ev",{"VAR?":"n"},1,">","/ev",[{"->":".^.b","c":true},{"b":["\n","ev",{"VAR?":"r"},{"VAR?":"n"},"*","/ev",{"temp=":"r","re":true},"ev",{"^var":"r","ci":-1},{"VAR?":"n"},1,"-",{"f()":".^.^.^"},"pop","/ev","\n",{"->":".^.^.^.16"},null]}],"nop","\n","ev","void","/ev","~ret",null],"global decl":["ev",0,{"VAR=":"result"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",{"^var":"result","ci":-1},5,{"f()":"factorialByRef"},"pop","/ev","\n","ev",{"VAR?":"result"},"out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"factorialByRef":[{"temp=":"n"},{"temp=":"r"},"ev",{"VAR?":"r"},0,"==","/ev",[{"->":".^.b","c":true},{"b":["\n","ev",1,"/ev",{"temp=":"r","re":true},{"->":".^.^.^.8"},null]}],"nop","\n","ev",{"VAR?":"n"},1,">","/ev",[{"->":".^.b","c":true},{"b":["\n","ev",{"VAR?":"r"},{"VAR?":"n"},"*","/ev",{"temp=":"r","re":true},"ev",{"^var":"r","ci":-1},{"VAR?":"n"},1,"-",{"f()":".^.^.^"},"pop","/ev","\n",{"->":".^.^.^.16"},null]}],"nop","\n","ev","void","/ev","~ret",null],"global decl":["ev",0,{"VAR=":"result"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/evaluation/factorial_recursive.ink.json b/test/fixture/compiled/runtime/evaluation/factorial_recursive.ink.json index 3a727dd9..38909aa5 100644 --- a/test/fixture/compiled/runtime/evaluation/factorial_recursive.ink.json +++ b/test/fixture/compiled/runtime/evaluation/factorial_recursive.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",5,{"f()":"factorial"},"out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"factorial":[{"temp=":"n"},"ev",{"VAR?":"n"},1,"==","/ev",[{"->":".^.b","c":true},{"b":["\n","ev",1,"/ev","~ret",{"->":".^.^.^.8"},null]}],[{"->":".^.b"},{"b":["\n","ev",{"VAR?":"n"},{"VAR?":"n"},1,"-",{"f()":".^.^.^"},"*","/ev","~ret","\n",{"->":".^.^.^.8"},null]}],"nop","\n",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",5,{"f()":"factorial"},"out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"factorial":[{"temp=":"n"},"ev",{"VAR?":"n"},1,"==","/ev",[{"->":".^.b","c":true},{"b":["\n","ev",1,"/ev","~ret",{"->":".^.^.^.8"},null]}],[{"->":".^.b"},{"b":["\n","ev",{"VAR?":"n"},{"VAR?":"n"},1,"-",{"f()":".^.^.^"},"*","/ev","~ret","\n",{"->":".^.^.^.8"},null]}],"nop","\n",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/evaluation/increment.ink.json b/test/fixture/compiled/runtime/evaluation/increment.ink.json index 2fd60c80..9a7da83d 100644 --- a/test/fixture/compiled/runtime/evaluation/increment.ink.json +++ b/test/fixture/compiled/runtime/evaluation/increment.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",{"VAR?":"x"},1,"+",{"VAR=":"x","re":true},"/ev","ev",{"VAR?":"x"},"out","/ev","\n","ev",{"VAR?":"x"},1,"-",{"VAR=":"x","re":true},"/ev","ev",{"VAR?":"x"},"out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev",5,{"VAR=":"x"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",{"VAR?":"x"},1,"+",{"VAR=":"x","re":true},"/ev","ev",{"VAR?":"x"},"out","/ev","\n","ev",{"VAR?":"x"},1,"-",{"VAR=":"x","re":true},"/ev","ev",{"VAR?":"x"},"out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev",5,{"VAR=":"x"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/evaluation/literal_unary.ink.json b/test/fixture/compiled/runtime/evaluation/literal_unary.ink.json index 41f61582..6c01f56f 100644 --- a/test/fixture/compiled/runtime/evaluation/literal_unary.ink.json +++ b/test/fixture/compiled/runtime/evaluation/literal_unary.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",{"VAR?":"negativeLiteral"},"out","/ev","\n","ev",{"VAR?":"negativeLiteral2"},"out","/ev","\n","ev",{"VAR?":"negativeLiteral3"},"out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev",-1,{"VAR=":"negativeLiteral"},false,{"VAR=":"negativeLiteral2"},true,{"VAR=":"negativeLiteral3"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",{"VAR?":"negativeLiteral"},"out","/ev","\n","ev",{"VAR?":"negativeLiteral2"},"out","/ev","\n","ev",{"VAR?":"negativeLiteral3"},"out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev",-1,{"VAR=":"negativeLiteral"},false,{"VAR=":"negativeLiteral2"},true,{"VAR=":"negativeLiteral3"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/extra/arithmetic_2.ink.json b/test/fixture/compiled/runtime/extra/arithmetic_2.ink.json index 890de679..efe13187 100644 --- a/test/fixture/compiled/runtime/extra/arithmetic_2.ink.json +++ b/test/fixture/compiled/runtime/extra/arithmetic_2.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",7,3,"/","out","/ev","\n","ev",7,3.0,"/","out","/ev","\n","ev",7,3.0,"FLOAT","/","out","/ev","\n","ev",7.0,3,"/","out","/ev","\n","ev",7.0,3.0,"/","out","/ev","\n","ev",7.0,"FLOAT",3.0,"/","out","/ev","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",7,3,"/","out","/ev","\n","ev",7,3.0,"/","out","/ev","\n","ev",7,3.0,"FLOAT","/","out","/ev","\n","ev",7.0,3,"/","out","/ev","\n","ev",7.0,3.0,"/","out","/ev","\n","ev",7.0,"FLOAT",3.0,"/","out","/ev","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/extra/list_comparison.ink.json b/test/fixture/compiled/runtime/extra/list_comparison.ink.json index 6142325c..72e5e2cc 100644 --- a/test/fixture/compiled/runtime/extra/list_comparison.ink.json +++ b/test/fixture/compiled/runtime/extra/list_comparison.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[{"->":"start"},["done",{"#n":"g-0"}],null],"done",{"set_actor":[{"temp=":"x"},"ev",{"VAR?":"x"},"/ev",["du","ev",{"VAR?":"P"},"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","ev","str","^Philippe","/str","/ev",{"VAR=":"currentActor","re":true},{"->":".^.^.^.7"},null]}],["du","ev",{"VAR?":"A"},"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","ev","str","^Andre","/str","/ev",{"VAR=":"currentActor","re":true},{"->":".^.^.^.7"},null]}],[{"->":".^.b"},{"b":["pop","\n","ev","str","^Bobby","/str","/ev",{"VAR=":"currentActor","re":true},{"->":".^.^.^.7"},null]}],"nop","\n",{"#f":3}],"start":["ev",{"VAR?":"P"},{"f()":"s","var":true},"out","/ev","^ Hey, my name is ","ev",{"VAR?":"currentActor"},"out","/ev","^. What about yours?","\n","ev",{"VAR?":"A"},{"f()":"s","var":true},"out","/ev","^ I am ","ev",{"VAR?":"currentActor"},"out","/ev","^ and I need my rheumatism pills!","\n","ev",{"VAR?":"P"},{"f()":"s","var":true},"out","/ev","^ Would you like me, ","ev",{"VAR?":"currentActor"},"out","/ev","^, to get some more for you?","\n","end",null],"global decl":["ev","str","^Bobby","/str",{"VAR=":"currentActor"},{"list":{},"origins":["listOfActors"]},{"VAR=":"listOfActors"},{"^->":"set_actor"},{"VAR=":"s"},"/ev","end",null]}],"listDefs":{"listOfActors":{"P":1,"A":2,"S":3,"C":4}}} \ No newline at end of file +{"inkVersion":21,"root":[[{"->":"start"},["done",{"#n":"g-0"}],null],"done",{"set_actor":[{"temp=":"x"},"ev",{"VAR?":"x"},"/ev",["du","ev",{"VAR?":"P"},"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","ev","str","^Philippe","/str","/ev",{"VAR=":"currentActor","re":true},{"->":".^.^.^.7"},null]}],["du","ev",{"VAR?":"A"},"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","ev","str","^Andre","/str","/ev",{"VAR=":"currentActor","re":true},{"->":".^.^.^.7"},null]}],[{"->":".^.b"},{"b":["pop","\n","ev","str","^Bobby","/str","/ev",{"VAR=":"currentActor","re":true},{"->":".^.^.^.7"},null]}],"nop","\n",{"#f":3}],"start":["ev",{"VAR?":"P"},{"f()":"s","var":true},"out","/ev","^ Hey, my name is ","ev",{"VAR?":"currentActor"},"out","/ev","^. What about yours?","\n","ev",{"VAR?":"A"},{"f()":"s","var":true},"out","/ev","^ I am ","ev",{"VAR?":"currentActor"},"out","/ev","^ and I need my rheumatism pills!","\n","ev",{"VAR?":"P"},{"f()":"s","var":true},"out","/ev","^ Would you like me, ","ev",{"VAR?":"currentActor"},"out","/ev","^, to get some more for you?","\n","end",null],"global decl":["ev","str","^Bobby","/str",{"VAR=":"currentActor"},{"list":{},"origins":["listOfActors"]},{"VAR=":"listOfActors"},{"^->":"set_actor"},{"VAR=":"s"},"/ev","end",null]}],"listDefs":{"listOfActors":{"P":1,"A":2,"S":3,"C":4}}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/glue/implicit_inline_glue.ink.json b/test/fixture/compiled/runtime/glue/implicit_inline_glue.ink.json index fdb79ccf..fad6cd33 100644 --- a/test/fixture/compiled/runtime/glue/implicit_inline_glue.ink.json +++ b/test/fixture/compiled/runtime/glue/implicit_inline_glue.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["^I have ","ev",{"f()":"five"},"out","/ev","^ eggs.","\n",["done",{"#n":"g-0"}],null],"done",{"five":["ev",false,"/ev",[{"->":".^.b","c":true},{"b":["\n","^Don't print this","\n",{"->":"five.4"},null]}],"nop","\n","^five","\n",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["^I have ","ev",{"f()":"five"},"out","/ev","^ eggs.","\n",["done",{"#n":"g-0"}],null],"done",{"five":["ev",false,"/ev",[{"->":".^.b","c":true},{"b":["\n","^Don't print this","\n",{"->":"five.4"},null]}],"nop","\n","^five","\n",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/glue/implicit_inline_glue_b.ink.json b/test/fixture/compiled/runtime/glue/implicit_inline_glue_b.ink.json index fff69ae4..a81b31d0 100644 --- a/test/fixture/compiled/runtime/glue/implicit_inline_glue_b.ink.json +++ b/test/fixture/compiled/runtime/glue/implicit_inline_glue_b.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["^A ","ev",{"f()":"f"},"/ev",[{"->":".^.b","c":true},{"b":["^B",{"->":"0.5"},null]}],"nop","\n","^X","\n",["done",{"#n":"g-0"}],null],"done",{"f":["ev",true,"/ev",[{"->":".^.b","c":true},{"b":["\n","ev",false,"/ev","~ret",{"->":"f.4"},null]}],"nop","\n",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["^A ","ev",{"f()":"f"},"/ev",[{"->":".^.b","c":true},{"b":["^B",{"->":"0.5"},null]}],"nop","\n","^X","\n",["done",{"#n":"g-0"}],null],"done",{"f":["ev",true,"/ev",[{"->":".^.b","c":true},{"b":["\n","ev",false,"/ev","~ret",{"->":"f.4"},null]}],"nop","\n",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/glue/implicit_inline_glue_c.ink.json b/test/fixture/compiled/runtime/glue/implicit_inline_glue_c.ink.json index 709c8f8b..3f49454a 100644 --- a/test/fixture/compiled/runtime/glue/implicit_inline_glue_c.ink.json +++ b/test/fixture/compiled/runtime/glue/implicit_inline_glue_c.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["^A","\n","ev",{"f()":"f"},"/ev",[{"->":".^.b","c":true},{"b":["^X",{"->":"0.6"},null]}],"nop","\n","^C","\n",["done",{"#n":"g-0"}],null],"done",{"f":["ev",true,"/ev",[{"->":".^.b","c":true},{"b":["\n","ev",false,"/ev","~ret",{"->":"f.4"},null]}],"nop","\n",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["^A","\n","ev",{"f()":"f"},"/ev",[{"->":".^.b","c":true},{"b":["^X",{"->":"0.6"},null]}],"nop","\n","^C","\n",["done",{"#n":"g-0"}],null],"done",{"f":["ev",true,"/ev",[{"->":".^.b","c":true},{"b":["\n","ev",false,"/ev","~ret",{"->":"f.4"},null]}],"nop","\n",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/glue/left_right_glue_matching.ink.json b/test/fixture/compiled/runtime/glue/left_right_glue_matching.ink.json index 4a1143f4..1c3f8dcb 100644 --- a/test/fixture/compiled/runtime/glue/left_right_glue_matching.ink.json +++ b/test/fixture/compiled/runtime/glue/left_right_glue_matching.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["^A line.","\n","ev",{"f()":"f"},"/ev",[{"->":".^.b","c":true},{"b":["\n","^Another line.","\n",{"->":"0.6"},null]}],"nop","\n",["done",{"#n":"g-0"}],null],"done",{"f":["ev",false,"/ev",[{"->":".^.b","c":true},{"b":["^nothing",{"->":"f.4"},null]}],"nop","\n","ev",true,"/ev","~ret",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["^A line.","\n","ev",{"f()":"f"},"/ev",[{"->":".^.b","c":true},{"b":["\n","^Another line.","\n",{"->":"0.6"},null]}],"nop","\n",["done",{"#n":"g-0"}],null],"done",{"f":["ev",false,"/ev",[{"->":".^.b","c":true},{"b":["^nothing",{"->":"f.4"},null]}],"nop","\n","ev",true,"/ev","~ret",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/glue/simple_glue.ink.json b/test/fixture/compiled/runtime/glue/simple_glue.ink.json index d6e1ee83..071ae9f7 100644 --- a/test/fixture/compiled/runtime/glue/simple_glue.ink.json +++ b/test/fixture/compiled/runtime/glue/simple_glue.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["^Some ","<>","\n","^content","<>","^ with glue.","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["^Some ","<>","\n","^content","<>","^ with glue.","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/knots/knot_do_not_gather.ink.json b/test/fixture/compiled/runtime/knots/knot_do_not_gather.ink.json index 2501d4ad..fec7a0e8 100644 --- a/test/fixture/compiled/runtime/knots/knot_do_not_gather.ink.json +++ b/test/fixture/compiled/runtime/knots/knot_do_not_gather.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[{"->":"knot"},["done",{"#n":"g-0"}],null],"done",{"knot":[[{"->":".^.gather"},["^g","\n","done",{"#n":"gather"}],null],null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[{"->":"knot"},["done",{"#n":"g-0"}],null],"done",{"knot":[[{"->":".^.gather"},["^g","\n","done",{"#n":"gather"}],null],null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/knots/knot_stitch_gather_counts.ink.json b/test/fixture/compiled/runtime/knots/knot_stitch_gather_counts.ink.json index bbe7c62c..b279bb3e 100644 --- a/test/fixture/compiled/runtime/knots/knot_stitch_gather_counts.ink.json +++ b/test/fixture/compiled/runtime/knots/knot_stitch_gather_counts.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[{"->t->":"gather_count_test"},"ev",0,"/ev",{"VAR=":"knotCount","re":true},{"->t->":"knot_count_test"},"ev",0,"/ev",{"VAR=":"knotCount","re":true},{"->t->":"knot_count_test"},{"->t->":"stitch_count_test"},["done",{"#n":"g-0"}],null],"done",{"gather_count_test":[[["ev",{"VAR?":"gatherCount"},1,"+",{"VAR=":"gatherCount","re":true},"/ev","ev",{"VAR?":"gatherCount"},"out","/ev","^ ","ev",{"CNT?":".^"},"out","/ev","\n","ev",{"VAR?":"gatherCount"},3,"<","/ev",[{"->":".^.b","c":true},{"b":[{"->":".^.^.^"},{"->":".^.^.^.22"},null]}],"nop","\n","ev","void","/ev","->->",{"#f":5,"#n":"loop"}],null],null],"knot_count_test":["ev",{"VAR?":"knotCount"},1,"+",{"VAR=":"knotCount","re":true},"/ev","ev",{"VAR?":"knotCount"},"out","/ev","^ ","ev",{"CNT?":".^"},"out","/ev","\n","ev",{"VAR?":"knotCount"},3,"<","/ev",[{"->":".^.b","c":true},{"b":[{"->":".^.^.^"},{"->":".^.^.^.22"},null]}],"nop","\n","ev","void","/ev","->->",{"#f":1}],"stitch_count_test":["ev",0,"/ev",{"VAR=":"stitchCount","re":true},{"->t->":".^.stitch"},"ev",0,"/ev",{"VAR=":"stitchCount","re":true},{"->t->":".^.stitch"},"ev","void","/ev","->->",{"stitch":["ev",{"VAR?":"stitchCount"},1,"+",{"VAR=":"stitchCount","re":true},"/ev","ev",{"VAR?":"stitchCount"},"out","/ev","^ ","ev",{"CNT?":".^"},"out","/ev","\n","ev",{"VAR?":"stitchCount"},3,"<","/ev",[{"->":".^.b","c":true},{"b":[{"->":".^.^.^"},{"->":".^.^.^.22"},null]}],"nop","\n","ev","void","/ev","->->",{"#f":1}]}],"global decl":["ev",0,{"VAR=":"knotCount"},0,{"VAR=":"stitchCount"},0,{"VAR=":"gatherCount"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[{"->t->":"gather_count_test"},"ev",0,"/ev",{"VAR=":"knotCount","re":true},{"->t->":"knot_count_test"},"ev",0,"/ev",{"VAR=":"knotCount","re":true},{"->t->":"knot_count_test"},{"->t->":"stitch_count_test"},["done",{"#n":"g-0"}],null],"done",{"gather_count_test":[[["ev",{"VAR?":"gatherCount"},1,"+",{"VAR=":"gatherCount","re":true},"/ev","ev",{"VAR?":"gatherCount"},"out","/ev","^ ","ev",{"CNT?":".^"},"out","/ev","\n","ev",{"VAR?":"gatherCount"},3,"<","/ev",[{"->":".^.b","c":true},{"b":[{"->":".^.^.^"},{"->":".^.^.^.22"},null]}],"nop","\n","ev","void","/ev","->->",{"#f":5,"#n":"loop"}],null],null],"knot_count_test":["ev",{"VAR?":"knotCount"},1,"+",{"VAR=":"knotCount","re":true},"/ev","ev",{"VAR?":"knotCount"},"out","/ev","^ ","ev",{"CNT?":".^"},"out","/ev","\n","ev",{"VAR?":"knotCount"},3,"<","/ev",[{"->":".^.b","c":true},{"b":[{"->":".^.^.^"},{"->":".^.^.^.22"},null]}],"nop","\n","ev","void","/ev","->->",{"#f":1}],"stitch_count_test":["ev",0,"/ev",{"VAR=":"stitchCount","re":true},{"->t->":".^.stitch"},"ev",0,"/ev",{"VAR=":"stitchCount","re":true},{"->t->":".^.stitch"},"ev","void","/ev","->->",{"stitch":["ev",{"VAR?":"stitchCount"},1,"+",{"VAR=":"stitchCount","re":true},"/ev","ev",{"VAR?":"stitchCount"},"out","/ev","^ ","ev",{"CNT?":".^"},"out","/ev","\n","ev",{"VAR?":"stitchCount"},3,"<","/ev",[{"->":".^.b","c":true},{"b":[{"->":".^.^.^"},{"->":".^.^.^.22"},null]}],"nop","\n","ev","void","/ev","->->",{"#f":1}]}],"global decl":["ev",0,{"VAR=":"knotCount"},0,{"VAR=":"stitchCount"},0,{"VAR=":"gatherCount"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/knots/knot_thread_interaction.ink.json b/test/fixture/compiled/runtime/knots/knot_thread_interaction.ink.json index fab4ea0f..18fa0ed1 100644 --- a/test/fixture/compiled/runtime/knots/knot_thread_interaction.ink.json +++ b/test/fixture/compiled/runtime/knots/knot_thread_interaction.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[{"->":"knot"},["done",{"#n":"g-0"}],null],"done",{"knot":["thread",{"->":"threadB"},{"->t->":"tunnel"},"^THE END","\n","end",null],"tunnel":[[["^blah blah","\n",["ev",{"^->":"tunnel.0.g-0.2.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^wigwag",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"tunnel.0.g-0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.2.s"},[{"#n":"$r2"}],"\n",{"->":".^.^.^.g-1"},{"#f":5}],"#n":"g-0"}],{"g-1":["ev","void","/ev","->->",null]}],null],"threadB":[[["ev",{"^->":"threadB.0.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^option",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"threadB.0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.0.s"},[{"#n":"$r2"}],"\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":["^something","\n","done",null]}],null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[{"->":"knot"},["done",{"#n":"g-0"}],null],"done",{"knot":["thread",{"->":"threadB"},{"->t->":"tunnel"},"^THE END","\n","end",null],"tunnel":[[["^blah blah","\n",["ev",{"^->":"tunnel.0.g-0.2.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^wigwag",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"tunnel.0.g-0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.2.s"},[{"#n":"$r2"}],"\n",{"->":".^.^.^.g-1"},{"#f":5}],"#n":"g-0"}],{"g-1":["ev","void","/ev","->->",null]}],null],"threadB":[[["ev",{"^->":"threadB.0.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^option",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"threadB.0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.0.s"},[{"#n":"$r2"}],"\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":["^something","\n","done",null]}],null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/knots/knot_thread_interaction_2.ink.json b/test/fixture/compiled/runtime/knots/knot_thread_interaction_2.ink.json index ee49c208..1eb3cf79 100644 --- a/test/fixture/compiled/runtime/knots/knot_thread_interaction_2.ink.json +++ b/test/fixture/compiled/runtime/knots/knot_thread_interaction_2.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[{"->":"knot"},["done",{"#n":"g-0"}],null],"done",{"knot":["thread",{"->":"threadA"},"^When should this get printed?","\n","done",null],"threadA":[{"->t->":"tunnel"},"^Finishing thread.","\n","done",null],"tunnel":[[["^I’m in a tunnel","\n",["ev",{"^->":"tunnel.0.g-0.2.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^I’m an option",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"tunnel.0.g-0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.2.s"},[{"#n":"$r2"}],"\n",{"->":".^.^.^.g-1"},{"#f":5}],"#n":"g-0"}],{"g-1":["ev","void","/ev","->->",null]}],null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[{"->":"knot"},["done",{"#n":"g-0"}],null],"done",{"knot":["thread",{"->":"threadA"},"^When should this get printed?","\n","done",null],"threadA":[{"->t->":"tunnel"},"^Finishing thread.","\n","done",null],"tunnel":[[["^I’m in a tunnel","\n",["ev",{"^->":"tunnel.0.g-0.2.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^I’m an option",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"tunnel.0.g-0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.2.s"},[{"#n":"$r2"}],"\n",{"->":".^.^.^.g-1"},{"#f":5}],"#n":"g-0"}],{"g-1":["ev","void","/ev","->->",null]}],null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/lists/contains_empty_list_always_false.ink.json b/test/fixture/compiled/runtime/lists/contains_empty_list_always_false.ink.json new file mode 100644 index 00000000..35cb3c83 --- /dev/null +++ b/test/fixture/compiled/runtime/lists/contains_empty_list_always_false.ink.json @@ -0,0 +1 @@ +{"inkVersion":21,"root":[["ev",{"VAR?":"list"},{"list":{}},"?","out","/ev","\n","ev",{"list":{}},{"list":{}},"?","out","/ev","\n","ev",{"list":{}},{"VAR?":"list"},"?","out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev",{"list":{"list.a":1}},{"VAR=":"list"},"/ev","end",null]}],"listDefs":{"list":{"a":1,"b":2}}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/lists/empty_list_origin.ink.json b/test/fixture/compiled/runtime/lists/empty_list_origin.ink.json index 61ee60ac..d0545781 100644 --- a/test/fixture/compiled/runtime/lists/empty_list_origin.ink.json +++ b/test/fixture/compiled/runtime/lists/empty_list_origin.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",{"VAR?":"list"},"LIST_ALL","out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev",{"list":{},"origins":["list"]},{"VAR=":"list"},"/ev","end",null]}],"listDefs":{"list":{"a":1,"b":2}}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",{"VAR?":"list"},"LIST_ALL","out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev",{"list":{},"origins":["list"]},{"VAR=":"list"},"/ev","end",null]}],"listDefs":{"list":{"a":1,"b":2}}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/lists/empty_list_origin_after_assignment.ink.json b/test/fixture/compiled/runtime/lists/empty_list_origin_after_assignment.ink.json index 6dc82c50..ddcf32af 100644 --- a/test/fixture/compiled/runtime/lists/empty_list_origin_after_assignment.ink.json +++ b/test/fixture/compiled/runtime/lists/empty_list_origin_after_assignment.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",{"list":{}},"/ev",{"VAR=":"x","re":true},"ev",{"VAR?":"x"},"LIST_ALL","out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev",{"list":{},"origins":["x"]},{"VAR=":"x"},"/ev","end",null]}],"listDefs":{"x":{"a":1,"b":2,"c":3}}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",{"list":{}},"/ev",{"VAR=":"x","re":true},"ev",{"VAR?":"x"},"LIST_ALL","out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev",{"list":{},"origins":["x"]},{"VAR=":"x"},"/ev","end",null]}],"listDefs":{"x":{"a":1,"b":2,"c":3}}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/lists/list_basic_operations.ink.json b/test/fixture/compiled/runtime/lists/list_basic_operations.ink.json index 0cc636b3..69777586 100644 --- a/test/fixture/compiled/runtime/lists/list_basic_operations.ink.json +++ b/test/fixture/compiled/runtime/lists/list_basic_operations.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",{"VAR?":"list"},"out","/ev","\n","ev",{"list":{"list.a":1,"list.c":3}},{"list":{"list.b":2,"list.e":5}},"+","out","/ev","\n","ev",{"list":{"list.a":1,"list.b":2,"list.c":3}},{"list":{"list.c":3,"list.b":2,"list.e":5}},"L^","out","/ev","\n","ev",{"VAR?":"list"},{"list":{"list.b":2,"list.d":4,"list.e":5}},"?","out","/ev","\n","ev",{"VAR?":"list"},{"list":{"list.d":4,"list.b":2}},"?","out","/ev","\n","ev",{"VAR?":"list"},{"list":{"list.c":3}},"!?","out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev",{"list":{"list.b":2,"list.d":4}},{"VAR=":"list"},"/ev","end",null]}],"listDefs":{"list":{"a":1,"b":2,"c":3,"d":4,"e":5}}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",{"VAR?":"list"},"out","/ev","\n","ev",{"list":{"list.a":1,"list.c":3}},{"list":{"list.b":2,"list.e":5}},"+","out","/ev","\n","ev",{"list":{"list.a":1,"list.b":2,"list.c":3}},{"list":{"list.c":3,"list.b":2,"list.e":5}},"L^","out","/ev","\n","ev",{"VAR?":"list"},{"list":{"list.b":2,"list.d":4,"list.e":5}},"?","out","/ev","\n","ev",{"VAR?":"list"},{"list":{"list.d":4,"list.b":2}},"?","out","/ev","\n","ev",{"VAR?":"list"},{"list":{"list.c":3}},"!?","out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev",{"list":{"list.b":2,"list.d":4}},{"VAR=":"list"},"/ev","end",null]}],"listDefs":{"list":{"a":1,"b":2,"c":3,"d":4,"e":5}}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/lists/list_mixed_items.ink.json b/test/fixture/compiled/runtime/lists/list_mixed_items.ink.json index d01e33c5..93599755 100644 --- a/test/fixture/compiled/runtime/lists/list_mixed_items.ink.json +++ b/test/fixture/compiled/runtime/lists/list_mixed_items.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",{"VAR?":"list"},{"VAR?":"list2"},"+","out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev",{"list":{"list.a":1,"list.c":3}},{"VAR=":"list"},{"list":{"list2.y":2}},{"VAR=":"list2"},"/ev","end",null]}],"listDefs":{"list":{"a":1,"b":2,"c":3,"d":4,"e":5},"list2":{"x":1,"y":2,"z":3}}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",{"VAR?":"list"},{"VAR?":"list2"},"+","out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev",{"list":{"list.a":1,"list.c":3}},{"VAR=":"list"},{"list":{"list2.y":2}},{"VAR=":"list2"},"/ev","end",null]}],"listDefs":{"list":{"a":1,"b":2,"c":3,"d":4,"e":5},"list2":{"x":1,"y":2,"z":3}}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/lists/list_random.ink.json b/test/fixture/compiled/runtime/lists/list_random.ink.json index 907f8188..a8d30d04 100644 --- a/test/fixture/compiled/runtime/lists/list_random.ink.json +++ b/test/fixture/compiled/runtime/lists/list_random.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",{"VAR?":"l"},"lrnd","out","/ev","\n","ev",{"VAR?":"l"},"lrnd","out","/ev","\n","ev",{"VAR?":"l"},"lrnd","out","/ev","\n","ev",{"VAR?":"l"},"lrnd","out","/ev","\n","ev",{"VAR?":"l"},"lrnd","out","/ev","\n","ev",{"VAR?":"l"},"lrnd","out","/ev","\n","ev",{"VAR?":"l"},"lrnd","out","/ev","\n","ev",{"VAR?":"l"},"lrnd","out","/ev","\n","ev",{"VAR?":"l"},"lrnd","out","/ev","\n","ev",{"VAR?":"l"},"lrnd","out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev",{"list":{"l.B":2,"l.C":3,"l.D":4}},{"VAR=":"l"},"/ev","end",null]}],"listDefs":{"l":{"A":1,"B":2,"C":3,"D":4,"E":5}}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",{"VAR?":"l"},"lrnd","out","/ev","\n","ev",{"VAR?":"l"},"lrnd","out","/ev","\n","ev",{"VAR?":"l"},"lrnd","out","/ev","\n","ev",{"VAR?":"l"},"lrnd","out","/ev","\n","ev",{"VAR?":"l"},"lrnd","out","/ev","\n","ev",{"VAR?":"l"},"lrnd","out","/ev","\n","ev",{"VAR?":"l"},"lrnd","out","/ev","\n","ev",{"VAR?":"l"},"lrnd","out","/ev","\n","ev",{"VAR?":"l"},"lrnd","out","/ev","\n","ev",{"VAR?":"l"},"lrnd","out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev",{"list":{"l.B":2,"l.C":3,"l.D":4}},{"VAR=":"l"},"/ev","end",null]}],"listDefs":{"l":{"A":1,"B":2,"C":3,"D":4,"E":5}}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/lists/list_range.ink.json b/test/fixture/compiled/runtime/lists/list_range.ink.json index 27ce543f..0f17c724 100644 --- a/test/fixture/compiled/runtime/lists/list_range.ink.json +++ b/test/fixture/compiled/runtime/lists/list_range.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",{"VAR?":"Food"},"LIST_ALL",{"VAR?":"Currency"},"LIST_ALL","+","/ev",{"VAR=":"all","re":true},"\n","ev",{"VAR?":"all"},"out","/ev","\n","ev",{"VAR?":"all"},2,3,"range","out","/ev","\n","ev",{"VAR?":"Numbers"},"LIST_ALL",{"VAR?":"Two"},{"VAR?":"Six"},"range","out","/ev","\n","ev",{"list":{"Food.Pizza":1,"Food.Pasta":2}},-1,100,"range","out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev",{"list":{},"origins":["Food"]},{"VAR=":"Food"},{"list":{},"origins":["Currency"]},{"VAR=":"Currency"},{"list":{},"origins":["Numbers"]},{"VAR=":"Numbers"},{"list":{}},{"VAR=":"all"},"/ev","end",null]}],"listDefs":{"Food":{"Pizza":1,"Pasta":2,"Curry":3,"Paella":4},"Currency":{"Pound":1,"Euro":2,"Dollar":3},"Numbers":{"One":1,"Two":2,"Three":3,"Four":4,"Five":5,"Six":6,"Seven":7}}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",{"VAR?":"Food"},"LIST_ALL",{"VAR?":"Currency"},"LIST_ALL","+","/ev",{"VAR=":"all","re":true},"\n","ev",{"VAR?":"all"},"out","/ev","\n","ev",{"VAR?":"all"},2,3,"range","out","/ev","\n","ev",{"VAR?":"Numbers"},"LIST_ALL",{"VAR?":"Two"},{"VAR?":"Six"},"range","out","/ev","\n","ev",{"list":{"Food.Pizza":1,"Food.Pasta":2}},-1,100,"range","out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev",{"list":{},"origins":["Food"]},{"VAR=":"Food"},{"list":{},"origins":["Currency"]},{"VAR=":"Currency"},{"list":{},"origins":["Numbers"]},{"VAR=":"Numbers"},{"list":{}},{"VAR=":"all"},"/ev","end",null]}],"listDefs":{"Food":{"Pizza":1,"Pasta":2,"Curry":3,"Paella":4},"Currency":{"Pound":1,"Euro":2,"Dollar":3},"Numbers":{"One":1,"Two":2,"Three":3,"Four":4,"Five":5,"Six":6,"Seven":7}}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/lists/list_save_load.ink.json b/test/fixture/compiled/runtime/lists/list_save_load.ink.json index 73c666af..803f010d 100644 --- a/test/fixture/compiled/runtime/lists/list_save_load.ink.json +++ b/test/fixture/compiled/runtime/lists/list_save_load.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",{"VAR?":"l1"},{"VAR?":"l2"},"+","/ev",{"VAR=":"t","re":true},"ev",{"VAR?":"t"},"out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"elsewhere":["ev",{"VAR?":"t"},{"VAR?":"z"},"+",{"VAR=":"t","re":true},"/ev","ev",{"VAR?":"t"},"out","/ev","\n","end",null],"global decl":["ev",{"list":{"l1.a":1,"l1.c":3}},{"VAR=":"l1"},{"list":{"l2.x":1}},{"VAR=":"l2"},{"list":{}},{"VAR=":"t"},"/ev","end",null]}],"listDefs":{"l1":{"a":1,"b":2,"c":3},"l2":{"x":1,"y":2,"z":3}}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",{"VAR?":"l1"},{"VAR?":"l2"},"+","/ev",{"VAR=":"t","re":true},"ev",{"VAR?":"t"},"out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"elsewhere":["ev",{"VAR?":"t"},{"VAR?":"z"},"+",{"VAR=":"t","re":true},"/ev","ev",{"VAR?":"t"},"out","/ev","\n","end",null],"global decl":["ev",{"list":{"l1.a":1,"l1.c":3}},{"VAR=":"l1"},{"list":{"l2.x":1}},{"VAR=":"l2"},{"list":{}},{"VAR=":"t"},"/ev","end",null]}],"listDefs":{"l1":{"a":1,"b":2,"c":3},"l2":{"x":1,"y":2,"z":3}}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/lists/more_list_operations.ink.json b/test/fixture/compiled/runtime/lists/more_list_operations.ink.json index 8ed8ccc3..3ffd17c7 100644 --- a/test/fixture/compiled/runtime/lists/more_list_operations.ink.json +++ b/test/fixture/compiled/runtime/lists/more_list_operations.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",{"VAR?":"l"},"LIST_VALUE","out","/ev","\n","ev","^list",1,"listInt","out","/ev","\n","ev",{"list":{},"origins":["list"]},"/ev",{"temp=":"t"},"\n","ev",{"VAR?":"t"},{"VAR?":"n"},"+",{"VAR=":"t","re":true},"/ev","ev",{"VAR?":"t"},"out","/ev","\n","ev",{"VAR?":"t"},"LIST_ALL","/ev",{"VAR=":"t","re":true},"\n","ev",{"VAR?":"t"},{"VAR?":"n"},"-",{"VAR=":"t","re":true},"/ev","ev",{"VAR?":"t"},"out","/ev","\n","ev",{"VAR?":"t"},"LIST_INVERT","/ev",{"VAR=":"t","re":true},"\n","ev",{"VAR?":"t"},"out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev",{"list":{},"origins":["list"]},{"VAR=":"list"},"/ev","end",null]}],"listDefs":{"list":{"l":1,"m":5,"n":6}}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",{"VAR?":"l"},"LIST_VALUE","out","/ev","\n","ev","^list",1,"listInt","out","/ev","\n","ev",{"list":{},"origins":["list"]},"/ev",{"temp=":"t"},"\n","ev",{"VAR?":"t"},{"VAR?":"n"},"+",{"VAR=":"t","re":true},"/ev","ev",{"VAR?":"t"},"out","/ev","\n","ev",{"VAR?":"t"},"LIST_ALL","/ev",{"VAR=":"t","re":true},"\n","ev",{"VAR?":"t"},{"VAR?":"n"},"-",{"VAR=":"t","re":true},"/ev","ev",{"VAR?":"t"},"out","/ev","\n","ev",{"VAR?":"t"},"LIST_INVERT","/ev",{"VAR=":"t","re":true},"\n","ev",{"VAR?":"t"},"out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev",{"list":{},"origins":["list"]},{"VAR=":"list"},"/ev","end",null]}],"listDefs":{"list":{"l":1,"m":5,"n":6}}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/logic/logic_lines_with_newlines.ink.json b/test/fixture/compiled/runtime/logic/logic_lines_with_newlines.ink.json index 3ca5c7b8..f07b66fb 100644 --- a/test/fixture/compiled/runtime/logic/logic_lines_with_newlines.ink.json +++ b/test/fixture/compiled/runtime/logic/logic_lines_with_newlines.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",{"f()":"func"},"pop","/ev","\n","^text 2","\n","ev",{"f()":"func"},"/ev",{"temp=":"tempVar"},"\n","^text 2","\n",["done",{"#n":"g-0"}],null],"done",{"func":["^text1","\n","ev",true,"/ev","~ret",null],"global decl":["ev","/ev","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",{"f()":"func"},"pop","/ev","\n","^text 2","\n","ev",{"f()":"func"},"/ev",{"temp=":"tempVar"},"\n","^text 2","\n",["done",{"#n":"g-0"}],null],"done",{"func":["^text1","\n","ev",true,"/ev","~ret",null],"global decl":["ev","/ev","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/logic/multiline_logic_with_glue.ink.json b/test/fixture/compiled/runtime/logic/multiline_logic_with_glue.ink.json index 43a7c58d..17315453 100644 --- a/test/fixture/compiled/runtime/logic/multiline_logic_with_glue.ink.json +++ b/test/fixture/compiled/runtime/logic/multiline_logic_with_glue.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",true,"/ev",[{"->":".^.b","c":true},{"b":["\n","^a","\n",{"->":"0.4"},null]}],"nop","^ ","<>","^ b","\n","ev",true,"/ev",[{"->":".^.b","c":true},{"b":["\n","^a","\n",{"->":"0.13"},null]}],"nop","^ ","<>","^ ","ev",true,"/ev",[{"->":".^.b","c":true},{"b":["\n","^b","\n",{"->":"0.21"},null]}],"nop","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",true,"/ev",[{"->":".^.b","c":true},{"b":["\n","^a","\n",{"->":"0.4"},null]}],"nop","^ ","<>","^ b","\n","ev",true,"/ev",[{"->":".^.b","c":true},{"b":["\n","^a","\n",{"->":"0.13"},null]}],"nop","^ ","<>","^ ","ev",true,"/ev",[{"->":".^.b","c":true},{"b":["\n","^b","\n",{"->":"0.21"},null]}],"nop","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/logic/nested_pass_by_reference.ink.json b/test/fixture/compiled/runtime/logic/nested_pass_by_reference.ink.json index d0995934..a81fc6a0 100644 --- a/test/fixture/compiled/runtime/logic/nested_pass_by_reference.ink.json +++ b/test/fixture/compiled/runtime/logic/nested_pass_by_reference.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",{"VAR?":"globalVal"},"out","/ev","\n","ev",{"^var":"globalVal","ci":-1},{"f()":"squaresquare"},"pop","/ev","\n","ev",{"VAR?":"globalVal"},"out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"squaresquare":[{"temp=":"x"},"ev",{"^var":"x","ci":-1},{"f()":"square"},"out","/ev","^ ","ev",{"^var":"x","ci":-1},{"f()":"square"},"out","/ev","\n","ev","void","/ev","~ret",null],"square":[{"temp=":"x"},"ev",{"VAR?":"x"},{"VAR?":"x"},"*","/ev",{"temp=":"x","re":true},"ev","void","/ev","~ret",null],"global decl":["ev",5,{"VAR=":"globalVal"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",{"VAR?":"globalVal"},"out","/ev","\n","ev",{"^var":"globalVal","ci":-1},{"f()":"squaresquare"},"pop","/ev","\n","ev",{"VAR?":"globalVal"},"out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"squaresquare":[{"temp=":"x"},"ev",{"^var":"x","ci":-1},{"f()":"square"},"out","/ev","^ ","ev",{"^var":"x","ci":-1},{"f()":"square"},"out","/ev","\n","ev","void","/ev","~ret",null],"square":[{"temp=":"x"},"ev",{"VAR?":"x"},{"VAR?":"x"},"*","/ev",{"temp=":"x","re":true},"ev","void","/ev","~ret",null],"global decl":["ev",5,{"VAR=":"globalVal"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/logic/print_num.ink.json b/test/fixture/compiled/runtime/logic/print_num.ink.json index c46fc44e..3207e584 100644 --- a/test/fixture/compiled/runtime/logic/print_num.ink.json +++ b/test/fixture/compiled/runtime/logic/print_num.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["^. ","ev",4,{"f()":"print_num"},"out","/ev","^ .","\n","^. ","ev",15,{"f()":"print_num"},"out","/ev","^ .","\n","^. ","ev",37,{"f()":"print_num"},"out","/ev","^ .","\n","^. ","ev",101,{"f()":"print_num"},"out","/ev","^ .","\n","^. ","ev",222,{"f()":"print_num"},"out","/ev","^ .","\n","^. ","ev",1234,{"f()":"print_num"},"out","/ev","^ .","\n",["done",{"#n":"g-0"}],null],"done",{"print_num":[{"temp=":"x"},["ev",{"VAR?":"x"},1000,">=","/ev",{"->":".^.b","c":true},{"b":["\n","ev",{"VAR?":"x"},1000,"/",{"f()":".^.^.^"},"out","/ev","^ thousand ","ev",{"VAR?":"x"},1000,"%",0,">","/ev",[{"->":".^.b","c":true},{"b":["ev",{"VAR?":"x"},1000,"%",{"f()":"print_num"},"out","/ev",{"->":".^.^.^.17"},null]}],"nop","\n",{"->":".^.^.^.5"},null]}],["ev",{"VAR?":"x"},100,">=","/ev",{"->":".^.b","c":true},{"b":["\n","ev",{"VAR?":"x"},100,"/",{"f()":".^.^.^"},"out","/ev","^ hundred ","ev",{"VAR?":"x"},100,"%",0,">","/ev",[{"->":".^.b","c":true},{"b":["^and ","ev",{"VAR?":"x"},100,"%",{"f()":"print_num"},"out","/ev",{"->":".^.^.^.17"},null]}],"nop","\n",{"->":".^.^.^.5"},null]}],["ev",{"VAR?":"x"},0,"==","/ev",{"->":".^.b","c":true},{"b":["\n","^zero","\n",{"->":".^.^.^.5"},null]}],[{"->":".^.b"},{"b":["\n","ev",{"VAR?":"x"},20,">=","/ev",[{"->":".^.b","c":true},{"b":["\n","ev",{"VAR?":"x"},10,"/","/ev",["du","ev",2,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^twenty","\n",{"->":".^.^.^.15"},null]}],["du","ev",3,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^thirty","\n",{"->":".^.^.^.15"},null]}],["du","ev",4,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^forty","\n",{"->":".^.^.^.15"},null]}],["du","ev",5,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^fifty","\n",{"->":".^.^.^.15"},null]}],["du","ev",6,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^sixty","\n",{"->":".^.^.^.15"},null]}],["du","ev",7,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^seventy","\n",{"->":".^.^.^.15"},null]}],["du","ev",8,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^eighty","\n",{"->":".^.^.^.15"},null]}],["du","ev",9,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^ninety","\n",{"->":".^.^.^.15"},null]}],"pop","nop","\n","ev",{"VAR?":"x"},10,"%",0,">","/ev",[{"->":".^.b","c":true},{"b":["<>","^-","<>",{"->":".^.^.^.25"},null]}],"nop","\n",{"->":".^.^.^.7"},null]}],"nop","\n","ev",{"VAR?":"x"},10,"<",{"VAR?":"x"},20,">","||","/ev",[{"->":".^.b","c":true},{"b":["\n","ev",{"VAR?":"x"},10,"%","/ev",["du","ev",1,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^one","\n",{"->":".^.^.^.16"},null]}],["du","ev",2,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^two","\n",{"->":".^.^.^.16"},null]}],["du","ev",3,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^three","\n",{"->":".^.^.^.16"},null]}],["du","ev",4,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^four","\n",{"->":".^.^.^.16"},null]}],["du","ev",5,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^five","\n",{"->":".^.^.^.16"},null]}],["du","ev",6,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^six","\n",{"->":".^.^.^.16"},null]}],["du","ev",7,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^seven","\n",{"->":".^.^.^.16"},null]}],["du","ev",8,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^eight","\n",{"->":".^.^.^.16"},null]}],["du","ev",9,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^nine","\n",{"->":".^.^.^.16"},null]}],"pop","nop","\n",{"->":".^.^.^.20"},null]}],[{"->":".^.b"},{"b":["\n","ev",{"VAR?":"x"},"/ev",["du","ev",10,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^ten","\n",{"->":".^.^.^.15"},null]}],["du","ev",11,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^eleven","\n",{"->":".^.^.^.15"},null]}],["du","ev",12,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^twelve","\n",{"->":".^.^.^.15"},null]}],["du","ev",13,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^thirteen","\n",{"->":".^.^.^.15"},null]}],["du","ev",14,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^fourteen","\n",{"->":".^.^.^.15"},null]}],["du","ev",15,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^fifteen","\n",{"->":".^.^.^.15"},null]}],["du","ev",16,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^sixteen","\n",{"->":".^.^.^.15"},null]}],["du","ev",17,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^seventeen","\n",{"->":".^.^.^.15"},null]}],["du","ev",18,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^eighteen","\n",{"->":".^.^.^.15"},null]}],["du","ev",19,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^nineteen","\n",{"->":".^.^.^.15"},null]}],"pop","nop","\n",{"->":".^.^.^.20"},null]}],"nop","\n",{"->":".^.^.^.5"},null]}],"nop","\n",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["^. ","ev",4,{"f()":"print_num"},"out","/ev","^ .","\n","^. ","ev",15,{"f()":"print_num"},"out","/ev","^ .","\n","^. ","ev",37,{"f()":"print_num"},"out","/ev","^ .","\n","^. ","ev",101,{"f()":"print_num"},"out","/ev","^ .","\n","^. ","ev",222,{"f()":"print_num"},"out","/ev","^ .","\n","^. ","ev",1234,{"f()":"print_num"},"out","/ev","^ .","\n",["done",{"#n":"g-0"}],null],"done",{"print_num":[{"temp=":"x"},["ev",{"VAR?":"x"},1000,">=","/ev",{"->":".^.b","c":true},{"b":["\n","ev",{"VAR?":"x"},1000,"/",{"f()":".^.^.^"},"out","/ev","^ thousand ","ev",{"VAR?":"x"},1000,"%",0,">","/ev",[{"->":".^.b","c":true},{"b":["ev",{"VAR?":"x"},1000,"%",{"f()":"print_num"},"out","/ev",{"->":".^.^.^.17"},null]}],"nop","\n",{"->":".^.^.^.5"},null]}],["ev",{"VAR?":"x"},100,">=","/ev",{"->":".^.b","c":true},{"b":["\n","ev",{"VAR?":"x"},100,"/",{"f()":".^.^.^"},"out","/ev","^ hundred ","ev",{"VAR?":"x"},100,"%",0,">","/ev",[{"->":".^.b","c":true},{"b":["^and ","ev",{"VAR?":"x"},100,"%",{"f()":"print_num"},"out","/ev",{"->":".^.^.^.17"},null]}],"nop","\n",{"->":".^.^.^.5"},null]}],["ev",{"VAR?":"x"},0,"==","/ev",{"->":".^.b","c":true},{"b":["\n","^zero","\n",{"->":".^.^.^.5"},null]}],[{"->":".^.b"},{"b":["\n","ev",{"VAR?":"x"},20,">=","/ev",[{"->":".^.b","c":true},{"b":["\n","ev",{"VAR?":"x"},10,"/","/ev",["du","ev",2,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^twenty","\n",{"->":".^.^.^.15"},null]}],["du","ev",3,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^thirty","\n",{"->":".^.^.^.15"},null]}],["du","ev",4,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^forty","\n",{"->":".^.^.^.15"},null]}],["du","ev",5,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^fifty","\n",{"->":".^.^.^.15"},null]}],["du","ev",6,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^sixty","\n",{"->":".^.^.^.15"},null]}],["du","ev",7,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^seventy","\n",{"->":".^.^.^.15"},null]}],["du","ev",8,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^eighty","\n",{"->":".^.^.^.15"},null]}],["du","ev",9,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^ninety","\n",{"->":".^.^.^.15"},null]}],"pop","nop","\n","ev",{"VAR?":"x"},10,"%",0,">","/ev",[{"->":".^.b","c":true},{"b":["<>","^-","<>",{"->":".^.^.^.25"},null]}],"nop","\n",{"->":".^.^.^.7"},null]}],"nop","\n","ev",{"VAR?":"x"},10,"<",{"VAR?":"x"},20,">","||","/ev",[{"->":".^.b","c":true},{"b":["\n","ev",{"VAR?":"x"},10,"%","/ev",["du","ev",1,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^one","\n",{"->":".^.^.^.16"},null]}],["du","ev",2,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^two","\n",{"->":".^.^.^.16"},null]}],["du","ev",3,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^three","\n",{"->":".^.^.^.16"},null]}],["du","ev",4,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^four","\n",{"->":".^.^.^.16"},null]}],["du","ev",5,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^five","\n",{"->":".^.^.^.16"},null]}],["du","ev",6,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^six","\n",{"->":".^.^.^.16"},null]}],["du","ev",7,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^seven","\n",{"->":".^.^.^.16"},null]}],["du","ev",8,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^eight","\n",{"->":".^.^.^.16"},null]}],["du","ev",9,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^nine","\n",{"->":".^.^.^.16"},null]}],"pop","nop","\n",{"->":".^.^.^.20"},null]}],[{"->":".^.b"},{"b":["\n","ev",{"VAR?":"x"},"/ev",["du","ev",10,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^ten","\n",{"->":".^.^.^.15"},null]}],["du","ev",11,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^eleven","\n",{"->":".^.^.^.15"},null]}],["du","ev",12,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^twelve","\n",{"->":".^.^.^.15"},null]}],["du","ev",13,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^thirteen","\n",{"->":".^.^.^.15"},null]}],["du","ev",14,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^fourteen","\n",{"->":".^.^.^.15"},null]}],["du","ev",15,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^fifteen","\n",{"->":".^.^.^.15"},null]}],["du","ev",16,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^sixteen","\n",{"->":".^.^.^.15"},null]}],["du","ev",17,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^seventeen","\n",{"->":".^.^.^.15"},null]}],["du","ev",18,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^eighteen","\n",{"->":".^.^.^.15"},null]}],["du","ev",19,"==","/ev",{"->":".^.b","c":true},{"b":["pop","\n","^nineteen","\n",{"->":".^.^.^.15"},null]}],"pop","nop","\n",{"->":".^.^.^.20"},null]}],"nop","\n",{"->":".^.^.^.5"},null]}],"nop","\n",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/misc/empty.ink.json b/test/fixture/compiled/runtime/misc/empty.ink.json index 8496cf25..274a07c0 100644 --- a/test/fixture/compiled/runtime/misc/empty.ink.json +++ b/test/fixture/compiled/runtime/misc/empty.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/misc/end.ink.json b/test/fixture/compiled/runtime/misc/end.ink.json index 31118ca0..3ca3ac4c 100644 --- a/test/fixture/compiled/runtime/misc/end.ink.json +++ b/test/fixture/compiled/runtime/misc/end.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["^hello","\n","end","^world","\n","end",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["^hello","\n","end","^world","\n","end",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/misc/end2.ink.json b/test/fixture/compiled/runtime/misc/end2.ink.json index 89b50c01..c4488afa 100644 --- a/test/fixture/compiled/runtime/misc/end2.ink.json +++ b/test/fixture/compiled/runtime/misc/end2.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[{"->":"test"},["done",{"#n":"g-0"}],null],"done",{"test":["^hello","\n","end","^world","\n","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[{"->":"test"},["done",{"#n":"g-0"}],null],"done",{"test":["^hello","\n","end","^world","\n","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/misc/end_of_content.ink.json b/test/fixture/compiled/runtime/misc/end_of_content.ink.json index 2bc73f3d..5fcd8f78 100644 --- a/test/fixture/compiled/runtime/misc/end_of_content.ink.json +++ b/test/fixture/compiled/runtime/misc/end_of_content.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[["done",{"#n":"g-0"}],null],"done",{"test":["^Content","\n","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[["done",{"#n":"g-0"}],null],"done",{"test":["^Content","\n","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/misc/escape_character.ink.json b/test/fixture/compiled/runtime/misc/escape_character.ink.json index 061fd963..d6613275 100644 --- a/test/fixture/compiled/runtime/misc/escape_character.ink.json +++ b/test/fixture/compiled/runtime/misc/escape_character.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",true,"/ev",[{"->":".^.b","c":true},{"b":["^this is a '|' character",{"->":"0.5"},null]}],[{"->":".^.b"},{"b":["^this isn't",{"->":"0.5"},null]}],"nop","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",true,"/ev",[{"->":".^.b","c":true},{"b":["^this is a '|' character",{"->":"0.5"},null]}],[{"->":".^.b"},{"b":["^this isn't",{"->":"0.5"},null]}],"nop","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/misc/hello_world.ink.json b/test/fixture/compiled/runtime/misc/hello_world.ink.json index 483f2c6a..8be5fadb 100644 --- a/test/fixture/compiled/runtime/misc/hello_world.ink.json +++ b/test/fixture/compiled/runtime/misc/hello_world.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["^Hello world","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["^Hello world","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/misc/identifiers_can_start_with_number.ink.json b/test/fixture/compiled/runtime/misc/identifiers_can_start_with_number.ink.json index 32c1506e..f736a849 100644 --- a/test/fixture/compiled/runtime/misc/identifiers_can_start_with_number.ink.json +++ b/test/fixture/compiled/runtime/misc/identifiers_can_start_with_number.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[{"->":"2tests"},["done",{"#n":"g-0"}],null],"done",{"2tests":["ev",512,2,"*","/ev",{"temp=":"512x2"},"ev",{"VAR?":"512x2"},2,"+","/ev",{"temp=":"512x2p2"},"^512x2 = ","ev",{"VAR?":"512x2"},"out","/ev","\n","^512x2p2 = ","ev",{"VAR?":"512x2p2"},"out","/ev","\n","done",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[{"->":"2tests"},["done",{"#n":"g-0"}],null],"done",{"2tests":["ev",512,2,"*","/ev",{"temp=":"512x2"},"ev",{"VAR?":"512x2"},2,"+","/ev",{"temp=":"512x2p2"},"^512x2 = ","ev",{"VAR?":"512x2"},"out","/ev","\n","^512x2p2 = ","ev",{"VAR?":"512x2p2"},"out","/ev","\n","done",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/misc/include.ink.json b/test/fixture/compiled/runtime/misc/include.ink.json index 11177b5e..1cde77a8 100644 --- a/test/fixture/compiled/runtime/misc/include.ink.json +++ b/test/fixture/compiled/runtime/misc/include.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["^This is include 1.","\n","\n","^This is include 2.","\n","\n","^This is the main file.","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["^This is include 1.","\n","\n","^This is include 2.","\n","\n","^This is the main file.","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/misc/nested_include.ink.json b/test/fixture/compiled/runtime/misc/nested_include.ink.json index d8b408eb..535ee296 100644 --- a/test/fixture/compiled/runtime/misc/nested_include.ink.json +++ b/test/fixture/compiled/runtime/misc/nested_include.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["^The value of a variable in test file 2 is ","ev",{"VAR?":"t2"},"out","/ev","^.","\n","\n","\n","^This is the main file","\n",{"->":"knot_in_2"},["done",{"#n":"g-0"}],null],"done",{"knot_in_2":["^The value when accessed from knot_in_2 is ","ev",{"VAR?":"t2"},"out","/ev","^.","\n","end",null],"global decl":["ev",5,{"VAR=":"t2"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["^The value of a variable in test file 2 is ","ev",{"VAR?":"t2"},"out","/ev","^.","\n","\n","\n","^This is the main file","\n",{"->":"knot_in_2"},["done",{"#n":"g-0"}],null],"done",{"knot_in_2":["^The value when accessed from knot_in_2 is ","ev",{"VAR?":"t2"},"out","/ev","^.","\n","end",null],"global decl":["ev",5,{"VAR=":"t2"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/misc/quote_character_significance.ink.json b/test/fixture/compiled/runtime/misc/quote_character_significance.ink.json index 9d73144f..13beb87d 100644 --- a/test/fixture/compiled/runtime/misc/quote_character_significance.ink.json +++ b/test/fixture/compiled/runtime/misc/quote_character_significance.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["^My name is \"","ev","str","^J","ev","str","^o","/str","out","/ev","^e","/str","out","/ev","^\"","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["^My name is \"","ev","str","^J","ev","str","^o","/str","out","/ev","^e","/str","out","/ev","^\"","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/misc/whitespace.ink.json b/test/fixture/compiled/runtime/misc/whitespace.ink.json index 7b640bdd..7504b76f 100644 --- a/test/fixture/compiled/runtime/misc/whitespace.ink.json +++ b/test/fixture/compiled/runtime/misc/whitespace.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[{"->":"firstKnot"},["done",{"#n":"g-0"}],null],"done",{"firstKnot":["^Hello!","\n",{"->":"anotherKnot"},null],"anotherKnot":["^World.","\n","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[{"->":"firstKnot"},["done",{"#n":"g-0"}],null],"done",{"firstKnot":["^Hello!","\n",{"->":"anotherKnot"},null],"anotherKnot":["^World.","\n","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/multiflow/multi_flow_basics.ink.json b/test/fixture/compiled/runtime/multiflow/multi_flow_basics.ink.json index 8ac9221d..09d69dbb 100644 --- a/test/fixture/compiled/runtime/multiflow/multi_flow_basics.ink.json +++ b/test/fixture/compiled/runtime/multiflow/multi_flow_basics.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[["done",{"#n":"g-0"}],null],"done",{"knot1":["^knot 1 line 1","\n","^knot 1 line 2","\n","end",null],"knot2":["^knot 2 line 1","\n","^knot 2 line 2","\n","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[["done",{"#n":"g-0"}],null],"done",{"knot1":["^knot 1 line 1","\n","^knot 1 line 2","\n","end",null],"knot2":["^knot 2 line 1","\n","^knot 2 line 2","\n","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/multiflow/multi_flow_save_load_threads.ink.json b/test/fixture/compiled/runtime/multiflow/multi_flow_save_load_threads.ink.json index 827d2d61..1a11845e 100644 --- a/test/fixture/compiled/runtime/multiflow/multi_flow_save_load_threads.ink.json +++ b/test/fixture/compiled/runtime/multiflow/multi_flow_save_load_threads.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["^Default line 1","\n","^Default line 2","\n",["done",{"#n":"g-0"}],null],"done",{"red":["^Hello I'm red","\n","ev","str","^red","/str","/ev","thread",{"->":"thread1"},"ev","str","^red","/str","/ev","thread",{"->":"thread2"},"done",null],"blue":["^Hello I'm blue","\n","ev","str","^blue","/str","/ev","thread",{"->":"thread1"},"ev","str","^blue","/str","/ev","thread",{"->":"thread2"},"done",null],"thread1":[{"temp=":"name"},[["ev",{"^->":"thread1.1.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":2},{"s":["^Thread 1 ","ev",{"VAR?":"name"},"out","/ev","^ choice",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"thread1.1.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.0.s"},[{"#n":"$r2"}],"\n","ev",{"VAR?":"name"},"/ev",{"->":"thread1Choice"},null]}],null],"thread2":[{"temp=":"name"},[["ev",{"^->":"thread2.1.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":2},{"s":["^Thread 2 ","ev",{"VAR?":"name"},"out","/ev","^ choice",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"thread2.1.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.0.s"},[{"#n":"$r2"}],"\n","ev",{"VAR?":"name"},"/ev",{"->":"thread2Choice"},null]}],null],"thread1Choice":[{"temp=":"name"},"^After thread 1 choice (","ev",{"VAR?":"name"},"out","/ev","^)","\n","end",null],"thread2Choice":[{"temp=":"name"},"^After thread 2 choice (","ev",{"VAR?":"name"},"out","/ev","^)","\n","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["^Default line 1","\n","^Default line 2","\n",["done",{"#n":"g-0"}],null],"done",{"red":["^Hello I'm red","\n","ev","str","^red","/str","/ev","thread",{"->":"thread1"},"ev","str","^red","/str","/ev","thread",{"->":"thread2"},"done",null],"blue":["^Hello I'm blue","\n","ev","str","^blue","/str","/ev","thread",{"->":"thread1"},"ev","str","^blue","/str","/ev","thread",{"->":"thread2"},"done",null],"thread1":[{"temp=":"name"},[["ev",{"^->":"thread1.1.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":2},{"s":["^Thread 1 ","ev",{"VAR?":"name"},"out","/ev","^ choice",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"thread1.1.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.0.s"},[{"#n":"$r2"}],"\n","ev",{"VAR?":"name"},"/ev",{"->":"thread1Choice"},null]}],null],"thread2":[{"temp=":"name"},[["ev",{"^->":"thread2.1.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":2},{"s":["^Thread 2 ","ev",{"VAR?":"name"},"out","/ev","^ choice",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"thread2.1.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.0.s"},[{"#n":"$r2"}],"\n","ev",{"VAR?":"name"},"/ev",{"->":"thread2Choice"},null]}],null],"thread1Choice":[{"temp=":"name"},"^After thread 1 choice (","ev",{"VAR?":"name"},"out","/ev","^)","\n","end",null],"thread2Choice":[{"temp=":"name"},"^After thread 2 choice (","ev",{"VAR?":"name"},"out","/ev","^)","\n","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/newlines/newline_at_start_of_multiline_conditional.ink.json b/test/fixture/compiled/runtime/newlines/newline_at_start_of_multiline_conditional.ink.json index db396425..b56de18b 100644 --- a/test/fixture/compiled/runtime/newlines/newline_at_start_of_multiline_conditional.ink.json +++ b/test/fixture/compiled/runtime/newlines/newline_at_start_of_multiline_conditional.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",{"f()":"isTrue"},"/ev",[{"->":".^.b","c":true},{"b":["\n","^x","\n",{"->":"0.4"},null]}],"nop","\n",["done",{"#n":"g-0"}],null],"done",{"isTrue":["^X","\n","ev",true,"/ev","~ret",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",{"f()":"isTrue"},"/ev",[{"->":".^.b","c":true},{"b":["\n","^x","\n",{"->":"0.4"},null]}],"nop","\n",["done",{"#n":"g-0"}],null],"done",{"isTrue":["^X","\n","ev",true,"/ev","~ret",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/newlines/newline_consistency_1.ink.json b/test/fixture/compiled/runtime/newlines/newline_consistency_1.ink.json index 207c14f5..05ae6d45 100644 --- a/test/fixture/compiled/runtime/newlines/newline_consistency_1.ink.json +++ b/test/fixture/compiled/runtime/newlines/newline_consistency_1.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["^hello ",{"->":"world"},"\n",["done",{"#n":"g-0"}],null],"done",{"world":["^world","\n","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["^hello ",{"->":"world"},"\n",["done",{"#n":"g-0"}],null],"done",{"world":["^world","\n","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/newlines/newline_consistency_2.ink.json b/test/fixture/compiled/runtime/newlines/newline_consistency_2.ink.json index 69ddd18d..cf991192 100644 --- a/test/fixture/compiled/runtime/newlines/newline_consistency_2.ink.json +++ b/test/fixture/compiled/runtime/newlines/newline_consistency_2.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[["ev",{"^->":"0.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":"0.c-0","flg":18},{"s":["^hello ",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":"0.0.s"},[{"#n":"$r2"}],{"->":"world"},"\n",{"->":"0.g-0"},{"#f":5}],"g-0":["done",null]}],"done",{"world":["^world","\n","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[["ev",{"^->":"0.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":"0.c-0","flg":18},{"s":["^hello ",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":"0.0.s"},[{"#n":"$r2"}],{"->":"world"},"\n",{"->":"0.g-0"},{"#f":5}],"g-0":["done",null]}],"done",{"world":["^world","\n","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/newlines/newline_consistency_3.ink.json b/test/fixture/compiled/runtime/newlines/newline_consistency_3.ink.json index 3458d8b6..7496225d 100644 --- a/test/fixture/compiled/runtime/newlines/newline_consistency_3.ink.json +++ b/test/fixture/compiled/runtime/newlines/newline_consistency_3.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[["ev",{"^->":"0.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":"0.c-0","flg":18},{"s":["^hello",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":"0.0.s"},[{"#n":"$r2"}],"\n",{"->":"world"},{"->":"0.g-0"},{"#f":5}],"g-0":["done",null]}],"done",{"world":["^world","\n","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[["ev",{"^->":"0.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":"0.c-0","flg":18},{"s":["^hello",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":"0.0.s"},[{"#n":"$r2"}],"\n",{"->":"world"},{"->":"0.g-0"},{"#f":5}],"g-0":["done",null]}],"done",{"world":["^world","\n","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/newlines/newlines_trimming_with_func_external_fallback.ink.json b/test/fixture/compiled/runtime/newlines/newlines_trimming_with_func_external_fallback.ink.json index b3792e87..3aa9e7af 100644 --- a/test/fixture/compiled/runtime/newlines/newlines_trimming_with_func_external_fallback.ink.json +++ b/test/fixture/compiled/runtime/newlines/newlines_trimming_with_func_external_fallback.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["^Phrase 1","\n","ev",{"x()":"TRUE"},"/ev",[{"->":".^.b","c":true},{"b":["\n","^Phrase 2","\n",{"->":"0.6"},null]}],"nop","\n","end",["done",{"#n":"g-0"}],null],"done",{"TRUE":["ev",true,"/ev","~ret",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["^Phrase 1","\n","ev",{"x()":"TRUE"},"/ev",[{"->":".^.b","c":true},{"b":["\n","^Phrase 2","\n",{"->":"0.6"},null]}],"nop","\n","end",["done",{"#n":"g-0"}],null],"done",{"TRUE":["ev",true,"/ev","~ret",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/newlines/newlines_with_string_eval.ink.json b/test/fixture/compiled/runtime/newlines/newlines_with_string_eval.ink.json index 552c38bc..11fd3b83 100644 --- a/test/fixture/compiled/runtime/newlines/newlines_with_string_eval.ink.json +++ b/test/fixture/compiled/runtime/newlines/newlines_with_string_eval.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["^A","\n","ev",{"f()":"string"},"/ev",{"temp=":"someTemp"},"\n","^B","\n","^A","\n","ev",{"f()":"string"},"out","/ev","\n","^B","\n",["done",{"#n":"g-0"}],null],"done",{"string":["ev","str","ev",3,"out","/ev","/str","/ev","~ret",null],"global decl":["ev","/ev","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["^A","\n","ev",{"f()":"string"},"/ev",{"temp=":"someTemp"},"\n","^B","\n","^A","\n","ev",{"f()":"string"},"out","/ev","\n","^B","\n",["done",{"#n":"g-0"}],null],"done",{"string":["ev","str","ev",3,"out","/ev","/str","/ev","~ret",null],"global decl":["ev","/ev","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/sequences/all_sequence_types.ink.json b/test/fixture/compiled/runtime/sequences/all_sequence_types.ink.json index 60b14f1d..c8ed2e16 100644 --- a/test/fixture/compiled/runtime/sequences/all_sequence_types.ink.json +++ b/test/fixture/compiled/runtime/sequences/all_sequence_types.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",1,"srnd","pop","/ev","\n","^Once: ","ev",{"f()":"f_once"},"out","/ev","^ ","ev",{"f()":"f_once"},"out","/ev","^ ","ev",{"f()":"f_once"},"out","/ev","^ ","ev",{"f()":"f_once"},"out","/ev","\n","^Stopping: ","ev",{"f()":"f_stopping"},"out","/ev","^ ","ev",{"f()":"f_stopping"},"out","/ev","^ ","ev",{"f()":"f_stopping"},"out","/ev","^ ","ev",{"f()":"f_stopping"},"out","/ev","\n","^Default: ","ev",{"f()":"f_default"},"out","/ev","^ ","ev",{"f()":"f_default"},"out","/ev","^ ","ev",{"f()":"f_default"},"out","/ev","^ ","ev",{"f()":"f_default"},"out","/ev","\n","^Cycle: ","ev",{"f()":"f_cycle"},"out","/ev","^ ","ev",{"f()":"f_cycle"},"out","/ev","^ ","ev",{"f()":"f_cycle"},"out","/ev","^ ","ev",{"f()":"f_cycle"},"out","/ev","\n","^Shuffle: ","ev",{"f()":"f_shuffle"},"out","/ev","^ ","ev",{"f()":"f_shuffle"},"out","/ev","^ ","ev",{"f()":"f_shuffle"},"out","/ev","^ ","ev",{"f()":"f_shuffle"},"out","/ev","\n","^Shuffle stopping: ","ev",{"f()":"f_shuffle_stopping"},"out","/ev","^ ","ev",{"f()":"f_shuffle_stopping"},"out","/ev","^ ","ev",{"f()":"f_shuffle_stopping"},"out","/ev","^ ","ev",{"f()":"f_shuffle_stopping"},"out","/ev","\n","^Shuffle once: ","ev",{"f()":"f_shuffle_once"},"out","/ev","^ ","ev",{"f()":"f_shuffle_once"},"out","/ev","^ ","ev",{"f()":"f_shuffle_once"},"out","/ev","^ ","ev",{"f()":"f_shuffle_once"},"out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"f_once":[["ev","visit",2,"MIN","/ev","ev","du",0,"==","/ev",{"->":".^.s0","c":true},"ev","du",1,"==","/ev",{"->":".^.s1","c":true},"ev","du",2,"==","/ev",{"->":".^.s2","c":true},"nop",{"s0":["pop","\n","^one","\n",{"->":".^.^.23"},null],"s1":["pop","\n","^two","\n",{"->":".^.^.23"},null],"s2":["pop",{"->":".^.^.23"},null],"#f":5}],"\n",null],"f_stopping":[["ev","visit",1,"MIN","/ev","ev","du",0,"==","/ev",{"->":".^.s0","c":true},"ev","du",1,"==","/ev",{"->":".^.s1","c":true},"nop",{"s0":["pop","\n","^one","\n",{"->":".^.^.17"},null],"s1":["pop","\n","^two","\n",{"->":".^.^.17"},null],"#f":5}],"\n",null],"f_default":[["ev","visit",1,"MIN","/ev","ev","du",0,"==","/ev",{"->":".^.s0","c":true},"ev","du",1,"==","/ev",{"->":".^.s1","c":true},"nop",{"s0":["pop","^one",{"->":".^.^.17"},null],"s1":["pop","^two",{"->":".^.^.17"},null],"#f":5}],"\n",null],"f_cycle":[["ev","visit",2,"%","/ev","ev","du",0,"==","/ev",{"->":".^.s0","c":true},"ev","du",1,"==","/ev",{"->":".^.s1","c":true},"nop",{"s0":["pop","\n","^one","\n",{"->":".^.^.17"},null],"s1":["pop","\n","^two","\n",{"->":".^.^.17"},null],"#f":5}],"\n",null],"f_shuffle":[["ev","visit",2,"seq","/ev","ev","du",0,"==","/ev",{"->":".^.s0","c":true},"ev","du",1,"==","/ev",{"->":".^.s1","c":true},"nop",{"s0":["pop","\n","^one","\n",{"->":".^.^.17"},null],"s1":["pop","\n","^two","\n",{"->":".^.^.17"},null],"#f":5}],"\n",null],"f_shuffle_stopping":[["ev","visit",2,"MIN","du",2,"==",{"->":".^.10","c":true},2,"seq","nop","/ev","ev","du",0,"==","/ev",{"->":".^.s0","c":true},"ev","du",1,"==","/ev",{"->":".^.s1","c":true},"ev","du",2,"==","/ev",{"->":".^.s2","c":true},"nop",{"s0":["pop","\n","^one","\n",{"->":".^.^.30"},null],"s1":["pop","\n","^two","\n",{"->":".^.^.30"},null],"s2":["pop","\n","^final","\n",{"->":".^.^.30"},null],"#f":5}],"\n",null],"f_shuffle_once":[["ev","visit",2,"MIN","du",2,"==",{"->":".^.10","c":true},2,"seq","nop","/ev","ev","du",0,"==","/ev",{"->":".^.s0","c":true},"ev","du",1,"==","/ev",{"->":".^.s1","c":true},"ev","du",2,"==","/ev",{"->":".^.s2","c":true},"nop",{"s0":["pop","\n","^one","\n",{"->":".^.^.30"},null],"s1":["pop","\n","^two","\n",{"->":".^.^.30"},null],"s2":["pop",{"->":".^.^.30"},null],"#f":5}],"\n",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",1,"srnd","pop","/ev","\n","^Once: ","ev",{"f()":"f_once"},"out","/ev","^ ","ev",{"f()":"f_once"},"out","/ev","^ ","ev",{"f()":"f_once"},"out","/ev","^ ","ev",{"f()":"f_once"},"out","/ev","\n","^Stopping: ","ev",{"f()":"f_stopping"},"out","/ev","^ ","ev",{"f()":"f_stopping"},"out","/ev","^ ","ev",{"f()":"f_stopping"},"out","/ev","^ ","ev",{"f()":"f_stopping"},"out","/ev","\n","^Default: ","ev",{"f()":"f_default"},"out","/ev","^ ","ev",{"f()":"f_default"},"out","/ev","^ ","ev",{"f()":"f_default"},"out","/ev","^ ","ev",{"f()":"f_default"},"out","/ev","\n","^Cycle: ","ev",{"f()":"f_cycle"},"out","/ev","^ ","ev",{"f()":"f_cycle"},"out","/ev","^ ","ev",{"f()":"f_cycle"},"out","/ev","^ ","ev",{"f()":"f_cycle"},"out","/ev","\n","^Shuffle: ","ev",{"f()":"f_shuffle"},"out","/ev","^ ","ev",{"f()":"f_shuffle"},"out","/ev","^ ","ev",{"f()":"f_shuffle"},"out","/ev","^ ","ev",{"f()":"f_shuffle"},"out","/ev","\n","^Shuffle stopping: ","ev",{"f()":"f_shuffle_stopping"},"out","/ev","^ ","ev",{"f()":"f_shuffle_stopping"},"out","/ev","^ ","ev",{"f()":"f_shuffle_stopping"},"out","/ev","^ ","ev",{"f()":"f_shuffle_stopping"},"out","/ev","\n","^Shuffle once: ","ev",{"f()":"f_shuffle_once"},"out","/ev","^ ","ev",{"f()":"f_shuffle_once"},"out","/ev","^ ","ev",{"f()":"f_shuffle_once"},"out","/ev","^ ","ev",{"f()":"f_shuffle_once"},"out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"f_once":[["ev","visit",2,"MIN","/ev","ev","du",0,"==","/ev",{"->":".^.s0","c":true},"ev","du",1,"==","/ev",{"->":".^.s1","c":true},"ev","du",2,"==","/ev",{"->":".^.s2","c":true},"nop",{"s0":["pop","\n","^one","\n",{"->":".^.^.23"},null],"s1":["pop","\n","^two","\n",{"->":".^.^.23"},null],"s2":["pop",{"->":".^.^.23"},null],"#f":5}],"\n",null],"f_stopping":[["ev","visit",1,"MIN","/ev","ev","du",0,"==","/ev",{"->":".^.s0","c":true},"ev","du",1,"==","/ev",{"->":".^.s1","c":true},"nop",{"s0":["pop","\n","^one","\n",{"->":".^.^.17"},null],"s1":["pop","\n","^two","\n",{"->":".^.^.17"},null],"#f":5}],"\n",null],"f_default":[["ev","visit",1,"MIN","/ev","ev","du",0,"==","/ev",{"->":".^.s0","c":true},"ev","du",1,"==","/ev",{"->":".^.s1","c":true},"nop",{"s0":["pop","^one",{"->":".^.^.17"},null],"s1":["pop","^two",{"->":".^.^.17"},null],"#f":5}],"\n",null],"f_cycle":[["ev","visit",2,"%","/ev","ev","du",0,"==","/ev",{"->":".^.s0","c":true},"ev","du",1,"==","/ev",{"->":".^.s1","c":true},"nop",{"s0":["pop","\n","^one","\n",{"->":".^.^.17"},null],"s1":["pop","\n","^two","\n",{"->":".^.^.17"},null],"#f":5}],"\n",null],"f_shuffle":[["ev","visit",2,"seq","/ev","ev","du",0,"==","/ev",{"->":".^.s0","c":true},"ev","du",1,"==","/ev",{"->":".^.s1","c":true},"nop",{"s0":["pop","\n","^one","\n",{"->":".^.^.17"},null],"s1":["pop","\n","^two","\n",{"->":".^.^.17"},null],"#f":5}],"\n",null],"f_shuffle_stopping":[["ev","visit",2,"MIN","du",2,"==",{"->":".^.10","c":true},2,"seq","nop","/ev","ev","du",0,"==","/ev",{"->":".^.s0","c":true},"ev","du",1,"==","/ev",{"->":".^.s1","c":true},"ev","du",2,"==","/ev",{"->":".^.s2","c":true},"nop",{"s0":["pop","\n","^one","\n",{"->":".^.^.30"},null],"s1":["pop","\n","^two","\n",{"->":".^.^.30"},null],"s2":["pop","\n","^final","\n",{"->":".^.^.30"},null],"#f":5}],"\n",null],"f_shuffle_once":[["ev","visit",2,"MIN","du",2,"==",{"->":".^.10","c":true},2,"seq","nop","/ev","ev","du",0,"==","/ev",{"->":".^.s0","c":true},"ev","du",1,"==","/ev",{"->":".^.s1","c":true},"ev","du",2,"==","/ev",{"->":".^.s2","c":true},"nop",{"s0":["pop","\n","^one","\n",{"->":".^.^.30"},null],"s1":["pop","\n","^two","\n",{"->":".^.^.30"},null],"s2":["pop",{"->":".^.^.30"},null],"#f":5}],"\n",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/sequences/blanks_in_inline_sequences.ink.json b/test/fixture/compiled/runtime/sequences/blanks_in_inline_sequences.ink.json index fc0882e1..3656ad9a 100644 --- a/test/fixture/compiled/runtime/sequences/blanks_in_inline_sequences.ink.json +++ b/test/fixture/compiled/runtime/sequences/blanks_in_inline_sequences.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["^1. ",{"->t->":"seq1"},"\n","^2. ",{"->t->":"seq1"},"\n","^3. ",{"->t->":"seq1"},"\n","^4. ",{"->t->":"seq1"},"\n","^---","\n","^1. ",{"->t->":"seq2"},"\n","^2. ",{"->t->":"seq2"},"\n","^3. ",{"->t->":"seq2"},"\n","^---","\n","^1. ",{"->t->":"seq3"},"\n","^2. ",{"->t->":"seq3"},"\n","^3. ",{"->t->":"seq3"},"\n","^---","\n","^1. ",{"->t->":"seq4"},"\n","^2. ",{"->t->":"seq4"},"\n","^3. ",{"->t->":"seq4"},"\n",["done",{"#n":"g-0"}],null],"done",{"seq1":[["ev","visit",2,"MIN","/ev","ev","du",0,"==","/ev",{"->":".^.s0","c":true},"ev","du",1,"==","/ev",{"->":".^.s1","c":true},"ev","du",2,"==","/ev",{"->":".^.s2","c":true},"nop",{"s0":["pop","^a",{"->":".^.^.23"},null],"s1":["pop",{"->":".^.^.23"},null],"s2":["pop","^b",{"->":".^.^.23"},null],"#f":5}],"\n","ev","void","/ev","->->",null],"seq2":[["ev","visit",1,"MIN","/ev","ev","du",0,"==","/ev",{"->":".^.s0","c":true},"ev","du",1,"==","/ev",{"->":".^.s1","c":true},"nop",{"s0":["pop",{"->":".^.^.17"},null],"s1":["pop","^a",{"->":".^.^.17"},null],"#f":5}],"\n","ev","void","/ev","->->",null],"seq3":[["ev","visit",1,"MIN","/ev","ev","du",0,"==","/ev",{"->":".^.s0","c":true},"ev","du",1,"==","/ev",{"->":".^.s1","c":true},"nop",{"s0":["pop","^a",{"->":".^.^.17"},null],"s1":["pop",{"->":".^.^.17"},null],"#f":5}],"\n","ev","void","/ev","->->",null],"seq4":[["ev","visit",1,"MIN","/ev","ev","du",0,"==","/ev",{"->":".^.s0","c":true},"ev","du",1,"==","/ev",{"->":".^.s1","c":true},"nop",{"s0":["pop",{"->":".^.^.17"},null],"s1":["pop",{"->":".^.^.17"},null],"#f":5}],"\n","ev","void","/ev","->->",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["^1. ",{"->t->":"seq1"},"\n","^2. ",{"->t->":"seq1"},"\n","^3. ",{"->t->":"seq1"},"\n","^4. ",{"->t->":"seq1"},"\n","^---","\n","^1. ",{"->t->":"seq2"},"\n","^2. ",{"->t->":"seq2"},"\n","^3. ",{"->t->":"seq2"},"\n","^---","\n","^1. ",{"->t->":"seq3"},"\n","^2. ",{"->t->":"seq3"},"\n","^3. ",{"->t->":"seq3"},"\n","^---","\n","^1. ",{"->t->":"seq4"},"\n","^2. ",{"->t->":"seq4"},"\n","^3. ",{"->t->":"seq4"},"\n",["done",{"#n":"g-0"}],null],"done",{"seq1":[["ev","visit",2,"MIN","/ev","ev","du",0,"==","/ev",{"->":".^.s0","c":true},"ev","du",1,"==","/ev",{"->":".^.s1","c":true},"ev","du",2,"==","/ev",{"->":".^.s2","c":true},"nop",{"s0":["pop","^a",{"->":".^.^.23"},null],"s1":["pop",{"->":".^.^.23"},null],"s2":["pop","^b",{"->":".^.^.23"},null],"#f":5}],"\n","ev","void","/ev","->->",null],"seq2":[["ev","visit",1,"MIN","/ev","ev","du",0,"==","/ev",{"->":".^.s0","c":true},"ev","du",1,"==","/ev",{"->":".^.s1","c":true},"nop",{"s0":["pop",{"->":".^.^.17"},null],"s1":["pop","^a",{"->":".^.^.17"},null],"#f":5}],"\n","ev","void","/ev","->->",null],"seq3":[["ev","visit",1,"MIN","/ev","ev","du",0,"==","/ev",{"->":".^.s0","c":true},"ev","du",1,"==","/ev",{"->":".^.s1","c":true},"nop",{"s0":["pop","^a",{"->":".^.^.17"},null],"s1":["pop",{"->":".^.^.17"},null],"#f":5}],"\n","ev","void","/ev","->->",null],"seq4":[["ev","visit",1,"MIN","/ev","ev","du",0,"==","/ev",{"->":".^.s0","c":true},"ev","du",1,"==","/ev",{"->":".^.s1","c":true},"nop",{"s0":["pop",{"->":".^.^.17"},null],"s1":["pop",{"->":".^.^.17"},null],"#f":5}],"\n","ev","void","/ev","->->",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/sequences/empty_sequence_content.ink.json b/test/fixture/compiled/runtime/sequences/empty_sequence_content.ink.json index 08c31fdd..9395cbb4 100644 --- a/test/fixture/compiled/runtime/sequences/empty_sequence_content.ink.json +++ b/test/fixture/compiled/runtime/sequences/empty_sequence_content.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[{"->t->":"thing"},{"->t->":"thing"},{"->t->":"thing"},{"->t->":"thing"},{"->t->":"thing"},"^Done.","\n",["done",{"#n":"g-0"}],null],"done",{"thing":[["ev","visit",4,"MIN","/ev","ev","du",0,"==","/ev",{"->":".^.s0","c":true},"ev","du",1,"==","/ev",{"->":".^.s1","c":true},"ev","du",2,"==","/ev",{"->":".^.s2","c":true},"ev","du",3,"==","/ev",{"->":".^.s3","c":true},"ev","du",4,"==","/ev",{"->":".^.s4","c":true},"nop",{"s0":["pop","\n","^Wait for it....","\n",{"->":".^.^.35"},null],"s1":["pop",{"->":".^.^.35"},null],"s2":["pop",{"->":".^.^.35"},null],"s3":["pop","\n","^Surprise!","\n",{"->":".^.^.35"},null],"s4":["pop",{"->":".^.^.35"},null],"#f":5}],"\n","ev","void","/ev","->->",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[{"->t->":"thing"},{"->t->":"thing"},{"->t->":"thing"},{"->t->":"thing"},{"->t->":"thing"},"^Done.","\n",["done",{"#n":"g-0"}],null],"done",{"thing":[["ev","visit",4,"MIN","/ev","ev","du",0,"==","/ev",{"->":".^.s0","c":true},"ev","du",1,"==","/ev",{"->":".^.s1","c":true},"ev","du",2,"==","/ev",{"->":".^.s2","c":true},"ev","du",3,"==","/ev",{"->":".^.s3","c":true},"ev","du",4,"==","/ev",{"->":".^.s4","c":true},"nop",{"s0":["pop","\n","^Wait for it....","\n",{"->":".^.^.35"},null],"s1":["pop",{"->":".^.^.35"},null],"s2":["pop",{"->":".^.^.35"},null],"s3":["pop","\n","^Surprise!","\n",{"->":".^.^.35"},null],"s4":["pop",{"->":".^.^.35"},null],"#f":5}],"\n","ev","void","/ev","->->",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/sequences/gather_read_count_with_initial_sequence.ink.json b/test/fixture/compiled/runtime/sequences/gather_read_count_with_initial_sequence.ink.json index 40646936..fcf4947c 100644 --- a/test/fixture/compiled/runtime/sequences/gather_read_count_with_initial_sequence.ink.json +++ b/test/fixture/compiled/runtime/sequences/gather_read_count_with_initial_sequence.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[["ev",{"CNT?":".^.test"},"/ev",[{"->":".^.b","c":true},{"b":["^seen test",{"->":"0.opts.4"},null]}],"nop","\n",[["ev","visit",1,"MIN","/ev","ev","du",0,"==","/ev",{"->":".^.s0","c":true},"ev","du",1,"==","/ev",{"->":".^.s1","c":true},"nop",{"s0":["pop",{"->":"0.opts"},{"->":".^.^.17"},null],"s1":["pop",{"->":".^.^.17"},null],"#f":5}],"\n",["done",{"#n":"g-0"}],{"#f":5,"#n":"test"}],{"#n":"opts"}],null],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[["ev",{"CNT?":".^.test"},"/ev",[{"->":".^.b","c":true},{"b":["^seen test",{"->":"0.opts.4"},null]}],"nop","\n",[["ev","visit",1,"MIN","/ev","ev","du",0,"==","/ev",{"->":".^.s0","c":true},"ev","du",1,"==","/ev",{"->":".^.s1","c":true},"nop",{"s0":["pop",{"->":"0.opts"},{"->":".^.^.17"},null],"s1":["pop",{"->":".^.^.17"},null],"#f":5}],"\n",["done",{"#n":"g-0"}],{"#f":5,"#n":"test"}],{"#n":"opts"}],null],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/sequences/leading_newline_multiline_sequence.ink.json b/test/fixture/compiled/runtime/sequences/leading_newline_multiline_sequence.ink.json index 0b34864c..2b86a560 100644 --- a/test/fixture/compiled/runtime/sequences/leading_newline_multiline_sequence.ink.json +++ b/test/fixture/compiled/runtime/sequences/leading_newline_multiline_sequence.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[["ev","visit",1,"MIN","/ev","ev","du",0,"==","/ev",{"->":".^.s0","c":true},"ev","du",1,"==","/ev",{"->":".^.s1","c":true},"nop",{"s0":["pop","\n","^a line after an empty line","\n",{"->":"0.0.17"},null],"s1":["pop","\n","^blah","\n",{"->":"0.0.17"},null],"#f":5}],"\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[["ev","visit",1,"MIN","/ev","ev","du",0,"==","/ev",{"->":".^.s0","c":true},"ev","du",1,"==","/ev",{"->":".^.s1","c":true},"nop",{"s0":["pop","\n","^a line after an empty line","\n",{"->":"0.0.17"},null],"s1":["pop","\n","^blah","\n",{"->":"0.0.17"},null],"#f":5}],"\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/sequences/shuffle_stack_muddying.ink.json b/test/fixture/compiled/runtime/sequences/shuffle_stack_muddying.ink.json index 95504d74..15b9fb48 100644 --- a/test/fixture/compiled/runtime/sequences/shuffle_stack_muddying.ink.json +++ b/test/fixture/compiled/runtime/sequences/shuffle_stack_muddying.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev","str","^choice 1","/str",{"f()":"condFunc"},"/ev",{"*":"0.c-0","flg":21},"ev","str","^choice 2","/str",{"f()":"condFunc"},"/ev",{"*":"0.c-1","flg":21},"ev","str","^choice 3","/str",{"f()":"condFunc"},"/ev",{"*":"0.c-2","flg":21},"ev","str","^choice 4","/str",{"f()":"condFunc"},"/ev",{"*":"0.c-3","flg":21},{"c-0":["\n",{"->":"0.g-0"},{"#f":5}],"c-1":["\n",{"->":"0.g-0"},{"#f":5}],"c-2":["\n",{"->":"0.g-0"},{"#f":5}],"c-3":["\n",{"->":"0.g-0"},{"#f":5}],"g-0":["done",null]}],"done",{"condFunc":[["ev","visit",4,"seq","/ev","ev","du",0,"==","/ev",{"->":".^.s0","c":true},"ev","du",1,"==","/ev",{"->":".^.s1","c":true},"ev","du",2,"==","/ev",{"->":".^.s2","c":true},"ev","du",3,"==","/ev",{"->":".^.s3","c":true},"nop",{"s0":["pop","\n","ev",false,"/ev","~ret",{"->":".^.^.29"},null],"s1":["pop","\n","ev",true,"/ev","~ret",{"->":".^.^.29"},null],"s2":["pop","\n","ev",true,"/ev","~ret",{"->":".^.^.29"},null],"s3":["pop","\n","ev",false,"/ev","~ret",{"->":".^.^.29"},null],"#f":5}],"\n",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev","str","^choice 1","/str",{"f()":"condFunc"},"/ev",{"*":"0.c-0","flg":21},"ev","str","^choice 2","/str",{"f()":"condFunc"},"/ev",{"*":"0.c-1","flg":21},"ev","str","^choice 3","/str",{"f()":"condFunc"},"/ev",{"*":"0.c-2","flg":21},"ev","str","^choice 4","/str",{"f()":"condFunc"},"/ev",{"*":"0.c-3","flg":21},{"c-0":["\n",{"->":"0.g-0"},{"#f":5}],"c-1":["\n",{"->":"0.g-0"},{"#f":5}],"c-2":["\n",{"->":"0.g-0"},{"#f":5}],"c-3":["\n",{"->":"0.g-0"},{"#f":5}],"g-0":["done",null]}],"done",{"condFunc":[["ev","visit",4,"seq","/ev","ev","du",0,"==","/ev",{"->":".^.s0","c":true},"ev","du",1,"==","/ev",{"->":".^.s1","c":true},"ev","du",2,"==","/ev",{"->":".^.s2","c":true},"ev","du",3,"==","/ev",{"->":".^.s3","c":true},"nop",{"s0":["pop","\n","ev",false,"/ev","~ret",{"->":".^.^.29"},null],"s1":["pop","\n","ev",true,"/ev","~ret",{"->":".^.^.29"},null],"s2":["pop","\n","ev",true,"/ev","~ret",{"->":".^.^.29"},null],"s3":["pop","\n","ev",false,"/ev","~ret",{"->":".^.^.29"},null],"#f":5}],"\n",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/strings/string_constants.ink.json b/test/fixture/compiled/runtime/strings/string_constants.ink.json index f04cf339..e189d1cf 100644 --- a/test/fixture/compiled/runtime/strings/string_constants.ink.json +++ b/test/fixture/compiled/runtime/strings/string_constants.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",{"VAR?":"x"},"out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev","str","^hi","/str",{"VAR=":"x"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",{"VAR?":"x"},"out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev","str","^hi","/str",{"VAR=":"x"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/strings/string_contains.ink.json b/test/fixture/compiled/runtime/strings/string_contains.ink.json index f9a02e96..461935d6 100644 --- a/test/fixture/compiled/runtime/strings/string_contains.ink.json +++ b/test/fixture/compiled/runtime/strings/string_contains.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev","str","^hello world","/str","str","^o wo","/str","?","out","/ev","\n","ev","str","^hello world","/str","str","^something else","/str","?","out","/ev","\n","ev","str","^hello","/str","str","^","/str","?","out","/ev","\n","ev","str","^","/str","str","^","/str","?","out","/ev","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev","str","^hello world","/str","str","^o wo","/str","?","out","/ev","\n","ev","str","^hello world","/str","str","^something else","/str","?","out","/ev","\n","ev","str","^hello","/str","str","^","/str","?","out","/ev","\n","ev","str","^","/str","str","^","/str","?","out","/ev","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/strings/string_type_coercion.ink.json b/test/fixture/compiled/runtime/strings/string_type_coercion.ink.json index aeb43ebc..ff38c335 100644 --- a/test/fixture/compiled/runtime/strings/string_type_coercion.ink.json +++ b/test/fixture/compiled/runtime/strings/string_type_coercion.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev","str","^5","/str",5,"==","/ev",[{"->":".^.b","c":true},{"b":["^same",{"->":"0.9"},null]}],[{"->":".^.b"},{"b":["^different",{"->":"0.9"},null]}],"nop","\n","ev","str","^blah","/str",5,"==","/ev",[{"->":".^.b","c":true},{"b":["^same",{"->":"0.20"},null]}],[{"->":".^.b"},{"b":["^different",{"->":"0.20"},null]}],"nop","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev","str","^5","/str",5,"==","/ev",[{"->":".^.b","c":true},{"b":["^same",{"->":"0.9"},null]}],[{"->":".^.b"},{"b":["^different",{"->":"0.9"},null]}],"nop","\n","ev","str","^blah","/str",5,"==","/ev",[{"->":".^.b","c":true},{"b":["^same",{"->":"0.20"},null]}],[{"->":".^.b"},{"b":["^different",{"->":"0.20"},null]}],"nop","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/strings/strings_in_choices.ink.json b/test/fixture/compiled/runtime/strings/strings_in_choices.ink.json index b046566b..033f11c5 100644 --- a/test/fixture/compiled/runtime/strings/strings_in_choices.ink.json +++ b/test/fixture/compiled/runtime/strings/strings_in_choices.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[["ev",{"^->":"0.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","str","^\"test2 ","ev","str","^test3","/str","out","/ev","^\"","/str","/ev",{"*":"0.c-0","flg":22},{"s":["^ ","ev","str","^test1","/str","out","/ev","^ ",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":"0.0.s"},[{"#n":"$r2"}],"^ ","ev","str","^test4","/str","out","/ev","\n","done",{"->":"0.g-0"},{"#f":5}],"g-0":["done",null]}],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[["ev",{"^->":"0.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","str","^\"test2 ","ev","str","^test3","/str","out","/ev","^\"","/str","/ev",{"*":"0.c-0","flg":22},{"s":["^ ","ev","str","^test1","/str","out","/ev","^ ",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":"0.0.s"},[{"#n":"$r2"}],"^ ","ev","str","^test4","/str","out","/ev","\n","done",{"->":"0.g-0"},{"#f":5}],"g-0":["done",null]}],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/tags/tags.ink.json b/test/fixture/compiled/runtime/tags/tags.ink.json index e7156cee..5b5fabfa 100644 --- a/test/fixture/compiled/runtime/tags/tags.ink.json +++ b/test/fixture/compiled/runtime/tags/tags.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[{"#":"author: Joe"},{"#":"title: My Great Story"},"^This is the content","\n",["done",{"#n":"g-0"}],null],"done",{"knot":[{"#":"knot tag"},"^Knot content","\n",{"#":"end of knot tag"},"end",{"stitch":[{"#":"stitch tag"},"^Stitch content","\n",{"#":"this tag is below some content so isn't included in the static tags for the stitch"},"end",null]}],"global decl":["ev",2,{"VAR=":"x"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["#","^author: Joe","/#","#","^title: My Great Story","/#","^This is the content","\n",["done",{"#n":"g-0"}],null],"done",{"knot":["#","^knot tag","/#","^Knot content","\n","#","^end of knot tag","/#","end",{"stitch":["#","^stitch tag","/#","^Stitch content","\n","#","^this tag is below some content so isn't included in the static tags for the stitch","/#","end",null]}],"global decl":["ev",2,{"VAR=":"x"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/tags/tags_dynamic_content.ink.json b/test/fixture/compiled/runtime/tags/tags_dynamic_content.ink.json new file mode 100644 index 00000000..b2ed4599 --- /dev/null +++ b/test/fixture/compiled/runtime/tags/tags_dynamic_content.ink.json @@ -0,0 +1 @@ +{"inkVersion":21,"root":[["^tag ","#","^pic","ev",5,3,"+","out","/ev",["ev","visit",1,"MIN","/ev","ev","du",0,"==","/ev",{"->":".^.s0","c":true},"ev","du",1,"==","/ev",{"->":".^.s1","c":true},"nop",{"s0":["pop","^red",{"->":"0.9.17"},null],"s1":["pop","^blue",{"->":"0.9.17"},null],"#f":5}],"^.jpg","/#","\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/tags/tags_in_choice.ink.json b/test/fixture/compiled/runtime/tags/tags_in_choice.ink.json new file mode 100644 index 00000000..5184748d --- /dev/null +++ b/test/fixture/compiled/runtime/tags/tags_in_choice.ink.json @@ -0,0 +1 @@ +{"inkVersion":21,"root":[[["ev",{"^->":"0.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","str","^two ","#","^two","/#","/str","/ev",{"*":"0.c-0","flg":6},{"s":["^one ","#","^one ","/#",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":"0.0.s"},[{"#n":"$r2"}],"^ three ","#","^three ","/#","end","\n",{"->":"0.g-0"},null],"g-0":["done",null]}],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/tags/tags_in_seq.ink.json b/test/fixture/compiled/runtime/tags/tags_in_seq.ink.json new file mode 100644 index 00000000..5c2dfa29 --- /dev/null +++ b/test/fixture/compiled/runtime/tags/tags_in_seq.ink.json @@ -0,0 +1 @@ +{"inkVersion":21,"root":[[{"->t->":"knot"},{"->t->":"knot"},["done",{"#n":"g-0"}],null],"done",{"knot":["^A ",["ev","visit",3,"MIN","/ev","ev","du",0,"==","/ev",{"->":".^.s0","c":true},"ev","du",1,"==","/ev",{"->":".^.s1","c":true},"ev","du",2,"==","/ev",{"->":".^.s2","c":true},"ev","du",3,"==","/ev",{"->":".^.s3","c":true},"nop",{"s0":["pop","^red ","#","^red",{"->":".^.^.29"},null],"s1":["pop","^white ","/#","#","^white",{"->":".^.^.29"},null],"s2":["pop","^blue ","/#","#","^blue",{"->":".^.^.29"},null],"s3":["pop","^green ","/#","#","^green",{"->":".^.^.29"},null],"#f":5}],"/#","^ sequence.","\n","ev","void","/ev","->->",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/threads/multi_thread.ink.json b/test/fixture/compiled/runtime/threads/multi_thread.ink.json index 080af7f0..6246d348 100644 --- a/test/fixture/compiled/runtime/threads/multi_thread.ink.json +++ b/test/fixture/compiled/runtime/threads/multi_thread.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[{"->":"start"},["done",{"#n":"g-0"}],null],"done",{"start":[{"->t->":"tunnel"},"^The end","\n","end",null],"tunnel":["thread",{"->":"place1"},"thread",{"->":"place2"},"done",null],"place1":[["^This is place 1.","\n",["ev",{"^->":"place1.0.2.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^choice in place 1",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"place1.0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.2.s"},[{"#n":"$r2"}],"\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":["ev","void","/ev","->->",null]}],null],"place2":[["^This is place 2.","\n",["ev",{"^->":"place2.0.2.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^choice in place 2",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"place2.0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.2.s"},[{"#n":"$r2"}],"\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":["ev","void","/ev","->->",null]}],null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[{"->":"start"},["done",{"#n":"g-0"}],null],"done",{"start":[{"->t->":"tunnel"},"^The end","\n","end",null],"tunnel":["thread",{"->":"place1"},"thread",{"->":"place2"},"done",null],"place1":[["^This is place 1.","\n",["ev",{"^->":"place1.0.2.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^choice in place 1",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"place1.0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.2.s"},[{"#n":"$r2"}],"\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":["ev","void","/ev","->->",null]}],null],"place2":[["^This is place 2.","\n",["ev",{"^->":"place2.0.2.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^choice in place 2",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"place2.0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.2.s"},[{"#n":"$r2"}],"\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":["ev","void","/ev","->->",null]}],null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/threads/thread_done.ink.json b/test/fixture/compiled/runtime/threads/thread_done.ink.json index 65085358..98d2cc10 100644 --- a/test/fixture/compiled/runtime/threads/thread_done.ink.json +++ b/test/fixture/compiled/runtime/threads/thread_done.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["^This is a thread example","\n","thread",{"->":"example_thread"},"^The example is now complete.","\n",["done",{"#n":"g-0"}],null],"done",{"example_thread":["^Hello.","\n","done","^World.","\n","done",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["^This is a thread example","\n","thread",{"->":"example_thread"},"^The example is now complete.","\n",["done",{"#n":"g-0"}],null],"done",{"example_thread":["^Hello.","\n","done","^World.","\n","done",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/threads/thread_in_logic.ink.json b/test/fixture/compiled/runtime/threads/thread_in_logic.ink.json index 89f005df..9412831f 100644 --- a/test/fixture/compiled/runtime/threads/thread_in_logic.ink.json +++ b/test/fixture/compiled/runtime/threads/thread_in_logic.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[{"->t->":"once"},{"->t->":"once"},["done",{"#n":"g-0"}],null],"done",{"once":[["ev","visit",1,"MIN","/ev","ev","du",0,"==","/ev",{"->":".^.s0","c":true},"ev","du",1,"==","/ev",{"->":".^.s1","c":true},"nop",{"s0":["pop","thread",{"->":"content"},{"->":".^.^.17"},null],"s1":["pop",{"->":".^.^.17"},null],"#f":5}],"\n","ev","void","/ev","->->",null],"content":["^Content","\n","done",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[{"->t->":"once"},{"->t->":"once"},["done",{"#n":"g-0"}],null],"done",{"once":[["ev","visit",1,"MIN","/ev","ev","du",0,"==","/ev",{"->":".^.s0","c":true},"ev","du",1,"==","/ev",{"->":".^.s1","c":true},"nop",{"s0":["pop","thread",{"->":"content"},{"->":".^.^.17"},null],"s1":["pop",{"->":".^.^.17"},null],"#f":5}],"\n","ev","void","/ev","->->",null],"content":["^Content","\n","done",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/threads/top_flow_terminator_should_not_kill_thread_choices.ink.json b/test/fixture/compiled/runtime/threads/top_flow_terminator_should_not_kill_thread_choices.ink.json index 2f67db55..949c92b9 100644 --- a/test/fixture/compiled/runtime/threads/top_flow_terminator_should_not_kill_thread_choices.ink.json +++ b/test/fixture/compiled/runtime/threads/top_flow_terminator_should_not_kill_thread_choices.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["thread",{"->":"move"},"^Limes","\n",["done",{"#n":"g-0"}],null],"done",{"move":[[["ev",{"^->":"move.0.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^boop",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"move.0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.0.s"},[{"#n":"$r2"}],"\n","end",{"#f":5}]}],null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["thread",{"->":"move"},"^Limes","\n",["done",{"#n":"g-0"}],null],"done",{"move":[[["ev",{"^->":"move.0.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^boop",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"move.0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.0.s"},[{"#n":"$r2"}],"\n","end",{"#f":5}]}],null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/variables/const.ink.json b/test/fixture/compiled/runtime/variables/const.ink.json index 18f20ad0..3c9993f9 100644 --- a/test/fixture/compiled/runtime/variables/const.ink.json +++ b/test/fixture/compiled/runtime/variables/const.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",{"VAR?":"x"},"out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev",5,{"VAR=":"x"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",{"VAR?":"x"},"out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev",5,{"VAR=":"x"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/variables/multiple_constant_references.ink.json b/test/fixture/compiled/runtime/variables/multiple_constant_references.ink.json index df0cc382..64a7d2e1 100644 --- a/test/fixture/compiled/runtime/variables/multiple_constant_references.ink.json +++ b/test/fixture/compiled/runtime/variables/multiple_constant_references.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",{"VAR?":"varStr"},"str","^ConstantString","/str","==","/ev",[{"->":".^.b","c":true},{"b":["^success",{"->":"0.8"},null]}],"nop","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev","str","^ConstantString","/str",{"VAR=":"varStr"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",{"VAR?":"varStr"},"str","^ConstantString","/str","==","/ev",[{"->":".^.b","c":true},{"b":["^success",{"->":"0.8"},null]}],"nop","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev","str","^ConstantString","/str",{"VAR=":"varStr"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/variables/set_non_existant_variable.ink.json b/test/fixture/compiled/runtime/variables/set_non_existant_variable.ink.json index 840cac66..c4496702 100644 --- a/test/fixture/compiled/runtime/variables/set_non_existant_variable.ink.json +++ b/test/fixture/compiled/runtime/variables/set_non_existant_variable.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["^Hello ","ev",{"VAR?":"x"},"out","/ev","^.","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev","str","^world","/str",{"VAR=":"x"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["^Hello ","ev",{"VAR?":"x"},"out","/ev","^.","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev","str","^world","/str",{"VAR=":"x"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/variables/temp_global_conflict.ink.json b/test/fixture/compiled/runtime/variables/temp_global_conflict.ink.json index 531b7b13..fc41da2b 100644 --- a/test/fixture/compiled/runtime/variables/temp_global_conflict.ink.json +++ b/test/fixture/compiled/runtime/variables/temp_global_conflict.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[{"->":"outer"},["done",{"#n":"g-0"}],null],"done",{"outer":["ev",0,"/ev",{"temp=":"x"},"ev",{"^var":"x","ci":-1},{"f()":"f"},"pop","/ev","\n","ev",{"VAR?":"x"},"out","/ev","\n","done",null],"f":[{"temp=":"x"},"ev",0,"/ev",{"temp=":"local"},"ev",{"VAR?":"x"},"/ev",{"temp=":"x","re":true},"ev",{"^var":"local","ci":-1},{"f()":"setTo3"},"out","/ev","\n",null],"setTo3":[{"temp=":"x"},"ev",3,"/ev",{"temp=":"x","re":true},null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[{"->":"outer"},["done",{"#n":"g-0"}],null],"done",{"outer":["ev",0,"/ev",{"temp=":"x"},"ev",{"^var":"x","ci":-1},{"f()":"f"},"pop","/ev","\n","ev",{"VAR?":"x"},"out","/ev","\n","done",null],"f":[{"temp=":"x"},"ev",0,"/ev",{"temp=":"local"},"ev",{"VAR?":"x"},"/ev",{"temp=":"x","re":true},"ev",{"^var":"local","ci":-1},{"f()":"setTo3"},"out","/ev","\n",null],"setTo3":[{"temp=":"x"},"ev",3,"/ev",{"temp=":"x","re":true},null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/variables/temp_not_found.ink.json b/test/fixture/compiled/runtime/variables/temp_not_found.ink.json index ad7d73a0..55866dc6 100644 --- a/test/fixture/compiled/runtime/variables/temp_not_found.ink.json +++ b/test/fixture/compiled/runtime/variables/temp_not_found.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",{"VAR?":"x"},"out","/ev","\n","ev",5,"/ev",{"temp=":"x"},"^hello","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev","/ev","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",{"VAR?":"x"},"out","/ev","\n","ev",5,"/ev",{"temp=":"x"},"^hello","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev","/ev","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/variables/temp_usage_in_options.ink.json b/test/fixture/compiled/runtime/variables/temp_usage_in_options.ink.json index 11a9d98e..a236bb1f 100644 --- a/test/fixture/compiled/runtime/variables/temp_usage_in_options.ink.json +++ b/test/fixture/compiled/runtime/variables/temp_usage_in_options.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",1,"/ev",{"temp=":"one"},["ev",{"^->":"0.4.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":"0.c-0","flg":18},{"s":["^ ","ev",{"VAR?":"one"},"out","/ev",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":"0.4.s"},[{"#n":"$r2"}],"\n",{"->":"0.g-0"},{"#f":5}],"g-0":["^End of choice","\n",{"->":".^.c-1"},["ev",{"^->":"0.g-0.3.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","str","^is","/str","/ev",{"*":".^.^.c-1","flg":22},{"s":["^this ",{"->":"$r","var":true},null]}],{"c-1":["ev",{"^->":"0.g-0.c-1.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.3.s"},[{"#n":"$r2"}],"^ another","\n","done",{"->":"0.g-1"},{"#f":5}]}],"g-1":["done",null]}],"done",{"global decl":["ev","/ev","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",1,"/ev",{"temp=":"one"},["ev",{"^->":"0.4.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":"0.c-0","flg":18},{"s":["^ ","ev",{"VAR?":"one"},"out","/ev",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":"0.4.s"},[{"#n":"$r2"}],"\n",{"->":"0.g-0"},{"#f":5}],"g-0":["^End of choice","\n",{"->":".^.c-1"},["ev",{"^->":"0.g-0.3.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","str","^is","/str","/ev",{"*":".^.^.c-1","flg":22},{"s":["^this ",{"->":"$r","var":true},null]}],{"c-1":["ev",{"^->":"0.g-0.c-1.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.3.s"},[{"#n":"$r2"}],"^ another","\n","done",{"->":"0.g-1"},{"#f":5}]}],"g-1":["done",null]}],"done",{"global decl":["ev","/ev","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/variables/temporaries_at_global_scope.ink.json b/test/fixture/compiled/runtime/variables/temporaries_at_global_scope.ink.json index 71b13fb5..2e58f29c 100644 --- a/test/fixture/compiled/runtime/variables/temporaries_at_global_scope.ink.json +++ b/test/fixture/compiled/runtime/variables/temporaries_at_global_scope.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",4,"/ev",{"temp=":"y"},"ev",{"VAR?":"x"},"out","/ev","ev",{"VAR?":"y"},"out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev",5,{"VAR=":"x"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",4,"/ev",{"temp=":"y"},"ev",{"VAR?":"x"},"out","/ev","ev",{"VAR?":"y"},"out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev",5,{"VAR=":"x"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/variables/variable_declaration_in_conditional.ink.json b/test/fixture/compiled/runtime/variables/variable_declaration_in_conditional.ink.json index b59177f9..9b71b103 100644 --- a/test/fixture/compiled/runtime/variables/variable_declaration_in_conditional.ink.json +++ b/test/fixture/compiled/runtime/variables/variable_declaration_in_conditional.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",true,"/ev",[{"->":".^.b","c":true},{"b":["\n","ev",5,"/ev",{"VAR=":"x","re":true},{"->":"0.4"},null]}],"nop","\n","ev",{"VAR?":"x"},"out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev",0,{"VAR=":"x"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",true,"/ev",[{"->":".^.b","c":true},{"b":["\n","ev",5,"/ev",{"VAR=":"x","re":true},{"->":"0.4"},null]}],"nop","\n","ev",{"VAR?":"x"},"out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev",0,{"VAR=":"x"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/variables/variable_divert_target.ink.json b/test/fixture/compiled/runtime/variables/variable_divert_target.ink.json index 053698a1..85ee195d 100644 --- a/test/fixture/compiled/runtime/variables/variable_divert_target.ink.json +++ b/test/fixture/compiled/runtime/variables/variable_divert_target.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[{"->":"there"},["done",{"#n":"g-0"}],null],"done",{"there":[{"->":"x","var":true},null],"here":["^Here.","\n","done",{"#f":3}],"global decl":["ev",{"^->":"here"},{"VAR=":"x"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[{"->":"there"},["done",{"#n":"g-0"}],null],"done",{"there":[{"->":"x","var":true},null],"here":["^Here.","\n","done",{"#f":3}],"global decl":["ev",{"^->":"here"},{"VAR=":"x"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/variables/variable_get_set_api.ink.json b/test/fixture/compiled/runtime/variables/variable_get_set_api.ink.json index ce2cf771..205032a1 100644 --- a/test/fixture/compiled/runtime/variables/variable_get_set_api.ink.json +++ b/test/fixture/compiled/runtime/variables/variable_get_set_api.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",{"VAR?":"x"},"out","/ev","\n","ev","str","^choice","/str","/ev",{"*":"0.c-0","flg":20},{"c-0":["\n",{"->":"0.g-0"},{"#f":5}],"g-0":["ev",{"VAR?":"x"},"out","/ev","\n","ev","str","^choice","/str","/ev",{"*":".^.c-1","flg":20},{"c-1":["\n",{"->":"0.g-1"},{"#f":5}]}],"g-1":["ev",{"VAR?":"x"},"out","/ev","\n","ev","str","^choice","/str","/ev",{"*":".^.c-2","flg":20},{"c-2":["\n",{"->":"0.g-2"},{"#f":5}]}],"g-2":["ev",{"VAR?":"x"},"out","/ev","\n","done",["done",{"#n":"g-3"}],null]}],"done",{"global decl":["ev",5,{"VAR=":"x"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",{"VAR?":"x"},"out","/ev","\n","ev","str","^choice","/str","/ev",{"*":"0.c-0","flg":20},{"c-0":["\n",{"->":"0.g-0"},{"#f":5}],"g-0":["ev",{"VAR?":"x"},"out","/ev","\n","ev","str","^choice","/str","/ev",{"*":".^.c-1","flg":20},{"c-1":["\n",{"->":"0.g-1"},{"#f":5}]}],"g-1":["ev",{"VAR?":"x"},"out","/ev","\n","ev","str","^choice","/str","/ev",{"*":".^.c-2","flg":20},{"c-2":["\n",{"->":"0.g-2"},{"#f":5}]}],"g-2":["ev",{"VAR?":"x"},"out","/ev","\n","done",["done",{"#n":"g-3"}],null]}],"done",{"global decl":["ev",5,{"VAR=":"x"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/variables/variable_pointer_ref_from_knot.ink.json b/test/fixture/compiled/runtime/variables/variable_pointer_ref_from_knot.ink.json index e4b32c78..c051a2bd 100644 --- a/test/fixture/compiled/runtime/variables/variable_pointer_ref_from_knot.ink.json +++ b/test/fixture/compiled/runtime/variables/variable_pointer_ref_from_knot.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[{"->t->":"knot"},"end",["done",{"#n":"g-0"}],null],"done",{"knot":["ev",{"^var":"val","ci":-1},{"f()":"inc"},"pop","/ev","\n","ev",{"VAR?":"val"},"out","/ev","\n","ev","void","/ev","->->",null],"inc":[{"temp=":"x"},"ev",{"VAR?":"x"},1,"+","/ev",{"temp=":"x","re":true},null],"global decl":["ev",5,{"VAR=":"val"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[{"->t->":"knot"},"end",["done",{"#n":"g-0"}],null],"done",{"knot":["ev",{"^var":"val","ci":-1},{"f()":"inc"},"pop","/ev","\n","ev",{"VAR?":"val"},"out","/ev","\n","ev","void","/ev","->->",null],"inc":[{"temp=":"x"},"ev",{"VAR?":"x"},1,"+","/ev",{"temp=":"x","re":true},null],"global decl":["ev",5,{"VAR=":"val"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/variables/variable_swap_recurse.ink.json b/test/fixture/compiled/runtime/variables/variable_swap_recurse.ink.json index 67ac77d7..0746f257 100644 --- a/test/fixture/compiled/runtime/variables/variable_swap_recurse.ink.json +++ b/test/fixture/compiled/runtime/variables/variable_swap_recurse.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",1,1,{"f()":"f"},"pop","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"f":[{"temp=":"y"},{"temp=":"x"},"ev",{"VAR?":"x"},1,"==",{"VAR?":"y"},1,"==","&&","/ev",[{"->":".^.b","c":true},{"b":["\n","ev",2,"/ev",{"temp=":"x","re":true},"ev",{"VAR?":"y"},{"VAR?":"x"},{"f()":"f"},"pop","/ev","\n",{"->":"f.13"},null]}],[{"->":".^.b"},{"b":["\n","ev",{"VAR?":"x"},"out","/ev","^ ","ev",{"VAR?":"y"},"out","/ev","\n",{"->":"f.13"},null]}],"nop","\n","ev","void","/ev","~ret",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",1,1,{"f()":"f"},"pop","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"f":[{"temp=":"y"},{"temp=":"x"},"ev",{"VAR?":"x"},1,"==",{"VAR?":"y"},1,"==","&&","/ev",[{"->":".^.b","c":true},{"b":["\n","ev",2,"/ev",{"temp=":"x","re":true},"ev",{"VAR?":"y"},{"VAR?":"x"},{"f()":"f"},"pop","/ev","\n",{"->":"f.13"},null]}],[{"->":".^.b"},{"b":["\n","ev",{"VAR?":"x"},"out","/ev","^ ","ev",{"VAR?":"y"},"out","/ev","\n",{"->":"f.13"},null]}],"nop","\n","ev","void","/ev","~ret",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/variables/variable_tunnel.ink.json b/test/fixture/compiled/runtime/variables/variable_tunnel.ink.json index 05f98051..4a0c96b0 100644 --- a/test/fixture/compiled/runtime/variables/variable_tunnel.ink.json +++ b/test/fixture/compiled/runtime/variables/variable_tunnel.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["ev",{"^->":"tunnel"},"/ev",{"->":"one_then_tother"},["done",{"#n":"g-0"}],null],"done",{"one_then_tother":[{"temp=":"x"},{"->t->":"x","var":true},{"->":"end"},null],"tunnel":["^STUFF","\n","ev","void","/ev","->->",{"#f":3}],"end":["end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["ev",{"^->":"tunnel"},"/ev",{"->":"one_then_tother"},["done",{"#n":"g-0"}],null],"done",{"one_then_tother":[{"temp=":"x"},{"->t->":"x","var":true},{"->":"end"},null],"tunnel":["^STUFF","\n","ev","void","/ev","->->",{"#f":3}],"end":["end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/variables/warn_variable_not_found_1.ink.json b/test/fixture/compiled/runtime/variables/warn_variable_not_found_1.ink.json index b8609eb6..73a2d17b 100644 --- a/test/fixture/compiled/runtime/variables/warn_variable_not_found_1.ink.json +++ b/test/fixture/compiled/runtime/variables/warn_variable_not_found_1.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["^Hello world!","\n","ev",{"VAR?":"x"},"out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev",0,{"VAR=":"x"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["^Hello world!","\n","ev",{"VAR?":"x"},"out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev",0,{"VAR=":"x"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/variables/warn_variable_not_found_2.ink.json b/test/fixture/compiled/runtime/variables/warn_variable_not_found_2.ink.json index 292f8b13..62234813 100644 --- a/test/fixture/compiled/runtime/variables/warn_variable_not_found_2.ink.json +++ b/test/fixture/compiled/runtime/variables/warn_variable_not_found_2.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["^Hello world!","\n","ev",{"VAR?":"y"},"out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev",0,{"VAR=":"y"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[["^Hello world!","\n","ev",{"VAR?":"y"},"out","/ev","\n",["done",{"#n":"g-0"}],null],"done",{"global decl":["ev",0,{"VAR=":"y"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/weaves/conditional_choice_in_weave.ink.json b/test/fixture/compiled/runtime/weaves/conditional_choice_in_weave.ink.json index 635ab088..ecc34c7d 100644 --- a/test/fixture/compiled/runtime/weaves/conditional_choice_in_weave.ink.json +++ b/test/fixture/compiled/runtime/weaves/conditional_choice_in_weave.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[["^start","\n",["ev",true,"/ev",{"->":".^.b","c":true},{"b":["\n","ev","str","^go to a stitch","/str","/ev",{"*":".^.c-0","flg":20},{"->":"0.g-0.3"},{"c-0":["^ ",{"->":"a_stitch"},"\n",{"#f":5}]}]}],"nop","\n",["^gather should be seen","\n","done",["done",{"#n":"g-2"}],{"#n":"g-1"}],{"#n":"g-0"}],null],"done",{"a_stitch":["^result","\n","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[["^start","\n",["ev",true,"/ev",{"->":".^.b","c":true},{"b":["\n","ev","str","^go to a stitch","/str","/ev",{"*":".^.c-0","flg":20},{"->":"0.g-0.3"},{"c-0":["^ ",{"->":"a_stitch"},"\n",{"#f":5}]}]}],"nop","\n",["^gather should be seen","\n","done",["done",{"#n":"g-2"}],{"#n":"g-1"}],{"#n":"g-0"}],null],"done",{"a_stitch":["^result","\n","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/weaves/conditional_choice_in_weave_2.ink.json b/test/fixture/compiled/runtime/weaves/conditional_choice_in_weave_2.ink.json index 98c84d24..2574846b 100644 --- a/test/fixture/compiled/runtime/weaves/conditional_choice_in_weave_2.ink.json +++ b/test/fixture/compiled/runtime/weaves/conditional_choice_in_weave_2.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[["^first gather","\n","ev","str","^option 1","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^option 2","/str","/ev",{"*":".^.c-1","flg":20},{"c-0":["\n",{"->":"0.g-1"},{"#f":5}],"c-1":["\n",{"->":"0.g-1"},{"#f":5}],"#n":"g-0"}],{"g-1":["^the main gather","\n","ev",false,"/ev",[{"->":".^.b","c":true},{"b":["\n",["ev",{"^->":"0.g-1.5.b.1.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^unreachable option ",{"->":"$r","var":true},null]}],{"->":"0.g-1.6"},{"c-0":["ev",{"^->":"0.g-1.5.b.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.1.s"},[{"#n":"$r2"}],"end","\n",{"#f":5}]}]}],"nop","\n",["^bottom gather","\n",["done",{"#n":"g-3"}],{"#n":"g-2"}],null]}],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[["^first gather","\n","ev","str","^option 1","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^option 2","/str","/ev",{"*":".^.c-1","flg":20},{"c-0":["\n",{"->":"0.g-1"},{"#f":5}],"c-1":["\n",{"->":"0.g-1"},{"#f":5}],"#n":"g-0"}],{"g-1":["^the main gather","\n","ev",false,"/ev",[{"->":".^.b","c":true},{"b":["\n",["ev",{"^->":"0.g-1.5.b.1.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^unreachable option ",{"->":"$r","var":true},null]}],{"->":"0.g-1.6"},{"c-0":["ev",{"^->":"0.g-1.5.b.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.1.s"},[{"#n":"$r2"}],"end","\n",{"#f":5}]}]}],"nop","\n",["^bottom gather","\n",["done",{"#n":"g-3"}],{"#n":"g-2"}],null]}],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/weaves/unbalanced_weave_indentation.ink.json b/test/fixture/compiled/runtime/weaves/unbalanced_weave_indentation.ink.json index d88eb85a..cf02d62a 100644 --- a/test/fixture/compiled/runtime/weaves/unbalanced_weave_indentation.ink.json +++ b/test/fixture/compiled/runtime/weaves/unbalanced_weave_indentation.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[[["ev",{"^->":"0.0.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":"0.0.c-0","flg":18},{"s":["^First",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"0.0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":"0.0.0.s"},[{"#n":"$r2"}],"\n",[["ev",{"^->":"0.0.c-0.7.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^Very indented",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"0.0.c-0.7.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.0.s"},[{"#n":"$r2"}],"\n",{"->":"0.0.g-0"},{"#f":5}]}],{"#f":5}],"g-0":["^End","\n","end",{"->":"0.g-0"},null]}],["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[[["ev",{"^->":"0.0.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":"0.0.c-0","flg":18},{"s":["^First",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"0.0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":"0.0.0.s"},[{"#n":"$r2"}],"\n",[["ev",{"^->":"0.0.c-0.7.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^Very indented",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"0.0.c-0.7.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.0.s"},[{"#n":"$r2"}],"\n",{"->":"0.0.g-0"},{"#f":5}]}],{"#f":5}],"g-0":["^End","\n","end",{"->":"0.g-0"},null]}],["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/weaves/weave_gathers.ink.json b/test/fixture/compiled/runtime/weaves/weave_gathers.ink.json index a33bf652..cb1ccfda 100644 --- a/test/fixture/compiled/runtime/weaves/weave_gathers.ink.json +++ b/test/fixture/compiled/runtime/weaves/weave_gathers.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[[["ev",{"^->":"0.g-0.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^one",{"->":"$r","var":true},null]}],["ev",{"^->":"0.g-0.1.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-1","flg":18},{"s":["^four",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"0.g-0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.0.s"},[{"#n":"$r2"}],"\n",[["ev",{"^->":"0.g-0.c-0.7.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^two",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"0.g-0.c-0.7.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.0.s"},[{"#n":"$r2"}],"\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":["^three","\n",{"->":"0.g-1"},null]}],{"#f":5}],"c-1":["ev",{"^->":"0.g-0.c-1.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.1.s"},[{"#n":"$r2"}],"\n",[["^five","\n",{"->":"0.g-1"},{"#n":"g-0"}],null],{"#f":5}],"#n":"g-0"}],{"g-1":["^six","\n",["done",{"#n":"g-2"}],null]}],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[[["ev",{"^->":"0.g-0.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^one",{"->":"$r","var":true},null]}],["ev",{"^->":"0.g-0.1.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-1","flg":18},{"s":["^four",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"0.g-0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.0.s"},[{"#n":"$r2"}],"\n",[["ev",{"^->":"0.g-0.c-0.7.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^two",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"0.g-0.c-0.7.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.0.s"},[{"#n":"$r2"}],"\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":["^three","\n",{"->":"0.g-1"},null]}],{"#f":5}],"c-1":["ev",{"^->":"0.g-0.c-1.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.1.s"},[{"#n":"$r2"}],"\n",[["^five","\n",{"->":"0.g-1"},{"#n":"g-0"}],null],{"#f":5}],"#n":"g-0"}],{"g-1":["^six","\n",["done",{"#n":"g-2"}],null]}],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/weaves/weave_options.ink.json b/test/fixture/compiled/runtime/weaves/weave_options.ink.json index 0d2729c2..9f39848d 100644 --- a/test/fixture/compiled/runtime/weaves/weave_options.ink.json +++ b/test/fixture/compiled/runtime/weaves/weave_options.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[{"->":"test"},["done",{"#n":"g-0"}],null],"done",{"test":[[["ev",{"^->":"test.0.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","str","^.","/str","/ev",{"*":".^.^.c-0","flg":22},{"s":["^Hello",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"test.0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.0.s"},[{"#n":"$r2"}],"^, world.","\n","end",{"#f":5}]}],null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[{"->":"test"},["done",{"#n":"g-0"}],null],"done",{"test":[[["ev",{"^->":"test.0.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","str","^.","/str","/ev",{"*":".^.^.c-0","flg":22},{"s":["^Hello",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"test.0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.0.s"},[{"#n":"$r2"}],"^, world.","\n","end",{"#f":5}]}],null]}],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/compiled/runtime/weaves/weave_within_sequence.ink.json b/test/fixture/compiled/runtime/weaves/weave_within_sequence.ink.json index d4dd3074..478db952 100644 --- a/test/fixture/compiled/runtime/weaves/weave_within_sequence.ink.json +++ b/test/fixture/compiled/runtime/weaves/weave_within_sequence.ink.json @@ -1 +1 @@ -{"inkVersion":20,"root":[[["ev","visit",1,"seq","/ev","ev","du",0,"==","/ev",{"->":".^.s0","c":true},"nop",{"s0":["pop","\n",["ev",{"^->":"0.0.s0.2.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^choice",{"->":"$r","var":true},null]}],{"->":"0.0.11"},{"c-0":["ev",{"^->":"0.0.s0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.2.s"},[{"#n":"$r2"}],"\n","^nextline","\n","end",{"#f":5}]}],"#f":5}],"\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[["ev","visit",1,"seq","/ev","ev","du",0,"==","/ev",{"->":".^.s0","c":true},"nop",{"s0":["pop","\n",["ev",{"^->":"0.0.s0.2.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^choice",{"->":"$r","var":true},null]}],{"->":"0.0.11"},{"c-0":["ev",{"^->":"0.0.s0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.2.s"},[{"#n":"$r2"}],"\n","^nextline","\n","end",{"#f":5}]}],"#f":5}],"\n",["done",{"#n":"g-0"}],null],"done",null],"listDefs":{}} \ No newline at end of file diff --git a/test/fixture/original/player/flow.ink b/test/fixture/original/player/flow.ink index 2f2f01d8..b3cbb5c0 100644 --- a/test/fixture/original/player/flow.ink +++ b/test/fixture/original/player/flow.ink @@ -1,4 +1,5 @@ -# globalTag1 # globalTag2 +# globalTag1 +# globalTag2 -> prologue @@ -7,17 +8,18 @@ Hello # helloTag1 -* Choice 1 +* Choice 1 #choice1_tag1 #choice1_tag2 -> chapter0 -* Choice 2 +* Choice 2 #choice2_tag2 -> chapter1 -* Choice 3 +* Choice 3 #choice3_tag3 -> epilogue -> DONE = chapter0 -# chapter0Tag1 # chapter0Tag2 +# chapter0Tag1 +# chapter0Tag2 - (chapter0Gather) This is chapter 0 -> DONE @@ -26,6 +28,7 @@ This is chapter 1 -> DONE === epilogue === -# epilogue1Tag1 # epilogue1Tag2 +# epilogue1Tag1 +# epilogue1Tag2 This is the end -> END diff --git a/test/fixture/original/runtime/diverts/tunnel_onwards_to_variable_divert_target.ink b/test/fixture/original/runtime/diverts/tunnel_onwards_to_variable_divert_target.ink new file mode 100644 index 00000000..570275ef --- /dev/null +++ b/test/fixture/original/runtime/diverts/tunnel_onwards_to_variable_divert_target.ink @@ -0,0 +1,12 @@ +-> outer -> + +== outer +This is outer +-> cut_to(-> the_esc) + +=== cut_to(-> escape) + ->-> escape + +== the_esc +This is the_esc +-> END diff --git a/test/fixture/original/runtime/lists/contains_empty_list_always_false.ink b/test/fixture/original/runtime/lists/contains_empty_list_always_false.ink new file mode 100644 index 00000000..b6b98501 --- /dev/null +++ b/test/fixture/original/runtime/lists/contains_empty_list_always_false.ink @@ -0,0 +1,4 @@ +LIST list = (a), b +{list ? ()} +{() ? ()} +{() ? list} diff --git a/test/fixture/original/runtime/tags/tags_dynamic_content.ink b/test/fixture/original/runtime/tags/tags_dynamic_content.ink new file mode 100644 index 00000000..915db379 --- /dev/null +++ b/test/fixture/original/runtime/tags/tags_dynamic_content.ink @@ -0,0 +1 @@ +tag # pic{5+3}{red|blue}.jpg diff --git a/test/fixture/original/runtime/tags/tags_in_choice.ink b/test/fixture/original/runtime/tags/tags_in_choice.ink new file mode 100644 index 00000000..1b96e4d4 --- /dev/null +++ b/test/fixture/original/runtime/tags/tags_in_choice.ink @@ -0,0 +1 @@ ++ one #one [two #two] three #three -> END diff --git a/test/fixture/original/runtime/tags/tags_in_seq.ink b/test/fixture/original/runtime/tags/tags_in_seq.ink new file mode 100644 index 00000000..9f6be729 --- /dev/null +++ b/test/fixture/original/runtime/tags/tags_in_seq.ink @@ -0,0 +1,4 @@ +-> knot -> knot -> +== knot +A {red #red|white #white|blue #blue|green #green} sequence. +->-> diff --git a/test/fixture/original/runtime/tags/tags_on_choice.ink b/test/fixture/original/runtime/tags/tags_on_choice.ink deleted file mode 100644 index a5403464..00000000 --- a/test/fixture/original/runtime/tags/tags_on_choice.ink +++ /dev/null @@ -1 +0,0 @@ -* [Hi] Hello -> END #hey diff --git a/test/integration/player/test_flow.gd b/test/integration/player/test_flow.gd index 4edefde9..f77d9107 100644 --- a/test/integration/player/test_flow.gd +++ b/test/integration/player/test_flow.gd @@ -49,7 +49,12 @@ func test_choices() -> void: _ink_player.continue_story_maximally() assert_true(_ink_player.has_choices) - assert_eq_shallow(_ink_player.current_choices, ["Choice 1", "Choice 2", "Choice 3"]) + assert_eq(_ink_player.current_choices[0].text, "Choice 1") + assert_eq(_ink_player.current_choices[0].tags, ["choice1_tag1", "choice1_tag2"]) + assert_eq(_ink_player.current_choices[1].text, "Choice 2") + assert_eq(_ink_player.current_choices[1].tags, ["choice2_tag2"]) + assert_eq(_ink_player.current_choices[2].text, "Choice 3") + assert_eq(_ink_player.current_choices[2].tags, ["choice3_tag3"]) _ink_player.choose_choice_index(1) assert_true(_ink_player.can_continue) diff --git a/test/integration/runtime/test_diverts.gd b/test/integration/runtime/test_diverts.gd index dc2ecf20..5981fde6 100644 --- a/test/integration/runtime/test_diverts.gd +++ b/test/integration/runtime/test_diverts.gd @@ -15,36 +15,43 @@ func test_basic_tunnel(): assert_eq(story.continue(), "Hello world\n") + func test_compare_divert_targets(): var story = Story.new(load_file("compare_divert_targets")) assert_eq(story.continue_maximally(), "different knot\nsame knot\nsame knot\ndifferent knot\nsame knot\nsame knot\n") + func test_complex_tunnels(): var story = Story.new(load_file("complex_tunnels")) assert_eq(story.continue_maximally(), "one (1)\none and a half (1.5)\ntwo (2)\nthree (3)\n") + func test_divert_in_conditional(): var story = Story.new(load_file("divert_in_conditional")) assert_eq(story.continue_maximally(), "") + func test_divert_targets_with_parameters(): var story = Story.new(load_file("divert_targets_with_parameters")) assert_eq(story.continue_maximally(), "5\n") + func test_divert_to_weave_points(): var story = Story.new(load_file("divert_to_weave_points")) assert_eq(story.continue_maximally(), "gather\ntest\nchoice content\ngather\nsecond time round\n") + func test_done_stops_thread(): var story = Story.new(load_file("done_stops_thread")) assert_eq(story.continue_maximally(), "") + func test_path_to_self(): var story = Story.new(load_file("path_to_self")) @@ -56,31 +63,37 @@ func test_path_to_self(): assert_true(story.can_continue) + func test_same_line_divert_is_inline(): var story = Story.new(load_file("same_line_divert_is_inline")) assert_eq(story.continue(), "We hurried home to Savile Row as fast as we could.\n") + func test_tunnel_onwards_after_tunnel(): var story = Story.new(load_file("tunnel_onwards_after_tunnel")) assert_eq(story.continue_maximally(), "Hello...\n...world.\nThe End.\n") + func test_tunnel_onwards_divert_after_with_arg(): var story = Story.new(load_file("tunnel_onwards_divert_after_with_arg")) assert_eq(story.continue_maximally(), "8\n") + func test_tunnel_onwards_divert_override(): var story = Story.new(load_file("tunnel_onwards_divert_override")) assert_eq(story.continue_maximally(), "This is A\nNow in B.\n") + func test_tunnel_onwards_with_param_default_choice(): var story = Story.new(load_file("tunnel_onwards_with_param_default_choice")) assert_eq(story.continue_maximally(), "8\n") + func test_tunnel_vs_thread_behaviour(): var story = Story.new(load_file("tunnel_vs_thread_behaviour")) @@ -96,6 +109,13 @@ func test_tunnel_vs_thread_behaviour(): assert_true(story.continue_maximally().find("Done.") != -1) + +func test_tunnel_onwards_to_variable_divert_target(): + var story = Story.new(load_file("tunnel_onwards_to_variable_divert_target")) + + assert_eq(story.continue_maximally(), "This is outer\nThis is the_esc\n") + + # ############################################################################ # func _prefix(): diff --git a/test/integration/runtime/test_lists.gd b/test/integration/runtime/test_lists.gd index ffdf5cde..6f837224 100644 --- a/test/integration/runtime/test_lists.gd +++ b/test/integration/runtime/test_lists.gd @@ -15,21 +15,25 @@ func test_empty_list_origin(): assert_eq(story.continue_maximally(), "a, b\n") + func test_empty_list_origin_after_assignment(): var story = Story.new(load_file("empty_list_origin_after_assignment")) assert_eq(story.continue_maximally(), "a, b, c\n") + func test_list_basic_operations(): var story = Story.new(load_file("list_basic_operations")) assert_eq(story.continue_maximally(), "b, d\na, b, c, e\nb, c\nfalse\ntrue\ntrue\n") + func test_list_mixed_items(): var story = Story.new(load_file("list_mixed_items")) assert_eq(story.continue_maximally(), "a, y, c\n") + func test_list_random(): var story = Story.new(load_file("list_random")) @@ -37,11 +41,13 @@ func test_list_random(): var result = story.continue() assert_true(result == "B\n" || result == "C\n" || result == "D\n") + func test_list_range(): var story = Story.new(load_file("list_range")) assert_eq(story.continue_maximally(), "Pound, Pizza, Euro, Pasta, Dollar, Curry, Paella\nEuro, Pasta, Dollar, Curry\nTwo, Three, Four, Five, Six\nPizza, Pasta\n") + func test_list_save_load(): var story = Story.new(load_file("list_save_load")) @@ -56,11 +62,13 @@ func test_list_save_load(): story.choose_path_string("elsewhere") assert_eq(story.continue_maximally(), "a, x, c, z\n") + func test_more_list_operations(): var story = Story.new(load_file("more_list_operations")) assert_eq(story.continue_maximally(), "1\nl\nn\nl, m\nn\n") + func test_manual_item_addition(): var story = Story.new(load_file("list_save_load")) @@ -73,6 +81,12 @@ func test_manual_item_addition(): assert_eq(str(list), "x, z") + +func test_contains_empty_list_always_false(): + var story = Story.new(load_file("contains_empty_list_always_false")) + assert_eq(story.continue_maximally(), "false\nfalse\nfalse\n") + + # ############################################################################ # func _prefix(): diff --git a/test/integration/runtime/test_tags.gd b/test/integration/runtime/test_tags.gd index e2b54187..84ffed10 100644 --- a/test/integration/runtime/test_tags.gd +++ b/test/integration/runtime/test_tags.gd @@ -31,18 +31,37 @@ func test_tags(): assert_eq(story.continue(), "") assert_eq(story.current_tags, knot_tag_when_continued_twice_tags) -func test_tags_on_choice(): - var story = Story.new(load_file("tags_on_choice")) + +func test_tags_in_seq(): + var story = Story.new(load_file("tags_in_seq")) + + assert_eq(story.continue(), "A red sequence.\n") + assert_eq(story.current_tags, ["red"]) + + assert_eq(story.continue(), "A white sequence.\n") + assert_eq(story.current_tags, ["white"]) + + +func test_tags_in_choice(): + var story = Story.new(load_file("tags_in_choice")) story.continue() + assert_eq(story.current_tags.size(), 0) + assert_eq(story.current_choices.size(), 1) + assert_eq(story.current_choices[0].tags, ["one", "two"]) + story.choose_choice_index(0) - var txt = story.continue() - var tags = story.current_tags + assert_eq(story.continue(), "one three") + assert_eq(story.current_tags, ["one", "three"]) + + +func test_tags_dynamic_content(): + var story = Story.new(load_file("tags_dynamic_content")) + + assert_eq(story.continue(), "tag\n") + assert_eq(story.current_tags, ["pic8red.jpg"]) - assert_eq(txt, "Hello") - assert_eq(tags.size(), 1) - assert_eq(tags[0], "hey") # ############################################################################ #