aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrahflow <drahflow@gmx.de>2019-03-20 19:18:54 +0100
committerDrahflow <drahflow@gmx.de>2019-03-20 19:18:54 +0100
commit36b1d920bc3cf46884ad7fb51106c3d7be29759a (patch)
tree36acd61534c8b5e6204c75ba73aa4d68aab5cf9f
parent6eb8c52c6ec77515561e25db108ac4bedd9009a9 (diff)
Don't capture global scope in non-quoted }_
This becomes non-academic in case include is called from non-global scope.
-rw-r--r--compiler/standard.ey4
-rw-r--r--examples/working-compiler/include-and-macro.ey4
-rw-r--r--examples/working-compiler/include-and-macro.inc1
3 files changed, 7 insertions, 2 deletions
diff --git a/compiler/standard.ey b/compiler/standard.ey
index 8b76e7d..136e7b0 100644
--- a/compiler/standard.ey
+++ b/compiler/standard.ey
@@ -5,11 +5,11 @@
|defvc "==:" deffd
|deffc "=*:" deffd
-{ "}" | *
+"}" | {
{ =*f ==x
{ x f }
} quoted { } { * } ? *
-} "}_" defq
+} ; "}_" defq
{ { -01 < ==o { o -01 }' "." | ; > -12 } } {
quoted { }" { * }" ? *
diff --git a/examples/working-compiler/include-and-macro.ey b/examples/working-compiler/include-and-macro.ey
new file mode 100644
index 0000000..4731678
--- /dev/null
+++ b/examples/working-compiler/include-and-macro.ey
@@ -0,0 +1,4 @@
+{
+ /ok ==ok
+ "include-and-macro.inc" include
+} *
diff --git a/examples/working-compiler/include-and-macro.inc b/examples/working-compiler/include-and-macro.inc
new file mode 100644
index 0000000..1730b76
--- /dev/null
+++ b/examples/working-compiler/include-and-macro.inc
@@ -0,0 +1 @@
+5 { dump ok dump }_ *