Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
yaml-cpp
Commits
c3f222e4
"...composable_kernel_rocm.git" did not exist on "bb652696e765fe178404bd38a071d6d6b829bccb"
Commit
c3f222e4
authored
Oct 29, 2009
by
jbeder
Browse files
Fixed the whitespace tracking when we escape a newline in a double-quoted string
parent
e8beb6c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
src/scanscalar.cpp
src/scanscalar.cpp
+6
-4
No files found.
src/scanscalar.cpp
View file @
c3f222e4
...
...
@@ -31,6 +31,7 @@ namespace YAML
// Phase #1: scan until line ending
std
::
size_t
lastNonWhitespaceChar
=
scalar
.
size
();
bool
escapedNewline
=
false
;
while
(
!
params
.
end
.
Matches
(
INPUT
)
&&
!
Exp
::
Break
.
Matches
(
INPUT
))
{
if
(
!
INPUT
)
break
;
...
...
@@ -48,10 +49,11 @@ namespace YAML
// escaped newline? (only if we're escaping on slash)
if
(
params
.
escape
==
'\\'
&&
Exp
::
EscBreak
.
Matches
(
INPUT
))
{
int
n
=
Exp
::
EscBreak
.
Match
(
INPUT
);
INPUT
.
e
a
t
(
n
);
// eat escape character and get out (but preserve trailing whitespace!)
INPUT
.
g
et
();
lastNonWhitespaceChar
=
scalar
.
size
();
continue
;
escapedNewline
=
true
;
break
;
}
// escape this?
...
...
@@ -149,7 +151,7 @@ namespace YAML
case
FOLD_FLOW
:
if
(
nextEmptyLine
)
scalar
+=
"
\n
"
;
else
if
(
!
emptyLine
&&
!
nextEmptyLine
)
else
if
(
!
emptyLine
&&
!
nextEmptyLine
&&
!
escapedNewline
)
scalar
+=
" "
;
break
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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