diff --git a/src/Lexer.cpp b/src/Lexer.cpp index d8d52bbd4..a6435fe89 100644 --- a/src/Lexer.cpp +++ b/src/Lexer.cpp @@ -24,12 +24,14 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include #include #include #include +#include std::string Lexer::dateFormat = ""; @@ -175,7 +177,7 @@ bool Lexer::token (std::string& result, Type& type) shift (); } else - throw std::string ("Unexpected error 1"); + throw std::string (STRING_LEX_IMMEDIATE_UNK); break; case typeString: @@ -384,7 +386,7 @@ bool Lexer::token (std::string& result, Type& type) break; default: - throw std::string ("Unexpected error 2"); + throw std::string (STRING_LEX_TYPE_UNK); break; } @@ -511,7 +513,7 @@ bool Lexer::word (std::string& token, Type& type) break; default: - throw std::string ("Unexpected error 2"); + throw std::string (STRING_LEX_TYPE_UNK); break; } @@ -530,6 +532,7 @@ void Lexer::ambiguity (bool value) } //////////////////////////////////////////////////////////////////////////////// +// No L10N - these are for internal purposes. const std::string Lexer::type_name (const Type& type) { switch (type) diff --git a/src/eng-USA.h b/src/eng-USA.h index 972b0c08f..83b8989d0 100644 --- a/src/eng-USA.h +++ b/src/eng-USA.h @@ -175,6 +175,13 @@ #define STRING_VARIANT_SQRT_NEG "Cannot take the square root of a negative number." #define STRING_VARIANT_COERCE_UNK "Cannot coerce data either to or from an unknown type" +// Lexer +// +// These are errors generated at the lowest level of input analysis, +// at the character level. +#define STRING_LEX_IMMEDIATE_UNK "Lexer start failure, unknown characters found immediately." +#define STRING_LEX_TYPE_UNK "Lexer cannot process and unknown token type." + // A3 #define STRING_A3_OVERRIDE_PROBLEM "Problem with override: {1}" #define STRING_A3_MISMATCHED_PARENS "Mismatched parentheses in expression" diff --git a/src/esp-ESP.h b/src/esp-ESP.h index f57a84025..ecc8e33f2 100644 --- a/src/esp-ESP.h +++ b/src/esp-ESP.h @@ -175,6 +175,13 @@ #define STRING_VARIANT_SQRT_NEG "Cannot take the square root of a negative number." #define STRING_VARIANT_COERCE_UNK "Cannot coerce data either to or from an unknown type" +// Lexer +// +// These are errors generated at the lowest level of input analysis, +// at the character level. +#define STRING_LEX_IMMEDIATE_UNK "Lexer start failure, unknown characters found immediately." +#define STRING_LEX_TYPE_UNK "Lexer cannot process and unknown token type." + // A3 // Sobrescritura: de R.A.E. sobrescribir #define STRING_A3_OVERRIDE_PROBLEM "Problema con sobrescritura: {1}" diff --git a/src/fra-FRA.h b/src/fra-FRA.h index 8f0ddb61c..0bace277a 100644 --- a/src/fra-FRA.h +++ b/src/fra-FRA.h @@ -175,6 +175,13 @@ #define STRING_VARIANT_SQRT_NEG "Cannot take the square root of a negative number." #define STRING_VARIANT_COERCE_UNK "Cannot coerce data either to or from an unknown type" +// Lexer +// +// These are errors generated at the lowest level of input analysis, +// at the character level. +#define STRING_LEX_IMMEDIATE_UNK "Lexer start failure, unknown characters found immediately." +#define STRING_LEX_TYPE_UNK "Lexer cannot process and unknown token type." + // A3 #define STRING_A3_OVERRIDE_PROBLEM "Problème avec l'écrasement de {1}" #define STRING_A3_MISMATCHED_PARENS "Parenthèses incohérentes dans l'expression" diff --git a/src/ita-ITA.h b/src/ita-ITA.h index 179365945..9cd64e3fb 100644 --- a/src/ita-ITA.h +++ b/src/ita-ITA.h @@ -176,6 +176,13 @@ #define STRING_VARIANT_SQRT_NEG "Cannot take the square root of a negative number." #define STRING_VARIANT_COERCE_UNK "Cannot coerce data either to or from an unknown type" +// Lexer +// +// These are errors generated at the lowest level of input analysis, +// at the character level. +#define STRING_LEX_IMMEDIATE_UNK "Lexer start failure, unknown characters found immediately." +#define STRING_LEX_TYPE_UNK "Lexer cannot process and unknown token type." + // A3 #define STRING_A3_OVERRIDE_PROBLEM "Problema di modifica: {1}" #define STRING_A3_MISMATCHED_PARENS "Mancata corrispondenza nell'uso delle parentesi nell'espressione" diff --git a/src/por-PRT.h b/src/por-PRT.h index 005a1ffdf..51e47f0fc 100644 --- a/src/por-PRT.h +++ b/src/por-PRT.h @@ -175,6 +175,13 @@ #define STRING_VARIANT_SQRT_NEG "Cannot take the square root of a negative number." #define STRING_VARIANT_COERCE_UNK "Cannot coerce data either to or from an unknown type" +// Lexer +// +// These are errors generated at the lowest level of input analysis, +// at the character level. +#define STRING_LEX_IMMEDIATE_UNK "Lexer start failure, unknown characters found immediately." +#define STRING_LEX_TYPE_UNK "Lexer cannot process and unknown token type." + // A3 #define STRING_A3_OVERRIDE_PROBLEM "Problema com a alteração: {1}" #define STRING_A3_MISMATCHED_PARENS "Erro de não correspondência de parentesis na expressão"