Dropping trailing whitespaces

This commit is contained in:
David
2014-08-06 12:46:26 +02:00
parent 78c866ce59
commit 0c61eb11f5
91 changed files with 3139 additions and 3139 deletions
+1 -1
View File
@@ -287,7 +287,7 @@ class SafeConstructor(BaseConstructor):
return str(value).decode('base64')
except (binascii.Error, UnicodeEncodeError), exc:
raise ConstructorError(None, None,
"failed to decode base64 data: %s" % exc, node.start_mark)
"failed to decode base64 data: %s" % exc, node.start_mark)
timestamp_regexp = re.compile(
ur'''^(?P<year>[0-9][0-9][0-9][0-9])
+1 -1
View File
@@ -674,7 +674,7 @@ class Emitter(object):
# Check for indicators.
if index == 0:
# Leading indicators are special characters.
if ch in u'#,[]{}&*!|>\'\"%@`':
if ch in u'#,[]{}&*!|>\'\"%@`':
flow_indicators = True
block_indicators = True
if ch in u'?:':
+1 -1
View File
@@ -482,7 +482,7 @@ class Parser(object):
token = self.peek_token()
raise ParserError("while parsing a flow sequence", self.marks[-1],
"expected ',' or ']', but got %r" % token.id, token.start_mark)
if self.check_token(KeyToken):
token = self.peek_token()
event = MappingStartEvent(None, None, True,
+9 -9
View File
@@ -314,7 +314,7 @@ class Scanner(object):
# Remove the saved possible key position at the current flow level.
if self.flow_level in self.possible_simple_keys:
key = self.possible_simple_keys[self.flow_level]
if key.required:
raise ScannerError("while scanning a simple key", key.mark,
"could not found expected ':'", self.get_mark())
@@ -363,11 +363,11 @@ class Scanner(object):
# Read the token.
mark = self.get_mark()
# Add STREAM-START.
self.tokens.append(StreamStartToken(mark, mark,
encoding=self.encoding))
def fetch_stream_end(self):
@@ -381,7 +381,7 @@ class Scanner(object):
# Read the token.
mark = self.get_mark()
# Add STREAM-END.
self.tokens.append(StreamEndToken(mark, mark))
@@ -389,7 +389,7 @@ class Scanner(object):
self.done = True
def fetch_directive(self):
# Set the current intendation to -1.
self.unwind_indent(-1)
@@ -516,7 +516,7 @@ class Scanner(object):
self.tokens.append(BlockEntryToken(start_mark, end_mark))
def fetch_key(self):
# Block context needs additional checks.
if not self.flow_level:
@@ -566,7 +566,7 @@ class Scanner(object):
# It must be a part of a complex key.
else:
# Block context needs additional checks.
# (Do we really need them? They will be catched by the parser
# anyway.)
@@ -1024,14 +1024,14 @@ class Scanner(object):
# Unfortunately, folding rules are ambiguous.
#
# This is the folding according to the specification:
if folded and line_break == u'\n' \
and leading_non_space and self.peek() not in u' \t':
if not breaks:
chunks.append(u' ')
else:
chunks.append(line_break)
# This is Clark Evans's interpretation (also in the spec
# examples):
#