Skip to content

Commit

Permalink
Only display a warning if backslash is followed by a letter
Browse files Browse the repository at this point in the history
  • Loading branch information
markuspf committed May 13, 2016
1 parent f1aedb3 commit 72ec6bb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions doc/ref/string.xml
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ starting with a backslash results in an error.
<Index>escaping non-special characters</Index>
other</Mark>
<Item>
For any other character the backslash is ignored and a warning is
displayed.
For any other character the backslash is ignored. If the character
is a letter, that is one of <C>a..zA..Z</C>, then a warning is displayed.
</Item>
</List>
<P/>
Expand Down
5 changes: 3 additions & 2 deletions src/scanner.c
Original file line number Diff line number Diff line change
Expand Up @@ -1875,8 +1875,9 @@ Char GetEscapedChar( void )
GET_CHAR();
c += GetOctalDigits();
} else {
SyntaxWarning("Expecting valid escape sequence after \\");
c = *TLS(In);
if (IsAlpha(*TLS(In)))
SyntaxWarning("Alphabet letter after \\");
c = *TLS(In);
}
return c;
}
Expand Down

0 comments on commit 72ec6bb

Please sign in to comment.