Commit 9b4daab8 authored by Sébastien Villemot's avatar Sébastien Villemot

Macro-processor: add comprehensions

- update preprocessor submodule
- add some tests
parent 2cf6ccda
Subproject commit eb74d48393c32f765a4adac8f723ef959f5b4aa9
Subproject commit 913bc2f8c2cff41e591dae2bf5befa68acfa928f
......@@ -54,6 +54,25 @@ phi = 0.1;
@#endif
@#define x = 1:3
@#define y = [ i in x ; i > 1 ]
@#if y != [ 2, 3 ]
@# error "One-dimensional comprehension problem"
@#endif
@#define z = [ (i,j) in x^2 ; i != j ]
@#if z != [ (1,2), (1,3), (2,1), (2,3), (3,1), (3,2) ]
@# error "Two-dimensional comprehension problem"
@#endif
@#define t = 2:4
@#define tt = [ (i,j) in t^2 ; (i,j) in [ (k,l) in x^2 ; k != l ] ]
@#if tt != [ (2,3), (3,2) ]
@# error "Nested comprehension problem"
@#endif
model;
c*theta*h^(1+psi)=(1-alpha)*y;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment