Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
badw-it
DHParser
Commits
096655b3
Commit
096655b3
authored
Nov 02, 2017
by
di68kap
Browse files
- python 3.4 compatibility restored
parent
6b52e952
Changes
4
Hide whitespace changes
Inline
Side-by-side
DHParser/dsl.py
View file @
096655b3
...
...
@@ -20,7 +20,6 @@ compilation of domain specific languages based on an EBNF-grammar.
"""
import
os
from
typing
import
Any
,
cast
,
List
,
Tuple
,
Union
,
Iterator
,
Iterable
from
DHParser.ebnf
import
EBNFCompiler
,
grammar_changed
,
\
get_ebnf_preprocessor
,
get_ebnf_grammar
,
get_ebnf_transformer
,
get_ebnf_compiler
,
\
...
...
@@ -29,7 +28,8 @@ from DHParser.error import Error, is_error, has_errors, only_errors
from
DHParser.parser
import
Grammar
,
Compiler
,
compile_source
,
nil_preprocessor
,
PreprocessorFunc
from
DHParser.syntaxtree
import
Node
,
TransformationFunc
from
DHParser.toolkit
import
logging
,
load_if_file
,
is_python_code
,
compile_python_object
,
\
re
re
,
typing
from
typing
import
Any
,
cast
,
List
,
Tuple
,
Union
,
Iterator
,
Iterable
__all__
=
(
'GrammarError'
,
'CompilationError'
,
...
...
DHParser/ebnf.py
View file @
096655b3
...
...
@@ -19,18 +19,18 @@ permissions and limitations under the License.
import
keyword
from
collections
import
OrderedDict
from
functools
import
partial
from
typing
import
Callable
,
Dict
,
List
,
Set
,
Tuple
from
DHParser.error
import
Error
from
DHParser.parser
import
Grammar
,
mixin_comment
,
nil_preprocessor
,
Forward
,
RegExp
,
RE
,
\
NegativeLookahead
,
Alternative
,
Series
,
Option
,
OneOrMore
,
ZeroOrMore
,
Token
,
\
Compiler
,
PreprocessorFunc
from
DHParser.syntaxtree
import
Node
,
TransformationFunc
,
WHITESPACE_PTYPE
,
TOKEN_PTYPE
from
DHParser.toolkit
import
load_if_file
,
escape_re
,
md5
,
sane_parser_name
,
re
from
DHParser.toolkit
import
load_if_file
,
escape_re
,
md5
,
sane_parser_name
,
re
,
typing
from
DHParser.transform
import
traverse
,
remove_brackets
,
\
reduce_single_child
,
replace_by_single_child
,
remove_expendables
,
\
remove_tokens
,
flatten
,
forbid
,
assert_content
,
remove_infix_operator
from
DHParser.versionnumber
import
__version__
from
typing
import
Callable
,
Dict
,
List
,
Set
,
Tuple
__all__
=
(
'get_ebnf_preprocessor'
,
'get_ebnf_grammar'
,
...
...
DHParser/parser.py
View file @
096655b3
...
...
@@ -58,14 +58,15 @@ https://epsil.github.io/gll/
import
copy
import
os
from
functools
import
partial
from
typing
import
Any
,
Callable
,
cast
,
Dict
,
List
,
Set
,
Tuple
,
Union
,
Optional
from
DHParser.error
import
Error
,
is_error
,
has_errors
,
linebreaks
,
line_col
from
DHParser.stringview
import
StringView
,
EMPTY_STRING_VIEW
from
DHParser.syntaxtree
import
Node
,
TransformationFunc
,
ParserBase
,
WHITESPACE_PTYPE
,
\
TOKEN_PTYPE
,
ZOMBIE_PARSER
from
DHParser.toolkit
import
is_logging
,
log_dir
,
logfile_basename
,
escape_re
,
sane_parser_name
,
\
load_if_file
,
re
load_if_file
,
re
,
typing
from
typing
import
Any
,
Callable
,
cast
,
Dict
,
List
,
Set
,
Tuple
,
Union
,
Optional
__all__
=
(
'PreprocessorFunc'
,
'HistoryRecord'
,
...
...
DHParser/stringview.py
View file @
096655b3
...
...
@@ -23,7 +23,10 @@ However, this becomes costly (in terms of space and as a consequence also
time) when parsing longer documents. Unfortunately, Python's `memoryview`
does not work for unicode strings. Hence, the StringView class.
"""
import
collections
from
DHParser.toolkit
import
typing
from
typing
import
Optional
,
Iterable
,
Tuple
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment