OXIESEC PANEL
- Current Dir:
/
/
opt
/
alt
/
python27
/
lib64
/
python2.7
/
compiler
Server IP: 2a02:4780:11:1084:0:327f:3464:10
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/08/2025 12:11:24 AM
rwxr-xr-x
📄
__init__.py
1023 bytes
01/08/2025 10:43:00 AM
rw-r--r--
📄
__init__.pyc
1.28 KB
01/08/2025 10:43:01 AM
rw-r--r--
📄
__init__.pyo
1.28 KB
01/08/2025 10:43:01 AM
rw-r--r--
📄
ast.py
36.63 KB
01/08/2025 10:43:01 AM
rw-r--r--
📄
ast.pyc
75.37 KB
01/08/2025 10:43:00 AM
rw-r--r--
📄
ast.pyo
75.37 KB
01/08/2025 10:43:00 AM
rw-r--r--
📄
consts.py
468 bytes
01/08/2025 10:43:00 AM
rw-r--r--
📄
consts.pyc
750 bytes
01/08/2025 10:43:00 AM
rw-r--r--
📄
consts.pyo
750 bytes
01/08/2025 10:43:00 AM
rw-r--r--
📄
future.py
1.85 KB
01/08/2025 10:43:01 AM
rw-r--r--
📄
future.pyc
3.01 KB
01/08/2025 10:43:00 AM
rw-r--r--
📄
future.pyo
3.01 KB
01/08/2025 10:43:00 AM
rw-r--r--
📄
misc.py
1.75 KB
01/08/2025 10:43:01 AM
rw-r--r--
📄
misc.pyc
3.89 KB
01/08/2025 10:43:01 AM
rw-r--r--
📄
misc.pyo
3.89 KB
01/08/2025 10:43:01 AM
rw-r--r--
📄
pyassem.py
23.7 KB
01/08/2025 10:43:00 AM
rw-r--r--
📄
pyassem.pyc
26.36 KB
01/08/2025 10:43:01 AM
rw-r--r--
📄
pyassem.pyo
25.8 KB
01/08/2025 10:43:01 AM
rw-r--r--
📄
pycodegen.py
46.69 KB
01/08/2025 10:43:01 AM
rw-r--r--
📄
pycodegen.pyc
57.39 KB
01/08/2025 10:43:01 AM
rw-r--r--
📄
pycodegen.pyo
56.95 KB
01/08/2025 10:43:00 AM
rw-r--r--
📄
symbols.py
14.15 KB
01/08/2025 10:43:01 AM
rw-r--r--
📄
symbols.pyc
17.97 KB
01/08/2025 10:43:00 AM
rw-r--r--
📄
symbols.pyo
17.94 KB
01/08/2025 10:43:01 AM
rw-r--r--
📄
syntax.py
1.41 KB
01/08/2025 10:43:00 AM
rw-r--r--
📄
syntax.pyc
1.91 KB
01/08/2025 10:43:01 AM
rw-r--r--
📄
syntax.pyo
1.91 KB
01/08/2025 10:43:01 AM
rw-r--r--
📄
transformer.py
51.87 KB
01/08/2025 10:43:01 AM
rw-r--r--
📄
transformer.pyc
48.12 KB
01/08/2025 10:43:01 AM
rw-r--r--
📄
transformer.pyo
46.34 KB
01/08/2025 10:43:01 AM
rw-r--r--
📄
visitor.py
3.8 KB
01/08/2025 10:43:01 AM
rw-r--r--
📄
visitor.pyc
4.22 KB
01/08/2025 10:43:01 AM
rw-r--r--
📄
visitor.pyo
4.22 KB
01/08/2025 10:43:01 AM
rw-r--r--
Editing: syntax.py
Close
"""Check for errs in the AST. The Python parser does not catch all syntax errors. Others, like assignments with invalid targets, are caught in the code generation phase. The compiler package catches some errors in the transformer module. But it seems clearer to write checkers that use the AST to detect errors. """ from compiler import ast, walk def check(tree, multi=None): v = SyntaxErrorChecker(multi) walk(tree, v) return v.errors class SyntaxErrorChecker: """A visitor to find syntax errors in the AST.""" def __init__(self, multi=None): """Create new visitor object. If optional argument multi is not None, then print messages for each error rather than raising a SyntaxError for the first. """ self.multi = multi self.errors = 0 def error(self, node, msg): self.errors = self.errors + 1 if self.multi is not None: print "%s:%s: %s" % (node.filename, node.lineno, msg) else: raise SyntaxError, "%s (%s:%s)" % (msg, node.filename, node.lineno) def visitAssign(self, node): # the transformer module handles many of these pass ## for target in node.nodes: ## if isinstance(target, ast.AssList): ## if target.lineno is None: ## target.lineno = node.lineno ## self.error(target, "can't assign to list comprehension")