Skip to content

Commit c5c10ce

Browse files
authored
Merge pull request #144 from jendrikw/remove-latex-quoting
remove latex-style quoting
2 parents 1594849 + a6b2b39 commit c5c10ce

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

shared/src/main/scala/scala/util/parsing/combinator/JavaTokenParsers.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ trait JavaTokenParsers extends RegexParsers {
2828
*/
2929
def ident: Parser[String] = (
3030
"" ~> // handle whitespace
31-
rep1(acceptIf(Character.isJavaIdentifierStart)("identifier expected but `" + _ + "' found"),
31+
rep1(acceptIf(Character.isJavaIdentifierStart)("identifier expected but '" + _ + "' found"),
3232
elem("identifier part", Character.isJavaIdentifierPart(_: Char))) ^^ (_.mkString)
3333
)
3434

shared/src/main/scala/scala/util/parsing/combinator/RegexParsers.scala

+4-4
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ trait RegexParsers extends Parsers {
9494
if (i == s.length)
9595
Success(source.subSequence(start, j).toString, in.drop(j - offset))
9696
else {
97-
val found = if (start == source.length()) "end of source" else "`"+source.charAt(start)+"'"
98-
Failure("`"+s+"' expected but "+found+" found", in.drop(start - offset))
97+
val found = if (start == source.length()) "end of source" else "'"+source.charAt(start)+"'"
98+
Failure("'"+s+"' expected but "+found+" found", in.drop(start - offset))
9999
}
100100
}
101101
}
@@ -111,8 +111,8 @@ trait RegexParsers extends Parsers {
111111
Success(source.subSequence(start, start + matched.end).toString,
112112
in.drop(start + matched.end - offset))
113113
case None =>
114-
val found = if (start == source.length()) "end of source" else "`"+source.charAt(start)+"'"
115-
Failure("string matching regex `"+r+"' expected but "+found+" found", in.drop(start - offset))
114+
val found = if (start == source.length()) "end of source" else "'"+source.charAt(start)+"'"
115+
Failure("string matching regex '"+r+"' expected but "+found+" found", in.drop(start - offset))
116116
}
117117
}
118118
}

shared/src/main/scala/scala/util/parsing/combinator/token/StdTokens.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ package token
1919
trait StdTokens extends Tokens {
2020
/** The class of keyword tokens */
2121
case class Keyword(chars: String) extends Token {
22-
override def toString = "`"+chars+"'"
22+
override def toString = "'"+chars+"'"
2323
}
2424

2525
/** The class of numeric literal tokens */

shared/src/test/scala/scala/util/parsing/combinator/JavaTokenParsersTest.scala

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class JavaTokenParsersTest {
1616
assertEquals(".1", decimalNumber(new CharArrayReader(".1".toCharArray)).get)
1717
// should fail to parse and we should get Failure as ParseResult
1818
val failure = decimalNumber(new CharArrayReader("!1".toCharArray)).asInstanceOf[Failure]
19-
assertEquals("""string matching regex `(\d+(\.\d*)?|\d*\.\d+)' expected but `!' found""", failure.msg)
19+
assertEquals("""string matching regex '(\d+(\.\d*)?|\d*\.\d+)' expected but '!' found""", failure.msg)
2020
}
2121

2222
@Test
@@ -73,7 +73,7 @@ class JavaTokenParsersTest {
7373
parseResult1 match {
7474
case e @ Failure(message, next) =>
7575
assertEquals(next.pos.column, 7)
76-
assert(message.endsWith("string matching regex `(?i)AND' expected but `s' found"))
76+
assert(message.endsWith("string matching regex '(?i)AND' expected but 's' found"))
7777
case _ => sys.error(parseResult1.toString)
7878
}
7979

@@ -97,7 +97,7 @@ class JavaTokenParsersTest {
9797
case Failure(message, next) =>
9898
assertEquals(next.pos.line, 1)
9999
assertEquals(next.pos.column, 1)
100-
assert(message.endsWith(s"identifier expected but `-' found"))
100+
assert(message.endsWith(s"identifier expected but '-' found"))
101101
case _ => sys.error(parseResult.toString)
102102
}
103103

shared/src/test/scala/scala/util/parsing/combinator/PackratParsersTest.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class PackratParsersTest {
122122
val failure = parseResult.asInstanceOf[Failure]
123123
assertEquals(expectedFailureMsg, failure.msg)
124124
}
125-
assertFailure("'`b'' expected but `c' found", "a a a a b b b c c c c")
125+
assertFailure("''b'' expected but 'c' found", "a a a a b b b c c c c")
126126
assertFailure("end of input", "a a a a b b b b c c c")
127127
}
128128

shared/src/test/scala/scala/util/parsing/combinator/RegexParsersTest.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ class RegexParsersTest {
2525
}
2626

2727
val failure1 = parseAll(p, "-x").asInstanceOf[Failure]
28-
assertEquals("string matching regex `\\d+' expected but `x' found", failure1.msg)
28+
assertEquals("string matching regex '\\d+' expected but 'x' found", failure1.msg)
2929
val failure2 = parseAll(p, "x").asInstanceOf[Failure]
30-
assertEquals("string matching regex `\\d+' expected but `x' found", failure2.msg)
30+
assertEquals("string matching regex '\\d+' expected but 'x' found", failure2.msg)
3131
assertEquals(result(-5), extractResult(parseAll(p, "-5")))
3232
assertEquals(result(5), extractResult(parseAll(p, "5")))
3333
val error1 = parseAll(q, "-x").asInstanceOf[Error]

0 commit comments

Comments
 (0)