From 24d25e26fd8854f4107482f29d3fd37a280e7d63 Mon Sep 17 00:00:00 2001 From: Patrick Li Date: Sun, 27 Nov 2022 18:23:48 -0800 Subject: [PATCH] Made a mistake in parsing the .proj file. --- compiler/proj-variable-substitution.stanza | 1 + tests/data/ex2.proj | 16 ++++++++++++++++ tests/test-proj.stanza | 4 ++++ 3 files changed, 21 insertions(+) create mode 100644 tests/data/ex2.proj diff --git a/compiler/proj-variable-substitution.stanza b/compiler/proj-variable-substitution.stanza index c5fa62fde..249040d79 100644 --- a/compiler/proj-variable-substitution.stanza +++ b/compiler/proj-variable-substitution.stanza @@ -244,4 +244,5 @@ defn check-valid-substitution (v:ProjValue) -> String|False : (v:ProjValues) : find-by(seq(check-valid-substitution, values(v))) (v:ProjTuple) : check-valid-substitution(value(v)) (v:ProjTableS0) : "table" + (v:CondPlatform) : find-by(seq(check-valid-substitution{value(_)}, values(v))) \ No newline at end of file diff --git a/tests/data/ex2.proj b/tests/data/ex2.proj new file mode 100644 index 000000000..92578c842 --- /dev/null +++ b/tests/data/ex2.proj @@ -0,0 +1,16 @@ +;Example proj file + +var myvar = + on-platform : + os-x: + A + B + C + else : + D + E + F + +package myprogram requires : + ccflags: "{myvar}" + diff --git a/tests/test-proj.stanza b/tests/test-proj.stanza index 4e4658b74..a302ce470 100644 --- a/tests/test-proj.stanza +++ b/tests/test-proj.stanza @@ -10,4 +10,8 @@ deftest build-dev-proj : deftest read-proj-ex : val output = call-dev-tool $ ["dev-proj" data-file("ex1.proj")] + println(output) + +deftest read-proj-ex : + val output = call-dev-tool $ ["dev-proj" data-file("ex2.proj")] println(output) \ No newline at end of file