pyrser/hooks/predicate.py
def pred_eq(self, n, val):
    """
    Test if a node set with setint or setstr equal a certain value

    example::

        R = [
            __scope__:n
            ['a' #setint(n, 12) | 'b' #setint(n, 14)]
            C
            [#eq(n, 12) D]
        ]

    """
    v1 = n.value
    v2 = val
    if hasattr(val, 'value'):
        v2 = val.value
    if isinstance(v1, int) and not isinstance(v2, int):
        return v1 == int(v2)
    return v1 == v2
def pred_eq(self, n, val):
    v1 = n.value
    v2 = val
    if hasattr(val, 'value'):
        v2 = val.value
    if isinstance(v1, int) and not isinstance(v2, int):
        return v1 == int(v2)
    return v1 == v2
def pred_eq ( self , n , val ) : v1 = n . value v2 = val if hasattr ( val , 'value' ) : v2 = val . value if isinstance ( v1 , int ) and not isinstance ( v2 , int ) : return v1 == int ( v2 ) return v1 == v2
Test if a node set with setint or setstr equal a certain value

    example::

        R = [
            __scope__:n
            ['a' #setint(n, 12) | 'b' #setint(n, 14)]
            C
            [#eq(n, 12) D]
        ]
Test if a node set with setint or setstr equal a certain value