summaryrefslogtreecommitdiff
path: root/lib/parse_lng.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/parse_lng.h')
-rw-r--r--lib/parse_lng.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/parse_lng.h b/lib/parse_lng.h
index 8cd8e943..be47b66b 100644
--- a/lib/parse_lng.h
+++ b/lib/parse_lng.h
@@ -294,7 +294,7 @@ private:
static void normalize(std::string& text)
{
- zen::trim(text); //remmove whitespace from end
+ zen::trim(text); //remove whitespace from both ends
//Delimiter:
//----------
@@ -378,8 +378,11 @@ private:
if (token().type == Token::TK_PLURAL_BEGIN)
return parsePlural(pluralOut, pluralInfo);
+ if (token().type != Token::TK_TEXT)
+ throw ParsingError(L"Source text empty", scn.posRow(), scn.posCol());
std::string original = tk.text;
- consumeToken(Token::TK_TEXT);
+ nextToken();
+
consumeToken(Token::TK_SRC_END);
consumeToken(Token::TK_TRG_BEGIN);
bgstack15