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
5927d91d
Commit
5927d91d
authored
Sep 10, 2017
by
Eckhart Arnold
Browse files
sync commit
parent
170de697
Changes
2
Hide whitespace changes
Inline
Side-by-side
DHParser/parser.py
View file @
5927d91d
...
...
@@ -1902,10 +1902,10 @@ class Compiler:
def
compile_source
(
source
:
str
,
preprocessor
:
PreprocessorFunc
,
# str -> str
parser
:
Grammar
,
# str -> Node (concrete syntax tree (CST))
preprocessor
:
PreprocessorFunc
,
# str -> str
parser
:
Grammar
,
# str -> Node (concrete syntax tree (CST))
transformer
:
TransformationFunc
,
# Node -> Node (abstract syntax tree (AST))
compiler
:
Compiler
)
:
# Node (AST) -> Any
compiler
:
Compiler
)
->
Tuple
[
Any
,
List
[
str
],
Node
]:
# Node (AST) -> Any
"""
Compiles a source in four stages:
1. Scanning (if needed)
...
...
DHParser/toolkit.py
View file @
5927d91d
...
...
@@ -235,7 +235,7 @@ def sv_index(absolute_index: int, sv: StringView) -> int:
def
sv_indices
(
absolute_indices
:
Iterable
[
int
],
sv
:
StringView
)
->
Tuple
[
int
,
...]:
"""Converts
the an index
into string watched by a StringView object
"""Converts
indices
into
a
string watched by a StringView object
to an index relativ to the string view object. See also: `sv_index()`
"""
return
tuple
(
index
-
sv
.
begin
for
index
in
absolute_indices
)
...
...
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