Permalink
Browse files

Merge pull request #200 from xuwei-k/single-quote

fix single quote literal
  • Loading branch information...
kiritsuku committed May 15, 2018
2 parents 1c91977 + 876bd9f commit f82bf3829cc4d36d282dc5bf65367a5ba4c2ddd4
@@ -46,9 +46,9 @@ trait SourceUtils {
def currentCharsAreMultilineCommentCommentStart = current2CharsAre('/', '*')
def currentCharsAreMultilineCommentCommentEnd = current2CharsAre('*', '/')
def currentCharIsRegularQuote = currentCharIs('"')
def currentCharsAreSingleQuotedSingleQuote = current3CharsAre(''', ''', ''')
def currentCharsAreEscapedSingleQuote = current2CharsAre('\\', ''')
def currentCharIsSingleQuote = currentCharIs(''')
def currentCharsAreSingleQuotedSingleQuote = current3CharsAre('\'', '\'', '\'')
def currentCharsAreEscapedSingleQuote = current2CharsAre('\\', '\'')
def currentCharIsSingleQuote = currentCharIs('\'')
def currentCharsAreEscapedRegularQuote = current2CharsAre('\\', '"')
def currentCharIsNewline = currentCharIs('\n')
def currentCharIsBackTick = currentCharIs('`')
@@ -605,7 +605,7 @@ object SourceWithMarker {
}
val delimiter = charOfClass { c =>
c == '`' || c == ''' || c == '"' || c == '.' || c == ';' || c == ','
c == '`' || c == '\'' || c == '"' || c == '.' || c == ';' || c == ','
}
val opChar = charOfClass { c =>
@@ -620,10 +620,10 @@ object SourceWithMarker {
}
val characterLiteral = {
val charEscape = character('b') | 't' | 'n' | 'f' | 'r' | '"' | ''' | '\\'
val charEscape = character('b') | 't' | 'n' | 'f' | 'r' | '"' | '\'' | '\\'
val octEscape = octalDigit ~ octalDigit.atMostNtimes(2)
''' ~ ((any.butNot('\\') | ('\\' ~ (charEscape | octEscape)))) ~ '''
'\'' ~ ((any.butNot('\\') | ('\\' ~ (charEscape | octEscape)))) ~ '\''
}
val stringLiteral = {
@@ -680,7 +680,7 @@ object SourceWithMarker {
val plainid = (upper ~ idrest) | varid | op
val symbolLiteral = ''' ~ plainid
val symbolLiteral = '\'' ~ plainid
val literalIdentifier = '`' ~ any.butNot('`').atLeastOnce ~ '`'

0 comments on commit f82bf38

Please sign in to comment.