From 96fbf17187d15ebe03829b140f49b7636147470d Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Sat, 15 Jun 2019 14:32:48 -0600 Subject: [PATCH] Local variable examples that break everything (WIP #69) --- examples/divert-target-for-loop/main.hank | 21 +++++++++++++++++++++ examples/divert-target-for-loop/test1.hlog | 4 ++++ examples/local-variables/main.hank | 21 +++++++++++++++++++++ examples/local-variables/test1.hlog | 4 ++++ 4 files changed, 50 insertions(+) create mode 100644 examples/divert-target-for-loop/main.hank create mode 100644 examples/divert-target-for-loop/test1.hlog create mode 100644 examples/local-variables/main.hank create mode 100644 examples/local-variables/test1.hlog diff --git a/examples/divert-target-for-loop/main.hank b/examples/divert-target-for-loop/main.hank new file mode 100644 index 0000000..8ce073a --- /dev/null +++ b/examples/divert-target-for-loop/main.hank @@ -0,0 +1,21 @@ +``` +var targets = [->knot1, ->knot2, ->knot3]; +for (target in targets) { + trace(target); + , -> @target -> +} +``` + +The end. + +== knot0 +Non-loop example. + +== knot1 +1 + +== knot2 +2 + +== knot3 +3 \ No newline at end of file diff --git a/examples/divert-target-for-loop/test1.hlog b/examples/divert-target-for-loop/test1.hlog new file mode 100644 index 0000000..1b979a5 --- /dev/null +++ b/examples/divert-target-for-loop/test1.hlog @@ -0,0 +1,4 @@ +1 +2 +3 +The end. \ No newline at end of file diff --git a/examples/local-variables/main.hank b/examples/local-variables/main.hank new file mode 100644 index 0000000..6303aa0 --- /dev/null +++ b/examples/local-variables/main.hank @@ -0,0 +1,21 @@ +``` +var local = "1"; +, {local} + +local = "2"; +var local2 = "3"; + +,,, +{local} +{local2} +,,, + +local = ->the_end; + +, ->the_end + +``` + +== the_end + +The end. \ No newline at end of file diff --git a/examples/local-variables/test1.hlog b/examples/local-variables/test1.hlog new file mode 100644 index 0000000..1b979a5 --- /dev/null +++ b/examples/local-variables/test1.hlog @@ -0,0 +1,4 @@ +1 +2 +3 +The end. \ No newline at end of file