merge: merge the git merge head into hg tip, with anothera hg merge. merge. merge. merge. merge. meeeerrrrgeeee.
--- a/hedgewars/uChat.pas Mon May 04 23:52:56 2015 +0200
+++ b/hedgewars/uChat.pas Tue May 05 12:48:25 2015 +0200
@@ -594,26 +594,19 @@
procedure MoveCursorToPreviousChar();
begin
if cursorPos > 0 then
- begin
- while (not IsFirstCharByte(InputStr.s[cursorPos])) do
- begin
+ repeat
dec(cursorPos);
- end;
- dec(cursorPos);
- end;
+ until ((cursorPos = 0) or IsFirstCharByte(InputStr.s[cursorPos + 1]));
end;
procedure MoveCursorToNextChar();
+var len: integer;
begin
- if cursorPos < Length(InputStr.s) then
- begin
- inc(cursorPos, 2);
- while (cursorPos < Length(InputStr.s)) and (not IsFirstCharByte(InputStr.s[cursorPos])) do
- begin
+ len:= Length(InputStr.s);
+ if cursorPos < len then
+ repeat
inc(cursorPos);
- end;
- dec(cursorPos);
- end;
+ until ((cursorPos = len) or IsFirstCharByte(InputStr.s[cursorPos + 1]));
end;
procedure DeleteLastUTF8CharFromStr(var s: shortstring);
--- a/tools/pas2c/PascalParser.hs Mon May 04 23:52:56 2015 +0200
+++ b/tools/pas2c/PascalParser.hs Tue May 05 12:48:25 2015 +0200
@@ -48,7 +48,7 @@
reference :: Parsec String u Reference
-reference = buildExpressionParser table term <?> "reference"
+reference = term <?> "reference"
where
term = comments >> choice [
parens pas (liftM RefExpression expression >>= postfixes) >>= postfixes
@@ -57,9 +57,6 @@
, liftM SimpleReference iD >>= postfixes
] <?> "simple reference"
- table = [
- ]
-
postfixes r = many postfix >>= return . foldl (flip ($)) r
postfix = choice [
parens pas (option [] parameters) >>= return . FunCall
@@ -401,7 +398,7 @@
where
term = comments >> choice [
builtInFunction expression >>= \(n, e) -> return $ BuiltInFunCall e (SimpleReference (Identifier n BTUnknown))
- , try (parens pas $ expression >>= \e -> notFollowedBy (comments >> char' '.') >> return e)
+ , try (parens pas expression >>= \e -> notFollowedBy (comments >> char' '.') >> return e)
, brackets pas (commaSep pas iD) >>= return . SetExpression
, try $ integer pas >>= \i -> notFollowedBy (char' '.') >> (return . NumberLiteral . show) i
, float pas >>= return . FloatLiteral . show