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
Sebastian Schrader
Kea
Commits
1ed3ca78
Commit
1ed3ca78
authored
Nov 14, 2012
by
JINMEI Tatuya
Browse files
[2373] refactoring: extend skipComment to include 'escaped' consideration.
this will help constify 'c' in String::handle.
parent
1726141c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/dns/master_lexer.cc
View file @
1ed3ca78
...
@@ -51,8 +51,8 @@ struct MasterLexer::MasterLexerImpl {
...
@@ -51,8 +51,8 @@ struct MasterLexer::MasterLexerImpl {
// commonly used by state classes. It returns the corresponding "end-of"
// commonly used by state classes. It returns the corresponding "end-of"
// character in case it's a comment; otherwise it simply returns the
// character in case it's a comment; otherwise it simply returns the
// current character.
// current character.
int
skipComment
(
int
c
)
{
int
skipComment
(
int
c
,
bool
escaped
=
false
)
{
if
(
c
==
';'
)
{
if
(
c
==
';'
&&
!
escaped
)
{
while
(
true
)
{
while
(
true
)
{
c
=
source_
->
getChar
();
c
=
source_
->
getChar
();
if
(
c
==
'\n'
||
c
==
InputSource
::
END_OF_STREAM
)
{
if
(
c
==
'\n'
||
c
==
InputSource
::
END_OF_STREAM
)
{
...
@@ -325,10 +325,8 @@ String::handle(MasterLexer& lexer) const {
...
@@ -325,10 +325,8 @@ String::handle(MasterLexer& lexer) const {
bool
escaped
=
false
;
bool
escaped
=
false
;
while
(
true
)
{
while
(
true
)
{
int
c
=
getLexerImpl
(
lexer
)
->
source_
->
getChar
();
const
int
c
=
getLexerImpl
(
lexer
)
->
skipComment
(
if
(
!
escaped
)
{
getLexerImpl
(
lexer
)
->
source_
->
getChar
(),
escaped
);
c
=
getLexerImpl
(
lexer
)
->
skipComment
(
c
);
}
if
(
getLexerImpl
(
lexer
)
->
isTokenEnd
(
c
,
escaped
))
{
if
(
getLexerImpl
(
lexer
)
->
isTokenEnd
(
c
,
escaped
))
{
getLexerImpl
(
lexer
)
->
source_
->
ungetChar
();
getLexerImpl
(
lexer
)
->
source_
->
ungetChar
();
...
...
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