Update pycparser stubs

This commit is contained in:
Simon Lindholm
2022-12-26 00:09:32 +01:00
parent 95b9d5f926
commit 91a2d5ba35
8 changed files with 164 additions and 353 deletions
+2 -1
View File
@@ -6,7 +6,8 @@ from random import Random
import re
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, TYPE_CHECKING, Union
from pycparser import CParser, c_ast as ca, c_generator
from pycparser import c_ast as ca, c_generator
from pycparser.c_parser import CParser
from pycparser.plyparser import ParseError
from .error import CandidateConstructionFailure
-18
View File
@@ -1,18 +0,0 @@
#-----------------------------------------------------------------
# pycparser: __init__.py
#
# This package file exports some convenience functions for
# interacting with pycparser
#
# Eli Bendersky [https://eli.thegreenplace.net/]
# License: BSD
#-----------------------------------------------------------------
__all__ = ['c_parser', 'c_ast']
__version__ = '2.19'
from typing import Any, List, Union
from . import c_ast
from .c_parser import CParser
def preprocess_file(filename: str, cpp_path: str='cpp', cpp_args: Union[List[str], str]='') -> str: ...
def parse_file(filename: str, use_cpp: bool=False, cpp_path: str='cpp', cpp_args: str='', parser: Any=None) -> c_ast.FileAST: ...
+26
View File
@@ -0,0 +1,26 @@
# -----------------------------------------------------------------
# pycparser: __init__.py
#
# This package file exports some convenience functions for
# interacting with pycparser
#
# Eli Bendersky [https://eli.thegreenplace.net/]
# License: BSD
# -----------------------------------------------------------------
__all__ = ["c_parser", "c_ast"]
__version__ = "2.19"
from typing import Any, List, Optional, Union
from . import c_ast
from .c_parser import CParser
def preprocess_file(
filename: str, cpp_path: str = "cpp", cpp_args: Union[List[str], str] = ""
) -> str: ...
def parse_file(
filename: str,
use_cpp: bool = False,
cpp_path: str = "cpp",
cpp_args: str = "",
parser: Optional[CParser] = None,
) -> c_ast.FileAST: ...
File diff suppressed because it is too large Load Diff
@@ -1,11 +1,11 @@
#------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
# pycparser: c_generator.py
#
# C code generator from pycparser AST nodes.
#
# Eli Bendersky [https://eli.thegreenplace.net/]
# License: BSD
#------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
from . import c_ast
class CGenerator:
-15
View File
@@ -1,15 +0,0 @@
#------------------------------------------------------------------------------
# pycparser: c_parser.py
#
# CParser class: Parser and AST builder for the C language
#
# Eli Bendersky [https://eli.thegreenplace.net/]
# License: BSD
#------------------------------------------------------------------------------
from . import c_ast
class CParser:
def __init__(self) -> None: ...
def parse(self, text: str, filename: str='', debuglevel: int=0) -> c_ast.FileAST: ...
+22
View File
@@ -0,0 +1,22 @@
# ------------------------------------------------------------------------------
# pycparser: c_parser.py
#
# CParser class: Parser and AST builder for the C language
#
# Eli Bendersky [https://eli.thegreenplace.net/]
# License: BSD
# ------------------------------------------------------------------------------
from . import c_ast
from typing import Any, Dict, List, Optional
class CParser:
clex: Any # CLexer
cparser: Any # LRParser
_scope_stack: List[Dict[str, bool]]
_last_yielded_token: Optional[Any]
def __init__(self) -> None: ...
def parse(
self, text: str, filename: str = "", debuglevel: int = 0
) -> c_ast.FileAST: ...
@@ -10,18 +10,13 @@
from typing import Optional
class Coord:
file: str
line: int
column: Optional[int]
def __init__(self, file: str, line: int, column: Optional[int] = None):
...
def __str__(self) -> str:
...
def __init__(self, file: str, line: int, column: Optional[int] = None): ...
def __str__(self) -> str: ...
class ParseError(Exception):
pass