You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pekko.apache.org by jr...@apache.org on 2022/11/03 11:23:36 UTC
[incubator-pekko-http] 06/47: parsing: port Akka HTTP changes of parboiled2 Parser changes
This is an automated email from the ASF dual-hosted git repository.
jrudolph pushed a commit to branch scala-3
in repository https://gitbox.apache.org/repos/asf/incubator-pekko-http.git
commit ad513a2ad55610584d3c3cdc4e05368da042ce6e
Author: Johannes Rudolph <jo...@gmail.com>
AuthorDate: Thu Sep 9 12:14:29 2021 +0200
parsing: port Akka HTTP changes of parboiled2 Parser changes
---
akka-parsing/src/main/scala/akka/parboiled2/Parser.scala | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/akka-parsing/src/main/scala/akka/parboiled2/Parser.scala b/akka-parsing/src/main/scala/akka/parboiled2/Parser.scala
index a5aaad32e..eee5cdfd0 100644
--- a/akka-parsing/src/main/scala/akka/parboiled2/Parser.scala
+++ b/akka-parsing/src/main/scala/akka/parboiled2/Parser.scala
@@ -108,10 +108,13 @@ abstract class Parser(initialValueStackSize: Int = 16, maxValueStackSize: Int =
// the current ErrorAnalysisPhase or null (in the initial run)
private var phase: ErrorAnalysisPhase = _
+ private var _maxLength = -1
+
def copyStateFrom(other: Parser, offset: Int): Unit = {
_cursorChar = other._cursorChar
_cursor = other._cursor - offset
_valueStack = other._valueStack
+ _maxLength = other._maxLength
phase = other.phase
if (phase ne null) phase.applyOffset(offset)
}
@@ -127,6 +130,7 @@ abstract class Parser(initialValueStackSize: Int = 16, maxValueStackSize: Int =
def __run[L <: HList](rule: => RuleN[L])(implicit scheme: Parser.DeliveryScheme[L]): scheme.Result = {
def runRule(): Boolean = {
_cursor = -1
+ _maxLength = input.length
__advance()
valueStack.clear()
try rule ne null
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pekko.apache.org
For additional commands, e-mail: commits-help@pekko.apache.org