Trival. Should have done this earlier.
---
src/compiler/ptest/ptest.c | 25 +++++++++++++++++++++----
src/compiler/test/prefix | 12 ++++++------
2 files changed, 27 insertions(+), 10 deletions(-)
diff --git a/src/compiler/ptest/ptest.c b/src/compiler/ptest/ptest.c
index c662625..9171a59 100644
--- a/src/compiler/ptest/ptest.c
+++ b/src/compiler/ptest/ptest.c
@@ -155,10 +155,27 @@ static const char *assign_default(struct parser_comm
*comm,
}
-static const char *assign_unsupported(struct parser_comm *comm,
+static const char *assign_per_frame(struct parser_comm *comm,
const char *label, struct ast_node *node)
{
- return strdup("assignment mode not supported yet");
+ if (!quiet) {
+ printf("per_frame = %s = ", label);
+ dump_ast(node);
+ putchar('\n');
+ }
+ return NULL;
+}
+
+
+static const char *assign_per_vertex(struct parser_comm *comm,
+ const char *label, struct ast_node *node)
+{
+ if (!quiet) {
+ printf("per_vertex = %s = ", label);
+ dump_ast(node);
+ putchar('\n');
+ }
+ return NULL;
}
@@ -215,8 +232,8 @@ int main(int argc, char **argv)
struct parser_comm comm = {
.u.fragment = &fragment,
.assign_default = assign_default,
- .assign_per_frame = assign_unsupported,
- .assign_per_vertex = assign_unsupported,
+ .assign_per_frame = assign_per_frame,
+ .assign_per_vertex = assign_per_vertex,
.assign_image_name = assign_image_name,
};
const char *error;
diff --git a/src/compiler/test/prefix b/src/compiler/test/prefix
index 518764a..8d32b05 100755
--- a/src/compiler/test/prefix
+++ b/src/compiler/test/prefix
@@ -5,29 +5,29 @@
###############################################################################
-ptest_fail "prefix: per_frame=x = a+b" <<EOF
+ptest "prefix: per_frame=x = a+b" <<EOF
per_frame=x = a+b
EOF
expect <<EOF
-FPVM, line 1, near "b": assignment mode not supported yet
+per_frame = x = (+ a b)
EOF
#------------------------------------------------------------------------------
-ptest_fail "prefix: per_vertex= x = a+b" <<EOF
+ptest "prefix: per_vertex= x = a+b" <<EOF
per_vertex = x = a+b
EOF
expect <<EOF
-FPVM, line 1, near "b": assignment mode not supported yet
+per_vertex = x = (+ a b)
EOF
#------------------------------------------------------------------------------
-ptest_fail "prefix: per_pixel=x = a+b" <<EOF
+ptest "prefix: per_pixel=x = a+b" <<EOF
per_pixel=x = a+b
EOF
expect <<EOF
-FPVM, line 1, near "b": assignment mode not supported yet
+per_vertex = x = (+ a b)
EOF
###############################################################################
--
1.7.1
_______________________________________________
http://lists.milkymist.org/listinfo.cgi/devel-milkymist.org
IRC: #milkymist@Freenode