Beispiel #1
0
    def test_ref_integraton_with_dsl(self):

        y = P.Ref('y')


        assert 5 == P.Pipe(
            1,
            P + 4,
            P.On(y),
            P * 10,
            'y'
        )

        assert 5 == P.Pipe(
            1,
            P + 4,
            P.On(y),
            P * 10,
            'y'
        )

        assert 5 == P.Pipe(
            1,
            P + 4,
            P.On('y'),
            P * 10,
            'y'
        )
Beispiel #2
0
    def test_write_tree(self):

        code = (P + 1, P * 2, [P * 100, P.On('c'), P - 3, 'c'])

        f, refs = dsl.Compile(code, {})

        assert [600, 6, 3, 6] == f(2)