From a88de679eb307d9595366a2104ae659652cd70ed Mon Sep 17 00:00:00 2001 From: Valentin Berlier Date: Sat, 14 Oct 2023 22:28:29 +0200 Subject: [PATCH] fix: compile memo with proper nesting --- bolt/codegen.py | 7 +++-- bolt/memo.py | 16 ++++------ bolt/runtime.py | 10 +++---- examples/bolt_memo2/beet.yml | 6 ++++ .../src/data/demo/functions/foo.mcfunction | 4 +++ examples/bolt_memo3/beet.yml | 6 ++++ .../src/data/demo/functions/foo.mcfunction | 7 +++++ examples/bolt_memo4/beet.yml | 6 ++++ .../src/data/demo/functions/foo.mcfunction | 13 ++++++++ poetry.lock | 16 +++++----- pyproject.toml | 4 +-- tests/snapshots/bolt__parse_313__1.txt | 12 ++++---- tests/snapshots/bolt__parse_314__1.txt | 5 ++-- tests/snapshots/bolt__parse_315__1.txt | 7 +++-- tests/snapshots/bolt__parse_316__1.txt | 10 ++++--- tests/snapshots/bolt__parse_317__1.txt | 17 ++++++----- tests/snapshots/bolt__parse_318__1.txt | 5 ++-- tests/snapshots/bolt__parse_319__1.txt | 7 +++-- tests/snapshots/bolt__parse_341__1.txt | 12 ++++---- tests/snapshots/bolt__parse_343__1.txt | 7 +++-- tests/snapshots/bolt__parse_344__1.txt | 7 +++-- tests/snapshots/bolt__parse_345__1.txt | 7 +++-- tests/snapshots/bolt__parse_346__1.txt | 7 +++-- .../examples__build_bolt_memo2__0.pack.md | 23 ++++++++++++++ .../examples__build_bolt_memo3__0.pack.md | 30 +++++++++++++++++++ .../examples__build_bolt_memo4__0.pack.md | 28 +++++++++++++++++ 26 files changed, 209 insertions(+), 70 deletions(-) create mode 100644 examples/bolt_memo2/beet.yml create mode 100644 examples/bolt_memo2/src/data/demo/functions/foo.mcfunction create mode 100644 examples/bolt_memo3/beet.yml create mode 100644 examples/bolt_memo3/src/data/demo/functions/foo.mcfunction create mode 100644 examples/bolt_memo4/beet.yml create mode 100644 examples/bolt_memo4/src/data/demo/functions/foo.mcfunction create mode 100644 tests/snapshots/examples__build_bolt_memo2__0.pack.md create mode 100644 tests/snapshots/examples__build_bolt_memo3__0.pack.md create mode 100644 tests/snapshots/examples__build_bolt_memo4__0.pack.md diff --git a/bolt/codegen.py b/bolt/codegen.py index f0bff44..7555c2b 100644 --- a/bolt/codegen.py +++ b/bolt/codegen.py @@ -585,8 +585,11 @@ def memo( f"{storage} = _bolt_runtime.memo.registry[__file__][{acc.make_ref(node)}, {file_index}]" ) + path = f"_bolt_memo_invocation_path_{node.persistent_id.hex}" + acc.statement(f"{path} = _bolt_runtime.get_nested_location()") + invocation = f"_bolt_memo_invocation_{node.persistent_id.hex}" - acc.statement(f"{invocation} = {storage}[({' '.join(keys)})]") + acc.statement(f"{invocation} = {storage}[({path}, {' '.join(keys)})]") acc.statement(f"if {invocation}.cached:") with acc.block(): @@ -597,7 +600,7 @@ def memo( acc.statement("else:") with acc.block(): acc.statement( - f"with _bolt_runtime.memo.record(_bolt_runtime, {invocation}, __name__):" + f"with _bolt_runtime.memo.record(_bolt_runtime, {invocation}, {path}, __name__):" ) with acc.block(): yield from visit_body(cast(AstRoot, body), acc) diff --git a/bolt/memo.py b/bolt/memo.py index 6f1a28e..459d438 100644 --- a/bolt/memo.py +++ b/bolt/memo.py @@ -40,7 +40,6 @@ ) from beet.core.utils import log_time, remove_path from mecha import AstChildren, AstRoot, DiagnosticCollection, Mecha, rule -from mecha.contrib.nesting import InplaceNestingPredicate from .ast import AstMemo, AstMemoResult from .emit import CommandEmitter @@ -302,13 +301,12 @@ class MemoHandler: mc: Mecha registry: MemoRegistry generate: Optional[Generator] = None - inplace_nesting_predicate: Optional[InplaceNestingPredicate] = None def __post_init__(self): self.mc.serialize.extend(serialize_memo_result) def restore(self, emit: CommandEmitter, invocation: MemoInvocation): - if not self.generate or not self.inplace_nesting_predicate: + if self.generate is None: return invocation.epoch = self.registry.epoch_counter @@ -324,9 +322,10 @@ def record( self, emit: CommandEmitter, invocation: MemoInvocation, + invocation_path: str, name: Optional[str] = None, ): - if not self.generate or not self.inplace_nesting_predicate or not name: + if self.generate is None or name is None: yield return @@ -346,16 +345,14 @@ def record( previous_queue = database.queue previous_step = database.step previous_current = database.current - previous_callback = self.inplace_nesting_predicate.callback try: database.session = set() database.queue = [] - self.inplace_nesting_predicate.callback = ( - lambda target: previous_callback(target) - or target is previous_current - ) function = self.mc.compile( root, + filename=compilation_unit.filename, + resource_location=invocation_path, + within=draft.data, report=diagnostics, initial_step=database.step + 1, ) @@ -365,7 +362,6 @@ def record( database.queue = previous_queue database.step = previous_step database.current = previous_current - self.inplace_nesting_predicate.callback = previous_callback if output := function.text.rstrip(): emit.commands.append(AstMemoResult(serialized=output)) diff --git a/bolt/runtime.py b/bolt/runtime.py index 034b7e4..02f194a 100644 --- a/bolt/runtime.py +++ b/bolt/runtime.py @@ -24,7 +24,6 @@ rule, ) from mecha.contrib.nested_location import NestedLocationResolver -from mecha.contrib.nesting import InplaceNestingPredicate from mecha.contrib.relative_location import resolve_relative_location from pathspec import PathSpec from tokenstream import set_location @@ -84,9 +83,11 @@ def __init__(self, ctx: Union[Context, Mecha]): "generate_tree", lambda *args, **kwargs: generate_tree( ( - root := kwargs.pop("root") - if "root" in kwargs - else self.modules.current_path + root := ( + kwargs.pop("root") + if "root" in kwargs + else self.get_nested_location() + ) ), *args, name=( @@ -103,7 +104,6 @@ def __init__(self, ctx: Union[Context, Mecha]): mc, registry=ctx.inject(MemoRegistry), generate=ctx.generate, - inplace_nesting_predicate=ctx.inject(InplaceNestingPredicate), ) else: diff --git a/examples/bolt_memo2/beet.yml b/examples/bolt_memo2/beet.yml new file mode 100644 index 0000000..c8a8dd6 --- /dev/null +++ b/examples/bolt_memo2/beet.yml @@ -0,0 +1,6 @@ +require: + - bolt +data_pack: + load: "src" +pipeline: + - mecha diff --git a/examples/bolt_memo2/src/data/demo/functions/foo.mcfunction b/examples/bolt_memo2/src/data/demo/functions/foo.mcfunction new file mode 100644 index 0000000..ef95b9b --- /dev/null +++ b/examples/bolt_memo2/src/data/demo/functions/foo.mcfunction @@ -0,0 +1,4 @@ +say ok +memo: + append function __name__: + say wat diff --git a/examples/bolt_memo3/beet.yml b/examples/bolt_memo3/beet.yml new file mode 100644 index 0000000..c8a8dd6 --- /dev/null +++ b/examples/bolt_memo3/beet.yml @@ -0,0 +1,6 @@ +require: + - bolt +data_pack: + load: "src" +pipeline: + - mecha diff --git a/examples/bolt_memo3/src/data/demo/functions/foo.mcfunction b/examples/bolt_memo3/src/data/demo/functions/foo.mcfunction new file mode 100644 index 0000000..f668473 --- /dev/null +++ b/examples/bolt_memo3/src/data/demo/functions/foo.mcfunction @@ -0,0 +1,7 @@ +n = 5 +execute function ~/{n}: + say 1 + memo n: + say 2 + append function ~/: + say 3 diff --git a/examples/bolt_memo4/beet.yml b/examples/bolt_memo4/beet.yml new file mode 100644 index 0000000..c8a8dd6 --- /dev/null +++ b/examples/bolt_memo4/beet.yml @@ -0,0 +1,6 @@ +require: + - bolt +data_pack: + load: "src" +pipeline: + - mecha diff --git a/examples/bolt_memo4/src/data/demo/functions/foo.mcfunction b/examples/bolt_memo4/src/data/demo/functions/foo.mcfunction new file mode 100644 index 0000000..6cd6abb --- /dev/null +++ b/examples/bolt_memo4/src/data/demo/functions/foo.mcfunction @@ -0,0 +1,13 @@ +def stuff(): + memo: + append function __name__: + say something + +say before +stuff() +stuff() +say after + +function ./bar: + say bop + stuff() diff --git a/poetry.lock b/poetry.lock index b32a184..0138ce3 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2,14 +2,14 @@ [[package]] name = "beet" -version = "0.95.4" +version = "0.96.1" description = "The Minecraft pack development kit" category = "main" optional = false python-versions = ">=3.10,<4.0" files = [ - {file = "beet-0.95.4-py3-none-any.whl", hash = "sha256:b409fe546ecd0694990bf56d36710fed7eed8a9d409a721292bd200cc7754ea6"}, - {file = "beet-0.95.4.tar.gz", hash = "sha256:061277f236ffd70ba5b68463fb3eb3b56d406d5a6cd9c964593f78c294df4db7"}, + {file = "beet-0.96.1-py3-none-any.whl", hash = "sha256:cfd9e33c6ef9e4c27b733953dacb78b901dd0bfa21eadedcf69725da544d422d"}, + {file = "beet-0.96.1.tar.gz", hash = "sha256:36fcd594cafc5b725bb9df1be43cec92faf5f958006c02574ccfdbe9b22aac04"}, ] [package.dependencies] @@ -706,18 +706,18 @@ files = [ [[package]] name = "mecha" -version = "0.78.2" +version = "0.79.0" description = "A powerful Minecraft command library" category = "main" optional = false python-versions = ">=3.10,<4.0" files = [ - {file = "mecha-0.78.2-py3-none-any.whl", hash = "sha256:7f85e766160834c36ef7b31ba68295d0987cd294dfa0530f64075d11c0d5f15a"}, - {file = "mecha-0.78.2.tar.gz", hash = "sha256:d4d681eac19ca2e31b3ef1a45a09148384a0c32e1a2d0de98e51c1d200da48cd"}, + {file = "mecha-0.79.0-py3-none-any.whl", hash = "sha256:601c17c7f203511eebfa2b065c3877a81303685db0a92ac78157d9184c471243"}, + {file = "mecha-0.79.0.tar.gz", hash = "sha256:f12e6de29278aa904de8db3fd535e98f7c5017090ec6d98782475c099bb00131"}, ] [package.dependencies] -beet = ">=0.95.4" +beet = ">=0.96.0" tokenstream = ">=1.7.0,<2.0.0" [[package]] @@ -1488,4 +1488,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "6ffacc95f5092b621e9fa3863d5ee083143b2c836aa8b3e03629b348b28b3b12" +content-hash = "824c46fcd3900bb6a2c73392a499201e947f3e92cf63eba58ffde182f19b860b" diff --git a/pyproject.toml b/pyproject.toml index ef4ee0d..b5cd8f7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,8 +23,8 @@ include = ["bolt/py.typed"] [tool.poetry.dependencies] python = "^3.10" -beet = ">=0.95.4" -mecha = ">=0.78.2" +beet = ">=0.96.1" +mecha = ">=0.79.0" [tool.poetry.group.dev.dependencies] pytest = "^7.4.2" diff --git a/tests/snapshots/bolt__parse_313__1.txt b/tests/snapshots/bolt__parse_313__1.txt index e72664e..89989c1 100644 --- a/tests/snapshots/bolt__parse_313__1.txt +++ b/tests/snapshots/bolt__parse_313__1.txt @@ -1,4 +1,4 @@ -_bolt_lineno = [1, 20], [1, 3] +_bolt_lineno = [1, 21], [1, 3] _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d = None _bolt_helper_children = _bolt_runtime.helpers['children'] _bolt_memo_storage_23b8c1e9392456de3eb13b9046685257 = None @@ -11,11 +11,12 @@ with _bolt_runtime.scope() as _bolt_var6: _bolt_var1 = _bolt_var1 + _bolt_var2 if _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d is None: _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d = _bolt_runtime.memo.registry[__file__][_bolt_refs[0], 0] - _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d = _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d[(_bolt_var0, _bolt_var1,)] + _bolt_memo_invocation_path_bdd640fb06671ad11c80317fa3b1799d = _bolt_runtime.get_nested_location() + _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d = _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d[(_bolt_memo_invocation_path_bdd640fb06671ad11c80317fa3b1799d, _bolt_var0, _bolt_var1,)] if _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d.cached: _bolt_runtime.memo.restore(_bolt_runtime, _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d) else: - with _bolt_runtime.memo.record(_bolt_runtime, _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d, __name__): + with _bolt_runtime.memo.record(_bolt_runtime, _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d, _bolt_memo_invocation_path_bdd640fb06671ad11c80317fa3b1799d, __name__): pass _bolt_var3 = list _bolt_var3 = _bolt_var3() @@ -25,11 +26,12 @@ with _bolt_runtime.scope() as _bolt_var6: _bolt_var3 = _bolt_var3(_bolt_var4) if _bolt_memo_storage_23b8c1e9392456de3eb13b9046685257 is None: _bolt_memo_storage_23b8c1e9392456de3eb13b9046685257 = _bolt_runtime.memo.registry[__file__][_bolt_refs[1], 0] - _bolt_memo_invocation_23b8c1e9392456de3eb13b9046685257 = _bolt_memo_storage_23b8c1e9392456de3eb13b9046685257[(_bolt_var3,)] + _bolt_memo_invocation_path_23b8c1e9392456de3eb13b9046685257 = _bolt_runtime.get_nested_location() + _bolt_memo_invocation_23b8c1e9392456de3eb13b9046685257 = _bolt_memo_storage_23b8c1e9392456de3eb13b9046685257[(_bolt_memo_invocation_path_23b8c1e9392456de3eb13b9046685257, _bolt_var3,)] if _bolt_memo_invocation_23b8c1e9392456de3eb13b9046685257.cached: _bolt_runtime.memo.restore(_bolt_runtime, _bolt_memo_invocation_23b8c1e9392456de3eb13b9046685257) else: - with _bolt_runtime.memo.record(_bolt_runtime, _bolt_memo_invocation_23b8c1e9392456de3eb13b9046685257, __name__): + with _bolt_runtime.memo.record(_bolt_runtime, _bolt_memo_invocation_23b8c1e9392456de3eb13b9046685257, _bolt_memo_invocation_path_23b8c1e9392456de3eb13b9046685257, __name__): pass _bolt_var7 = _bolt_helper_replace(_bolt_refs[2], commands=_bolt_helper_children(_bolt_var6)) --- diff --git a/tests/snapshots/bolt__parse_314__1.txt b/tests/snapshots/bolt__parse_314__1.txt index 903591c..5e17cbd 100644 --- a/tests/snapshots/bolt__parse_314__1.txt +++ b/tests/snapshots/bolt__parse_314__1.txt @@ -10,11 +10,12 @@ with _bolt_runtime.scope() as _bolt_var3: _bolt_var1 = _bolt_var1 + _bolt_var2 if _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d is None: _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d = _bolt_runtime.memo.registry[__file__][_bolt_refs[0], 0] - _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d = _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d[(_bolt_var0, _bolt_var1,)] + _bolt_memo_invocation_path_bdd640fb06671ad11c80317fa3b1799d = _bolt_runtime.get_nested_location() + _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d = _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d[(_bolt_memo_invocation_path_bdd640fb06671ad11c80317fa3b1799d, _bolt_var0, _bolt_var1,)] if _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d.cached: _bolt_runtime.memo.restore(_bolt_runtime, _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d) else: - with _bolt_runtime.memo.record(_bolt_runtime, _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d, __name__): + with _bolt_runtime.memo.record(_bolt_runtime, _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d, _bolt_memo_invocation_path_bdd640fb06671ad11c80317fa3b1799d, __name__): pass _bolt_var4 = _bolt_helper_replace(_bolt_refs[1], commands=_bolt_helper_children(_bolt_var3)) --- diff --git a/tests/snapshots/bolt__parse_315__1.txt b/tests/snapshots/bolt__parse_315__1.txt index 9668b0f..2e59c81 100644 --- a/tests/snapshots/bolt__parse_315__1.txt +++ b/tests/snapshots/bolt__parse_315__1.txt @@ -1,4 +1,4 @@ -_bolt_lineno = [1, 18, 21], [1, 2, 3] +_bolt_lineno = [1, 19, 22], [1, 2, 3] _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d = None _bolt_helper_interpolate_message = _bolt_runtime.helpers['interpolate_message'] _bolt_helper_children = _bolt_runtime.helpers['children'] @@ -10,11 +10,12 @@ with _bolt_runtime.scope() as _bolt_var4: bar = _bolt_var1 if _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d is None: _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d = _bolt_runtime.memo.registry[__file__][_bolt_refs[0], 0] - _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d = _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d[(foo, bar,)] + _bolt_memo_invocation_path_bdd640fb06671ad11c80317fa3b1799d = _bolt_runtime.get_nested_location() + _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d = _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d[(_bolt_memo_invocation_path_bdd640fb06671ad11c80317fa3b1799d, foo, bar,)] if _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d.cached: _bolt_runtime.memo.restore(_bolt_runtime, _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d) else: - with _bolt_runtime.memo.record(_bolt_runtime, _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d, __name__): + with _bolt_runtime.memo.record(_bolt_runtime, _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d, _bolt_memo_invocation_path_bdd640fb06671ad11c80317fa3b1799d, __name__): _bolt_var2 = foo _bolt_var2 = _bolt_helper_interpolate_message(_bolt_var2, _bolt_refs[1]) _bolt_runtime.commands.append(_bolt_helper_replace(_bolt_refs[2], arguments=_bolt_helper_children([_bolt_var2]))) diff --git a/tests/snapshots/bolt__parse_316__1.txt b/tests/snapshots/bolt__parse_316__1.txt index 037b9c2..a536a05 100644 --- a/tests/snapshots/bolt__parse_316__1.txt +++ b/tests/snapshots/bolt__parse_316__1.txt @@ -6,19 +6,21 @@ _bolt_helper_replace = _bolt_runtime.helpers['replace'] with _bolt_runtime.scope() as _bolt_var0: if _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d is None: _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d = _bolt_runtime.memo.registry[__file__][_bolt_refs[0], 0] - _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d = _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d[()] + _bolt_memo_invocation_path_bdd640fb06671ad11c80317fa3b1799d = _bolt_runtime.get_nested_location() + _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d = _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d[(_bolt_memo_invocation_path_bdd640fb06671ad11c80317fa3b1799d, )] if _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d.cached: _bolt_runtime.memo.restore(_bolt_runtime, _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d) else: - with _bolt_runtime.memo.record(_bolt_runtime, _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d, __name__): + with _bolt_runtime.memo.record(_bolt_runtime, _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d, _bolt_memo_invocation_path_bdd640fb06671ad11c80317fa3b1799d, __name__): pass if _bolt_memo_storage_23b8c1e9392456de3eb13b9046685257 is None: _bolt_memo_storage_23b8c1e9392456de3eb13b9046685257 = _bolt_runtime.memo.registry[__file__][_bolt_refs[1], 1] - _bolt_memo_invocation_23b8c1e9392456de3eb13b9046685257 = _bolt_memo_storage_23b8c1e9392456de3eb13b9046685257[()] + _bolt_memo_invocation_path_23b8c1e9392456de3eb13b9046685257 = _bolt_runtime.get_nested_location() + _bolt_memo_invocation_23b8c1e9392456de3eb13b9046685257 = _bolt_memo_storage_23b8c1e9392456de3eb13b9046685257[(_bolt_memo_invocation_path_23b8c1e9392456de3eb13b9046685257, )] if _bolt_memo_invocation_23b8c1e9392456de3eb13b9046685257.cached: _bolt_runtime.memo.restore(_bolt_runtime, _bolt_memo_invocation_23b8c1e9392456de3eb13b9046685257) else: - with _bolt_runtime.memo.record(_bolt_runtime, _bolt_memo_invocation_23b8c1e9392456de3eb13b9046685257, __name__): + with _bolt_runtime.memo.record(_bolt_runtime, _bolt_memo_invocation_23b8c1e9392456de3eb13b9046685257, _bolt_memo_invocation_path_23b8c1e9392456de3eb13b9046685257, __name__): pass _bolt_var1 = _bolt_helper_replace(_bolt_refs[2], commands=_bolt_helper_children(_bolt_var0)) --- diff --git a/tests/snapshots/bolt__parse_317__1.txt b/tests/snapshots/bolt__parse_317__1.txt index 544980e..5761a30 100644 --- a/tests/snapshots/bolt__parse_317__1.txt +++ b/tests/snapshots/bolt__parse_317__1.txt @@ -1,4 +1,4 @@ -_bolt_lineno = [1, 18, 22, 33, 37, 48], [1, 2, 3, 4, 5, 6] +_bolt_lineno = [1, 19, 23, 35, 39, 51], [1, 2, 3, 4, 5, 6] _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d = None _bolt_helper_children = _bolt_runtime.helpers['children'] _bolt_helper_get_rebind = _bolt_runtime.helpers['get_rebind'] @@ -10,11 +10,12 @@ with _bolt_runtime.scope() as _bolt_var9: foo = _bolt_var0 if _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d is None: _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d = _bolt_runtime.memo.registry[__file__][_bolt_refs[0], 0] - _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d = _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d[(foo,)] + _bolt_memo_invocation_path_bdd640fb06671ad11c80317fa3b1799d = _bolt_runtime.get_nested_location() + _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d = _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d[(_bolt_memo_invocation_path_bdd640fb06671ad11c80317fa3b1799d, foo,)] if _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d.cached: _bolt_runtime.memo.restore(_bolt_runtime, _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d) else: - with _bolt_runtime.memo.record(_bolt_runtime, _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d, __name__): + with _bolt_runtime.memo.record(_bolt_runtime, _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d, _bolt_memo_invocation_path_bdd640fb06671ad11c80317fa3b1799d, __name__): _bolt_var1 = print _bolt_var2 = foo _bolt_var1 = _bolt_var1(_bolt_var2) @@ -25,11 +26,12 @@ with _bolt_runtime.scope() as _bolt_var9: foo = _bolt_rebind(foo) if _bolt_memo_storage_23b8c1e9392456de3eb13b9046685257 is None: _bolt_memo_storage_23b8c1e9392456de3eb13b9046685257 = _bolt_runtime.memo.registry[__file__][_bolt_refs[1], 0] - _bolt_memo_invocation_23b8c1e9392456de3eb13b9046685257 = _bolt_memo_storage_23b8c1e9392456de3eb13b9046685257[(foo,)] + _bolt_memo_invocation_path_23b8c1e9392456de3eb13b9046685257 = _bolt_runtime.get_nested_location() + _bolt_memo_invocation_23b8c1e9392456de3eb13b9046685257 = _bolt_memo_storage_23b8c1e9392456de3eb13b9046685257[(_bolt_memo_invocation_path_23b8c1e9392456de3eb13b9046685257, foo,)] if _bolt_memo_invocation_23b8c1e9392456de3eb13b9046685257.cached: _bolt_runtime.memo.restore(_bolt_runtime, _bolt_memo_invocation_23b8c1e9392456de3eb13b9046685257) else: - with _bolt_runtime.memo.record(_bolt_runtime, _bolt_memo_invocation_23b8c1e9392456de3eb13b9046685257, __name__): + with _bolt_runtime.memo.record(_bolt_runtime, _bolt_memo_invocation_23b8c1e9392456de3eb13b9046685257, _bolt_memo_invocation_path_23b8c1e9392456de3eb13b9046685257, __name__): _bolt_var4 = print _bolt_var5 = foo _bolt_var4 = _bolt_var4(_bolt_var5) @@ -40,11 +42,12 @@ with _bolt_runtime.scope() as _bolt_var9: foo = _bolt_rebind(foo) if _bolt_memo_storage_bd9c66b3ad3c2d6d1a3d1fa7bc8960a9 is None: _bolt_memo_storage_bd9c66b3ad3c2d6d1a3d1fa7bc8960a9 = _bolt_runtime.memo.registry[__file__][_bolt_refs[2], 1] - _bolt_memo_invocation_bd9c66b3ad3c2d6d1a3d1fa7bc8960a9 = _bolt_memo_storage_bd9c66b3ad3c2d6d1a3d1fa7bc8960a9[(foo,)] + _bolt_memo_invocation_path_bd9c66b3ad3c2d6d1a3d1fa7bc8960a9 = _bolt_runtime.get_nested_location() + _bolt_memo_invocation_bd9c66b3ad3c2d6d1a3d1fa7bc8960a9 = _bolt_memo_storage_bd9c66b3ad3c2d6d1a3d1fa7bc8960a9[(_bolt_memo_invocation_path_bd9c66b3ad3c2d6d1a3d1fa7bc8960a9, foo,)] if _bolt_memo_invocation_bd9c66b3ad3c2d6d1a3d1fa7bc8960a9.cached: _bolt_runtime.memo.restore(_bolt_runtime, _bolt_memo_invocation_bd9c66b3ad3c2d6d1a3d1fa7bc8960a9) else: - with _bolt_runtime.memo.record(_bolt_runtime, _bolt_memo_invocation_bd9c66b3ad3c2d6d1a3d1fa7bc8960a9, __name__): + with _bolt_runtime.memo.record(_bolt_runtime, _bolt_memo_invocation_bd9c66b3ad3c2d6d1a3d1fa7bc8960a9, _bolt_memo_invocation_path_bd9c66b3ad3c2d6d1a3d1fa7bc8960a9, __name__): _bolt_var7 = print _bolt_var8 = foo _bolt_var7 = _bolt_var7(_bolt_var8) diff --git a/tests/snapshots/bolt__parse_318__1.txt b/tests/snapshots/bolt__parse_318__1.txt index 51c5387..bf663db 100644 --- a/tests/snapshots/bolt__parse_318__1.txt +++ b/tests/snapshots/bolt__parse_318__1.txt @@ -7,11 +7,12 @@ with _bolt_runtime.scope() as _bolt_var0: global _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d if _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d is None: _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d = _bolt_runtime.memo.registry[__file__][_bolt_refs[0], 0] - _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d = _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d[()] + _bolt_memo_invocation_path_bdd640fb06671ad11c80317fa3b1799d = _bolt_runtime.get_nested_location() + _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d = _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d[(_bolt_memo_invocation_path_bdd640fb06671ad11c80317fa3b1799d, )] if _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d.cached: _bolt_runtime.memo.restore(_bolt_runtime, _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d) else: - with _bolt_runtime.memo.record(_bolt_runtime, _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d, __name__): + with _bolt_runtime.memo.record(_bolt_runtime, _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d, _bolt_memo_invocation_path_bdd640fb06671ad11c80317fa3b1799d, __name__): pass _bolt_var1 = _bolt_helper_replace(_bolt_refs[1], commands=_bolt_helper_children(_bolt_var0)) --- diff --git a/tests/snapshots/bolt__parse_319__1.txt b/tests/snapshots/bolt__parse_319__1.txt index 23bad2f..e8e3feb 100644 --- a/tests/snapshots/bolt__parse_319__1.txt +++ b/tests/snapshots/bolt__parse_319__1.txt @@ -1,4 +1,4 @@ -_bolt_lineno = [1, 10, 23, 27, 31], [1, 2, 3, 4, 5] +_bolt_lineno = [1, 10, 24, 28, 32], [1, 2, 3, 4, 5] _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d = None _bolt_helper_get_rebind = _bolt_runtime.helpers['get_rebind'] _bolt_helper_interpolate_message = _bolt_runtime.helpers['interpolate_message'] @@ -13,12 +13,13 @@ with _bolt_runtime.scope() as _bolt_var8: _bolt_var3 = foo if _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d is None: _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d = _bolt_runtime.memo.registry[__file__][_bolt_refs[0], 0] - _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d = _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d[(_bolt_var1, foo, _bolt_var3,)] + _bolt_memo_invocation_path_bdd640fb06671ad11c80317fa3b1799d = _bolt_runtime.get_nested_location() + _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d = _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d[(_bolt_memo_invocation_path_bdd640fb06671ad11c80317fa3b1799d, _bolt_var1, foo, _bolt_var3,)] if _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d.cached: _bolt_runtime.memo.restore(_bolt_runtime, _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d) (foo,) = _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d.bindings else: - with _bolt_runtime.memo.record(_bolt_runtime, _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d, __name__): + with _bolt_runtime.memo.record(_bolt_runtime, _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d, _bolt_memo_invocation_path_bdd640fb06671ad11c80317fa3b1799d, __name__): _bolt_var4 = 8 _bolt_rebind = _bolt_helper_get_rebind(foo) foo += _bolt_var4 diff --git a/tests/snapshots/bolt__parse_341__1.txt b/tests/snapshots/bolt__parse_341__1.txt index 93e0fdf..033166d 100644 --- a/tests/snapshots/bolt__parse_341__1.txt +++ b/tests/snapshots/bolt__parse_341__1.txt @@ -1,4 +1,4 @@ -_bolt_lineno = [1, 11, 12, 21, 26, 34], [1, 2, 3, 4, 5, 6] +_bolt_lineno = [1, 11, 12, 22, 27, 36], [1, 2, 3, 4, 5, 6] _bolt_memo_storage_23b8c1e9392456de3eb13b9046685257 = None _bolt_helper_interpolate_message = _bolt_runtime.helpers['interpolate_message'] _bolt_helper_children = _bolt_runtime.helpers['children'] @@ -13,11 +13,12 @@ with _bolt_runtime.scope() as _bolt_var8: _bolt_var3 = b if _bolt_memo_storage_23b8c1e9392456de3eb13b9046685257 is None: _bolt_memo_storage_23b8c1e9392456de3eb13b9046685257 = _bolt_runtime.memo.registry[__file__][_bolt_refs[0], 0] - _bolt_memo_invocation_23b8c1e9392456de3eb13b9046685257 = _bolt_memo_storage_23b8c1e9392456de3eb13b9046685257[(_bolt_var2, _bolt_var3,)] + _bolt_memo_invocation_path_23b8c1e9392456de3eb13b9046685257 = _bolt_runtime.get_nested_location() + _bolt_memo_invocation_23b8c1e9392456de3eb13b9046685257 = _bolt_memo_storage_23b8c1e9392456de3eb13b9046685257[(_bolt_memo_invocation_path_23b8c1e9392456de3eb13b9046685257, _bolt_var2, _bolt_var3,)] if _bolt_memo_invocation_23b8c1e9392456de3eb13b9046685257.cached: _bolt_runtime.memo.restore(_bolt_runtime, _bolt_memo_invocation_23b8c1e9392456de3eb13b9046685257) else: - with _bolt_runtime.memo.record(_bolt_runtime, _bolt_memo_invocation_23b8c1e9392456de3eb13b9046685257, __name__): + with _bolt_runtime.memo.record(_bolt_runtime, _bolt_memo_invocation_23b8c1e9392456de3eb13b9046685257, _bolt_memo_invocation_path_23b8c1e9392456de3eb13b9046685257, __name__): _bolt_var4 = a _bolt_var5 = b _bolt_var4 = _bolt_var4 + _bolt_var5 @@ -26,11 +27,12 @@ with _bolt_runtime.scope() as _bolt_var8: _bolt_var6 = b if _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d is None: _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d = _bolt_runtime.memo.registry[__file__][_bolt_refs[3], 0] - _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d = _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d[(_bolt_var6,)] + _bolt_memo_invocation_path_bdd640fb06671ad11c80317fa3b1799d = _bolt_runtime.get_nested_location() + _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d = _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d[(_bolt_memo_invocation_path_bdd640fb06671ad11c80317fa3b1799d, _bolt_var6,)] if _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d.cached: _bolt_runtime.memo.restore(_bolt_runtime, _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d) else: - with _bolt_runtime.memo.record(_bolt_runtime, _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d, __name__): + with _bolt_runtime.memo.record(_bolt_runtime, _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d, _bolt_memo_invocation_path_bdd640fb06671ad11c80317fa3b1799d, __name__): _bolt_var7 = b _bolt_var7 = _bolt_helper_interpolate_message(_bolt_var7, _bolt_refs[4]) _bolt_runtime.commands.append(_bolt_helper_replace(_bolt_refs[5], arguments=_bolt_helper_children([_bolt_var7]))) diff --git a/tests/snapshots/bolt__parse_343__1.txt b/tests/snapshots/bolt__parse_343__1.txt index 28fdd03..9a2ddcb 100644 --- a/tests/snapshots/bolt__parse_343__1.txt +++ b/tests/snapshots/bolt__parse_343__1.txt @@ -1,4 +1,4 @@ -_bolt_lineno = [1, 8, 13, 15, 25, 38], [1, 2, 3, 4, 5, 6] +_bolt_lineno = [1, 8, 13, 15, 26, 39], [1, 2, 3, 4, 5, 6] _bolt_helper_branch = _bolt_runtime.helpers['branch'] _bolt_helper_children = _bolt_runtime.helpers['children'] _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d = None @@ -16,12 +16,13 @@ with _bolt_runtime.scope() as _bolt_var0: global _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d if _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d is None: _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d = _bolt_runtime.memo.registry[__file__][_bolt_refs[0], 0] - _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d = _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d[(_bolt_var3,)] + _bolt_memo_invocation_path_bdd640fb06671ad11c80317fa3b1799d = _bolt_runtime.get_nested_location() + _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d = _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d[(_bolt_memo_invocation_path_bdd640fb06671ad11c80317fa3b1799d, _bolt_var3,)] if _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d.cached: _bolt_runtime.memo.restore(_bolt_runtime, _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d) (result,) = _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d.bindings else: - with _bolt_runtime.memo.record(_bolt_runtime, _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d, __name__): + with _bolt_runtime.memo.record(_bolt_runtime, _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d, _bolt_memo_invocation_path_bdd640fb06671ad11c80317fa3b1799d, __name__): _bolt_var4 = fib _bolt_var5 = n _bolt_var6 = 1 diff --git a/tests/snapshots/bolt__parse_344__1.txt b/tests/snapshots/bolt__parse_344__1.txt index 56aedf3..3b3058f 100644 --- a/tests/snapshots/bolt__parse_344__1.txt +++ b/tests/snapshots/bolt__parse_344__1.txt @@ -1,4 +1,4 @@ -_bolt_lineno = [1, 10, 20, 25], [1, 2, 3, 4] +_bolt_lineno = [1, 10, 21, 26], [1, 2, 3, 4] _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d = None _bolt_helper_get_rebind = _bolt_runtime.helpers['get_rebind'] _bolt_helper_children = _bolt_runtime.helpers['children'] @@ -10,12 +10,13 @@ with _bolt_runtime.scope() as _bolt_var4: _bolt_var1 = thing if _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d is None: _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d = _bolt_runtime.memo.registry[__file__][_bolt_refs[0], 0] - _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d = _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d[(_bolt_var1,)] + _bolt_memo_invocation_path_bdd640fb06671ad11c80317fa3b1799d = _bolt_runtime.get_nested_location() + _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d = _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d[(_bolt_memo_invocation_path_bdd640fb06671ad11c80317fa3b1799d, _bolt_var1,)] if _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d.cached: _bolt_runtime.memo.restore(_bolt_runtime, _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d) (thing,) = _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d.bindings else: - with _bolt_runtime.memo.record(_bolt_runtime, _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d, __name__): + with _bolt_runtime.memo.record(_bolt_runtime, _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d, _bolt_memo_invocation_path_bdd640fb06671ad11c80317fa3b1799d, __name__): _bolt_var2 = 1 _bolt_rebind = _bolt_helper_get_rebind(thing) thing += _bolt_var2 diff --git a/tests/snapshots/bolt__parse_345__1.txt b/tests/snapshots/bolt__parse_345__1.txt index 7918b9f..e1b5a9a 100644 --- a/tests/snapshots/bolt__parse_345__1.txt +++ b/tests/snapshots/bolt__parse_345__1.txt @@ -1,4 +1,4 @@ -_bolt_lineno = [1, 10, 20, 26, 30], [1, 2, 3, 4, 5] +_bolt_lineno = [1, 10, 21, 27, 31], [1, 2, 3, 4, 5] _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d = None _bolt_helper_get_rebind = _bolt_runtime.helpers['get_rebind'] _bolt_helper_children = _bolt_runtime.helpers['children'] @@ -10,12 +10,13 @@ with _bolt_runtime.scope() as _bolt_var5: _bolt_var1 = thing if _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d is None: _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d = _bolt_runtime.memo.registry[__file__][_bolt_refs[0], 0] - _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d = _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d[(_bolt_var1,)] + _bolt_memo_invocation_path_bdd640fb06671ad11c80317fa3b1799d = _bolt_runtime.get_nested_location() + _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d = _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d[(_bolt_memo_invocation_path_bdd640fb06671ad11c80317fa3b1799d, _bolt_var1,)] if _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d.cached: _bolt_runtime.memo.restore(_bolt_runtime, _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d) (thing,) = _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d.bindings else: - with _bolt_runtime.memo.record(_bolt_runtime, _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d, __name__): + with _bolt_runtime.memo.record(_bolt_runtime, _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d, _bolt_memo_invocation_path_bdd640fb06671ad11c80317fa3b1799d, __name__): _bolt_var2 = 1 _bolt_rebind = _bolt_helper_get_rebind(thing) thing += _bolt_var2 diff --git a/tests/snapshots/bolt__parse_346__1.txt b/tests/snapshots/bolt__parse_346__1.txt index 77966d8..225eb63 100644 --- a/tests/snapshots/bolt__parse_346__1.txt +++ b/tests/snapshots/bolt__parse_346__1.txt @@ -1,4 +1,4 @@ -_bolt_lineno = [1, 10, 20, 26, 30], [1, 2, 3, 4, 5] +_bolt_lineno = [1, 10, 21, 27, 31], [1, 2, 3, 4, 5] _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d = None _bolt_helper_get_rebind = _bolt_runtime.helpers['get_rebind'] _bolt_helper_children = _bolt_runtime.helpers['children'] @@ -10,12 +10,13 @@ with _bolt_runtime.scope() as _bolt_var5: _bolt_var1 = thing if _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d is None: _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d = _bolt_runtime.memo.registry[__file__][_bolt_refs[0], 0] - _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d = _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d[(_bolt_var1,)] + _bolt_memo_invocation_path_bdd640fb06671ad11c80317fa3b1799d = _bolt_runtime.get_nested_location() + _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d = _bolt_memo_storage_bdd640fb06671ad11c80317fa3b1799d[(_bolt_memo_invocation_path_bdd640fb06671ad11c80317fa3b1799d, _bolt_var1,)] if _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d.cached: _bolt_runtime.memo.restore(_bolt_runtime, _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d) (thing,) = _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d.bindings else: - with _bolt_runtime.memo.record(_bolt_runtime, _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d, __name__): + with _bolt_runtime.memo.record(_bolt_runtime, _bolt_memo_invocation_bdd640fb06671ad11c80317fa3b1799d, _bolt_memo_invocation_path_bdd640fb06671ad11c80317fa3b1799d, __name__): _bolt_var2 = 1 _bolt_rebind = _bolt_helper_get_rebind(thing) thing += _bolt_var2 diff --git a/tests/snapshots/examples__build_bolt_memo2__0.pack.md b/tests/snapshots/examples__build_bolt_memo2__0.pack.md new file mode 100644 index 0000000..4f3d638 --- /dev/null +++ b/tests/snapshots/examples__build_bolt_memo2__0.pack.md @@ -0,0 +1,23 @@ +# Lectern snapshot + +## Data pack + +`@data_pack pack.mcmeta` + +```json +{ + "pack": { + "pack_format": 18, + "description": "" + } +} +``` + +### demo + +`@function demo:foo` + +```mcfunction +say ok +say wat +``` diff --git a/tests/snapshots/examples__build_bolt_memo3__0.pack.md b/tests/snapshots/examples__build_bolt_memo3__0.pack.md new file mode 100644 index 0000000..1264156 --- /dev/null +++ b/tests/snapshots/examples__build_bolt_memo3__0.pack.md @@ -0,0 +1,30 @@ +# Lectern snapshot + +## Data pack + +`@data_pack pack.mcmeta` + +```json +{ + "pack": { + "pack_format": 18, + "description": "" + } +} +``` + +### demo + +`@function demo:foo` + +```mcfunction +function demo:foo/5 +``` + +`@function demo:foo/5` + +```mcfunction +say 1 +say 2 +say 3 +``` diff --git a/tests/snapshots/examples__build_bolt_memo4__0.pack.md b/tests/snapshots/examples__build_bolt_memo4__0.pack.md new file mode 100644 index 0000000..cc92b52 --- /dev/null +++ b/tests/snapshots/examples__build_bolt_memo4__0.pack.md @@ -0,0 +1,28 @@ +# Lectern snapshot + +## Data pack + +`@data_pack pack.mcmeta` + +```json +{ + "pack": { + "pack_format": 18, + "description": "" + } +} +``` + +### demo + +`@function demo:foo` + +```mcfunction +say something +``` + +`@function demo:bar` + +```mcfunction +say bop +```