-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathsct_syntax.py
More file actions
31 lines (20 loc) · 798 Bytes
/
sct_syntax.py
File metadata and controls
31 lines (20 loc) · 798 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from protowhat.sct_syntax import EagerChain, ExGen, LazyChainStart, state_dec_gen, LazyChain
from pythonwhat.checks.check_wrappers import scts
from pythonwhat.State import State
# TODO: could define scts for check_wrappers at the module level
sct_dict = scts.copy()
state_dec = state_dec_gen(sct_dict)
# todo: __all__?
assert ExGen
assert LazyChainStart
def Ex(state=None):
return EagerChain(state=state or State.root_state, chainable_functions=sct_dict)
def F():
return LazyChain(chainable_functions=sct_dict)
def get_chains():
return {
"Ex": ExGen(sct_dict, State.root_state),
"F": LazyChainStart(sct_dict),
}
# Prepare check_funcs to be used alone (e.g. test = check_with().check_body())
v2_check_functions = {k: state_dec(v) for k, v in scts.items()}