Verified Commit c03375d2 authored by Camil Staps's avatar Camil Staps 🚀

In test/builtin_syntax, use -clc to test also examples relying on the iTask compiler

parent 285466a4
Pipeline #40192 passed with stages
in 13 minutes and 36 seconds
......@@ -303,10 +303,8 @@ bs_funcdep =
]
, syntax_description = "Lets you point the type checker to the type that is determined by the other types (undocumented and experimental)."
, syntax_doc_locations = []
, syntax_examples = map (requires_itask_compiler o EX)
[ "class plus a b ~c :: a b -> c\n" +
"instance plus Int Int Int where plus x y = x + y\n" +
"Start = plus 1 (plus 1 1) // Overloading can be resolved because we told the compiler that c is determined by the other types."
, syntax_examples = map (add_imports ["StdEnv"] o requires_itask_compiler o EX)
[ "class plus a b ~c :: a b -> c // c is determined by a and b"
]
}
......@@ -368,8 +366,8 @@ bs_generic =
"generic gFun a | gDefault a :: a -> Int // A generic function with a generic context. The context will become an argument.\n" +
"derive gFun CONS of {gcd_arity} with f _ // A derivation that does not use all arguments. The compiler can optimize even more.\n" +
"gFun{|CONS of {gcd_arity}|} f _ _ = undef // A derivation that does not use the context and only one field of the generic type descriptor, the compiler can optimize for this."
, requires_itask_compiler $ EX $
"generic gShared a *! :: a // A generic function using a bimap without uniqueness attributes (only supported by the iTask compiler; see https://gitlab.science.ru.nl/clean-and-itasks/clean-language-report/blob/master/experimental/binumap.md)\n"
, add_imports ["StdGeneric"] $ requires_itask_compiler $ EX $
"generic gShared a *! :: a // A generic function using a bimap without uniqueness attributes (requires the iTask compiler)\n"
]
}
......
......@@ -65,8 +65,7 @@ test se (i,failed,w)
test_example :: !SyntaxExample !*(!Int, !*World) -> *(!Bool, !*(!Int, !*World))
test_example {example,cleanjs_start,bootstrap,requires_itask_compiler} (i,w)
| requires_itask_compiler
|| indexOf "not allowed" (toLowerCase example) >= 0 // examples that are marked as not allowed by the compiler
| indexOf "not allowed" (toLowerCase example) >= 0 // examples that are marked as not allowed by the compiler
|| startsWith "definition module " example // module headings
|| startsWith "implementation module " example
|| startsWith "system module " example
......@@ -100,7 +99,8 @@ test_example {example,cleanjs_start,bootstrap,requires_itask_compiler} (i,w)
# (_,w) = writeFile (DIRECTORY </> "_example" <+ i <+ ".dcl") dcl w
# (_,w) = writeFile (DIRECTORY </> "_example" <+ i <+ ".icl") icl w
# (Ok (h,_),w) = runProcessIO "clm" (CLMFLAGS ++ ["_example" <+ i]) (Just DIRECTORY) w
# args = CLMFLAGS ++ if requires_itask_compiler ["-clc","cocl-itasks"] [] ++ ["_example" <+ i]
# (Ok (h,_),w) = runProcessIO "clm" args (Just DIRECTORY) w
# (Ok r,w) = waitForProcess h w
# ok = r == 0
......
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