$32 GRAYBYTE WORDPRESS FILE MANAGER $99

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/alt/python27/lib64/python2.7/compiler/

HOME
Current File : /opt/alt/python27/lib64/python2.7/compiler//syntax.py
"""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")

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
14 Aug 2025 9.29 PM
root / 996
0755
__init__.py
0.999 KB
8 Jan 2025 5.43 PM
root / 996
0644
__init__.pyc
1.279 KB
8 Jan 2025 5.43 PM
root / 996
0644
__init__.pyo
1.279 KB
8 Jan 2025 5.43 PM
root / 996
0644
ast.py
36.629 KB
8 Jan 2025 5.43 PM
root / 996
0644
ast.pyc
75.373 KB
8 Jan 2025 5.43 PM
root / 996
0644
ast.pyo
75.373 KB
8 Jan 2025 5.43 PM
root / 996
0644
consts.py
0.457 KB
8 Jan 2025 5.43 PM
root / 996
0644
consts.pyc
0.732 KB
8 Jan 2025 5.43 PM
root / 996
0644
consts.pyo
0.732 KB
8 Jan 2025 5.43 PM
root / 996
0644
future.py
1.849 KB
8 Jan 2025 5.43 PM
root / 996
0644
future.pyc
3.014 KB
8 Jan 2025 5.43 PM
root / 996
0644
future.pyo
3.014 KB
8 Jan 2025 5.43 PM
root / 996
0644
misc.py
1.752 KB
8 Jan 2025 5.43 PM
root / 996
0644
misc.pyc
3.887 KB
8 Jan 2025 5.43 PM
root / 996
0644
misc.pyo
3.887 KB
8 Jan 2025 5.43 PM
root / 996
0644
pyassem.py
23.699 KB
8 Jan 2025 5.43 PM
root / 996
0644
pyassem.pyc
26.358 KB
8 Jan 2025 5.43 PM
root / 996
0644
pyassem.pyo
25.798 KB
8 Jan 2025 5.43 PM
root / 996
0644
pycodegen.py
46.688 KB
8 Jan 2025 5.43 PM
root / 996
0644
pycodegen.pyc
57.387 KB
8 Jan 2025 5.43 PM
root / 996
0644
pycodegen.pyo
56.953 KB
8 Jan 2025 5.43 PM
root / 996
0644
symbols.py
14.149 KB
8 Jan 2025 5.43 PM
root / 996
0644
symbols.pyc
17.974 KB
8 Jan 2025 5.43 PM
root / 996
0644
symbols.pyo
17.94 KB
8 Jan 2025 5.43 PM
root / 996
0644
syntax.py
1.41 KB
8 Jan 2025 5.43 PM
root / 996
0644
syntax.pyc
1.914 KB
8 Jan 2025 5.43 PM
root / 996
0644
syntax.pyo
1.914 KB
8 Jan 2025 5.43 PM
root / 996
0644
transformer.py
51.871 KB
8 Jan 2025 5.43 PM
root / 996
0644
transformer.pyc
48.115 KB
8 Jan 2025 5.43 PM
root / 996
0644
transformer.pyo
46.343 KB
8 Jan 2025 5.43 PM
root / 996
0644
visitor.py
3.805 KB
8 Jan 2025 5.43 PM
root / 996
0644
visitor.pyc
4.216 KB
8 Jan 2025 5.43 PM
root / 996
0644
visitor.pyo
4.216 KB
8 Jan 2025 5.43 PM
root / 996
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF