示例#1
0
 def __init__(self, msg, kargs):
     # pylint: disable-msg=W0142
     Node.__init__(self, msg, kargs)
     if 'in_all' in kargs:
         SyntaxError.__init__(
             self, msg,
             (kargs.get('in_filename', ''), int(kargs.get('in_lineno', 0)),
              int(kargs.get('in_char', 0)), kargs.get('in_all')))
     else:
         SyntaxError.__init__(
             self, msg,
             (kargs.get('in_filename', ''), int(kargs.get('in_lineno', -1)),
              int(kargs.get('in_offset', 1)), kargs.get('in_rest', '')))
示例#2
0
 def __init__(self, msg, kargs):
     # pylint: disable-msg=W0142
     Node.__init__(self, msg, kargs)
     if 'in_all' in kargs:
         SyntaxError.__init__(self, msg, 
                              (kargs.get('in_filename', ''),
                               int(kargs.get('in_lineno', 0)),
                               int(kargs.get('in_char', 0)),
                               kargs.get('in_all')))
     else:
         SyntaxError.__init__(self, msg, 
                              (kargs.get('in_filename', ''),
                               int(kargs.get('in_lineno', -1)),
                               int(kargs.get('in_offset', 1)),
                               kargs.get('in_rest', '')))
示例#3
0
 def __init__(self, msg, location):
     # pylint: disable-msg=W0142
     Node.__init__(self, msg, location)
     SyntaxError.__init__(self, msg, location)
示例#4
0
 def test_order(self):
     tree = Node(1, 2, Node(3, Node(4), Node(), 5))
     result = list(leaves(tree, Node))
     assert result == [1, 2, 3, 4, 5], result
示例#5
0
 def __init__(self, msg, location):
     # pylint: disable-msg=W0142
     Node.__init__(self, msg, location)
     SyntaxError.__init__(self, msg, location)