-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
black
1 parent
f912efc
commit b761710
Showing
31 changed files
with
1,873 additions
and
876 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
from puppetparser.parser import parse | ||
|
||
with open("test.pp", "r") as f: | ||
print(parse(f.read())) | ||
print(parse(f.read())) |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,26 @@ | ||
import re | ||
from typing import Any | ||
|
||
def lex(module: Any =None, object: Any =None, debug: bool =False, optimize: bool =False, lextab: str='lextab', | ||
reflags: int =int(re.VERBOSE), nowarn: bool =False, outputdir: str | None =None, debuglog: str | None =None, errorlog: str | None=None) -> Any: | ||
... | ||
def lex( | ||
module: Any = None, | ||
object: Any = None, | ||
debug: bool = False, | ||
optimize: bool = False, | ||
lextab: str = "lextab", | ||
reflags: int = int(re.VERBOSE), | ||
nowarn: bool = False, | ||
outputdir: str | None = None, | ||
debuglog: str | None = None, | ||
errorlog: str | None = None, | ||
) -> Any: ... | ||
|
||
class Lexer: | ||
lineno: int | ||
|
||
def begin(self, state: str) -> None: | ||
... | ||
def begin(self, state: str) -> None: ... | ||
|
||
class LexToken: | ||
value: str | ||
lexer: Lexer | ||
lexpos: int | ||
type: str | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
from typing import Any | ||
|
||
def yacc(method: str='LALR', debug: bool=True, module: Any=None, tabmodule: str='parsetab', start: Any=None, | ||
check_recursion: bool=True, optimize: bool=False, write_tables: bool=True, debugfile: str='parser.out', | ||
outputdir: str | None=None, debuglog: str | None=None, errorlog: str | None=None, picklefile: str | None=None) -> Any: | ||
... | ||
def yacc( | ||
method: str = "LALR", | ||
debug: bool = True, | ||
module: Any = None, | ||
tabmodule: str = "parsetab", | ||
start: Any = None, | ||
check_recursion: bool = True, | ||
optimize: bool = False, | ||
write_tables: bool = True, | ||
debugfile: str = "parser.out", | ||
outputdir: str | None = None, | ||
debuglog: str | None = None, | ||
errorlog: str | None = None, | ||
picklefile: str | None = None, | ||
) -> Any: ... | ||
|
||
class YaccProduction: | ||
def __getitem__(self, n: int) -> Any: | ||
... | ||
|
||
def __setitem__(self, n: int, v: Any) -> Any: | ||
... | ||
|
||
def lineno(self, n: int) -> int: | ||
... | ||
|
||
def lexpos(self, n: int) -> int: | ||
... | ||
|
||
def set_lineno(self, n: int, lineno: int) -> None: | ||
... | ||
|
||
|
||
def __getitem__(self, n: int) -> Any: ... | ||
def __setitem__(self, n: int, v: Any) -> Any: ... | ||
def lineno(self, n: int) -> int: ... | ||
def lexpos(self, n: int) -> int: ... | ||
def set_lineno(self, n: int, lineno: int) -> None: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
def assertHash(test, hash_p, hash): | ||
for k,v in hash_p.items(): | ||
for k, v in hash_p.items(): | ||
test.assertTrue(k.value in hash) | ||
test.assertEqual(v.value, hash[k.value]) | ||
test.assertEqual(len(hash_p.keys()), len(hash.keys())) | ||
|
||
|
||
def assertArray(test, array_p, array): | ||
for i in range(len(array)): | ||
test.assertEqual(array_p[i].value, array[i]) | ||
|
||
test.assertEqual(len(array), len(array_p)) | ||
test.assertEqual(len(array), len(array_p)) |