From 9fa689eaf2c04f4fb0ca3b61febb52df458bced2 Mon Sep 17 00:00:00 2001 From: Anton Tarasenko Date: Sun, 26 Jul 2020 21:17:39 +0700 Subject: [PATCH] Fix `Parser.Skip()` skipping non-whitespaces --- sources/Text/Parser.uc | 7 ++++--- sources/Text/Tests/TEST_Parser.uc | Bin 118744 -> 119062 bytes 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sources/Text/Parser.uc b/sources/Text/Parser.uc index ebc87f5..8080415 100644 --- a/sources/Text/Parser.uc +++ b/sources/Text/Parser.uc @@ -444,7 +444,9 @@ public final function Parser Skip(optional out int whitespacesAmount) { whitespacesAmount += 1; } - ShiftPointer(whitespacesAmount); + if (whitespacesAmount > 0) { + ShiftPointer(whitespacesAmount); + } return self; } @@ -610,8 +612,7 @@ public final function Parser MUnsignedInteger * Any passed value is discarded. * @return Returns the calling object, to allow for function chaining. */ -public final function Parser MEscapedSequence -( +public final function Parser MEscapedSequence( out Text.Character denotedCharacter ) { diff --git a/sources/Text/Tests/TEST_Parser.uc b/sources/Text/Tests/TEST_Parser.uc index d460a7a4359e6825d768dbb7c7b87f894749e3c9..85f64a86711e08c6ca81222e170eea115f672eed 100644 GIT binary patch delta 203 zcmcaHpMBaQ_6@OP# zq9dut5DZnN!Jx^2#G5?fp7dmUNsh_?=L&Gb)oeDHEWUm6c{#S}hMtT{lS>oDrr!@| zbYWDQq$0}cz@WgO1hg@4vcr4h>F2c>HMZM&GZyho{{Ka4`hGq}A&^?1$&4x@tYD?n i7icp|Pyg@5XgA%`n=xqn_Xx%ptc(@gAH*^KC;$M8@IQM1 delta 135 zcmbQXi2cTV_6@O1|XVd(TOA4Yq|((PJNjGtMji-$29ZTC-L HJYE0*okcF&