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
8cc1d9da
Commit
8cc1d9da
authored
Nov 18, 2017
by
eckhart
Browse files
- small adjustments
parent
39ea46fb
Changes
2
Hide whitespace changes
Inline
Side-by-side
DHParser/error.py
View file @
8cc1d9da
...
...
@@ -105,7 +105,7 @@ def only_errors(messages: Iterable[Error], level: int = Error.ERROR) -> Iterator
return
(
err
for
err
in
messages
if
err
.
level
>=
level
)
def
linebreaks
(
text
:
Union
[
StringView
,
str
]):
def
linebreaks
(
text
:
Union
[
StringView
,
str
])
->
List
[
int
]
:
"""
Returns a list of indices all line breaks in the text.
"""
...
...
DHParser/syntaxtree.py
View file @
8cc1d9da
...
...
@@ -374,9 +374,8 @@ class Node(collections.abc.Sized):
"""
Adds an error to this Node.
Parameters:
message(str): A string with the error message.abs
level(int): The error level (error or warning)
code(Hashable): An error code to identify the kind of error
message(str): A string with the error message.abs
code(int): An error code to identify the kind of error
"""
self
.
_errors
.
append
(
Error
(
message
,
code
))
self
.
error_flag
=
max
(
self
.
error_flag
,
self
.
_errors
[
-
1
].
code
)
...
...
@@ -430,11 +429,11 @@ class Node(collections.abc.Sized):
Args:
tab (str): The indentation string, e.g. '
\t
' or ' '
open
F:
(Node->str) A function that returns an opening
open
_fn:
(Node->str) A function that returns an opening
string (e.g. an XML-tag_name) for a given node
close
F
: (Node->str) A function that returns a closeF
close
_fn
: (Node->str) A function that returns a closeF
string (e.g. an XML-tag_name) for a given node.
data
F:
(str->str) A function that filters the data string
data
_fn:
(str->str) A function that filters the data string
before printing, e.g. to add quotation marks
Returns (str):
...
...
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