Exemple #1
0
 def to_python(self, not_null=False, boolean=False, many=False):
     return with_var(
         "f",
         "(" + Python[self.value].to_python() + ").find" + "(" +
         Python[self.find].to_python() + ")",
         "None if f==-1 else f",
     )
Exemple #2
0
    def to_python(self, not_null=False, boolean=False, many=False):
        v = (self.value).to_python()
        l = (self.length).to_python()

        return with_var(
            "v", v, "None if v == None else v[max(0, len(v)-int(" + l + ")):]")
Exemple #3
0
 def to_python(self, not_null=False, boolean=False, many=False):
     return with_var(
         "f",
         Python[self.term].to_python(),
         "bool(f)",
     )
Exemple #4
0
    def to_python(self, not_null=False, boolean=False, many=False):
        lhs = (self.lhs).to_python()
        rhs = (self.rhs).to_python()

        return with_var("r, l", "(" + lhs + "," + rhs + ")",
                        "l!=None and r!=None and l!=r")