lang, engine: Add a metaparam for catching accidental dollar signs

Let's make our life easier for users!
This commit is contained in:
James Shubin
2024-08-22 20:41:48 -04:00
parent 8dc0d44513
commit a0972c0752
10 changed files with 72 additions and 1 deletions

View File

@@ -14,6 +14,7 @@ test "test" {
sema => ["foo:1", "bar:3",],
rewatch => false,
realize => true,
dollar => false,
reverse => true,
autoedge => true,
autogroup => true,

View File

@@ -14,6 +14,7 @@ test "test" {
sema => ["foo:1", "bar:3",],
rewatch => false,
realize => true,
dollar => false,
reverse => true,
autoedge => true,
autogroup => true,
@@ -31,6 +32,7 @@ Edge: const -> composite # autoedge
Edge: const -> composite # autogroup
Edge: const -> composite # burst
Edge: const -> composite # delay
Edge: const -> composite # dollar
Edge: const -> composite # limit
Edge: const -> composite # noop
Edge: const -> composite # poll
@@ -60,3 +62,4 @@ Vertex: const
Vertex: const
Vertex: const
Vertex: const
Vertex: const

View File

@@ -14,6 +14,7 @@ test "t1" {
# sema => ["foo:1", "bar:3",],
# rewatch => false,
# realize => true,
# dollar => false,
# reverse => true,
# autoedge => true,
# autogroup => true,
@@ -29,6 +30,7 @@ test "t1" {
Meta:sema => ["foo:1", "bar:3",],
Meta:rewatch => false,
Meta:realize => true,
Meta:dollar => false,
Meta:reverse => true,
Meta:autoedge => true,
Meta:autogroup => true,

View File

@@ -0,0 +1,5 @@
-- main.mcl --
$foo = "/tmp/file1"
test "$foo" {} # catch simple typos! should be "${foo}"
-- OUTPUT --
# err: errValidate: test[$foo] did not Validate: the Res name starts with a $

View File

@@ -0,0 +1,7 @@
-- main.mcl --
$foo = "/tmp/file1"
test "$foo" {
Meta:dollar => true, # allow what would normally be a typo!
}
-- OUTPUT --
Vertex: test[$foo]