Skip to content

Commit

Permalink
Move CharHexDigit to scanner.c, adapt comment
Browse files Browse the repository at this point in the history
  • Loading branch information
markuspf committed Nov 7, 2016
1 parent 1dd5215 commit 22adfad
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
20 changes: 19 additions & 1 deletion src/scanner.c
Original file line number Diff line number Diff line change
Expand Up @@ -1833,6 +1833,22 @@ static inline Char GetOctalDigits( void )
return c;
}


/****************************************************************************
**
*F CharHexDigit( <ch> ) . . . . . . . . . turn a single hex digit into Char
**
*/
static inline Char CharHexDigit( const Char ch ) {
if (ch >= 'a') {
return (ch - 'a' + 10);
} else if (ch >= 'A') {
return (ch - 'A' + 10);
} else {
return (ch - '0');
}
};

Char GetEscapedChar( void )
{
Char c;
Expand Down Expand Up @@ -1875,7 +1891,9 @@ Char GetEscapedChar( void )
GET_CHAR();
c += GetOctalDigits();
} else {
/* This warning is currently disabled for backwards compatibility */
/* Following discussions on pull-request #612, this warning is currently
disabled for backwards compatibility; some code relies on this behaviour
and tests break with the warning enabled */
/*
if (IsAlpha(*TLS(In)))
SyntaxWarning("Alphabet letter after \\");
Expand Down
16 changes: 0 additions & 16 deletions src/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -650,22 +650,6 @@ extern UInt SyTimeChildrenSys ( void );
*/
#define IsSpace(ch) (isspace((unsigned int)ch))


/****************************************************************************
**
*F CharHexDigit( <ch> ) . . . . . . . . . turn a single hex digit into Char
**
*/
static inline Char CharHexDigit( const Char ch ) {
if (ch >= 'a') {
return (ch - 'a' + 10);
} else if (ch >= 'A') {
return (ch - 'A' + 10);
} else {
return (ch - '0');
}
};

/****************************************************************************
**
*F SyIntString( <string> ) . . . . . . . . extract a C integer from a string
Expand Down

0 comments on commit 22adfad

Please sign in to comment.