"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/config/config_lexer.ll" between
icinga2-2.11.5.tar.gz and icinga2-2.12.0.tar.gz

About: Icinga 2 is an enterprise grade monitoring system which keeps watch over networks and any conceivable network resource.

config_lexer.ll  (icinga2-2.11.5):config_lexer.ll  (icinga2-2.12.0)
%{ %{
/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */ /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
#include "config/configcompiler.hpp" #include "config/configcompiler.hpp"
#include "config/expression.hpp" #include "config/expression.hpp"
#include "base/exception.hpp" #include "base/exception.hpp"
#include <utility>
using namespace icinga; using namespace icinga;
#include "config/config_parser.hh" #include "config/config_parser.hh"
#include <sstream> #include <sstream>
#define YYLTYPE icinga::CompilerDebugInfo #define YYLTYPE icinga::CompilerDebugInfo
#define YY_EXTRA_TYPE ConfigCompiler * #define YY_EXTRA_TYPE ConfigCompiler *
#define YY_USER_ACTION \ #define YY_USER_ACTION \
skipping to change at line 43 skipping to change at line 44
%option bison-bridge bison-locations %option bison-bridge bison-locations
%option never-interactive nounistd %option never-interactive nounistd
%option noinput nounput %option noinput nounput
%x C_COMMENT %x C_COMMENT
%x STRING %x STRING
%x HEREDOC %x HEREDOC
%% %%
\" { \" {
yyextra->m_LexBuffer.str(""); yyextra->m_LexBuffer.Clear();
yyextra->m_LexBuffer.clear();
yyextra->m_LocationBegin = *yylloc; yyextra->m_LocationBegin = *yylloc;
BEGIN(STRING); BEGIN(STRING);
} }
<STRING>\" { <STRING>\" {
BEGIN(INITIAL); BEGIN(INITIAL);
yylloc->FirstLine = yyextra->m_LocationBegin.FirstLine; yylloc->FirstLine = yyextra->m_LocationBegin.FirstLine;
yylloc->FirstColumn = yyextra->m_LocationBegin.FirstColumn; yylloc->FirstColumn = yyextra->m_LocationBegin.FirstColumn;
yylval->text = new String(yyextra->m_LexBuffer.str()); yylval->text = new String(std::move(yyextra->m_LexBuffer));
return T_STRING; return T_STRING;
} }
<STRING>\n { <STRING>\n {
BOOST_THROW_EXCEPTION(ScriptError("Unterminated string literal", DebugInf oRange(yyextra->m_LocationBegin, *yylloc))); BOOST_THROW_EXCEPTION(ScriptError("Unterminated string literal", DebugInf oRange(yyextra->m_LocationBegin, *yylloc)));
} }
<STRING>\\[0-7]{1,3} { <STRING>\\[0-7]{1,3} {
/* octal escape sequence */ /* octal escape sequence */
int result; int result;
(void) sscanf(yytext + 1, "%o", &result); (void) sscanf(yytext + 1, "%o", &result);
if (result > 0xff) { if (result > 0xff) {
/* error, constant is out-of-bounds */ /* error, constant is out-of-bounds */
BOOST_THROW_EXCEPTION(ScriptError("Constant is out of bounds: " + String(yytext), *yylloc)); BOOST_THROW_EXCEPTION(ScriptError("Constant is out of bounds: " + String(yytext), *yylloc));
} }
yyextra->m_LexBuffer << static_cast<char>(result); yyextra->m_LexBuffer += static_cast<char>(result);
} }
<STRING>\\[0-9]+ { <STRING>\\[0-9]+ {
/* generate error - bad escape sequence; something /* generate error - bad escape sequence; something
* like '\48' or '\0777777' * like '\48' or '\0777777'
*/ */
BOOST_THROW_EXCEPTION(ScriptError("Bad escape sequence found: " + String( yytext), *yylloc)); BOOST_THROW_EXCEPTION(ScriptError("Bad escape sequence found: " + String( yytext), *yylloc));
} }
<STRING>\\n { yyextra->m_LexBuffer << "\n"; } <STRING>\\n { yyextra->m_LexBuffer += '\n'; }
<STRING>\\\\ { yyextra->m_LexBuffer << "\\"; } <STRING>\\\\ { yyextra->m_LexBuffer += '\\'; }
<STRING>\\\" { yyextra->m_LexBuffer << "\""; } <STRING>\\\" { yyextra->m_LexBuffer += '"'; }
<STRING>\\t { yyextra->m_LexBuffer << "\t"; } <STRING>\\t { yyextra->m_LexBuffer += '\t'; }
<STRING>\\r { yyextra->m_LexBuffer << "\r"; } <STRING>\\r { yyextra->m_LexBuffer += '\r'; }
<STRING>\\b { yyextra->m_LexBuffer << "\b"; } <STRING>\\b { yyextra->m_LexBuffer += '\b'; }
<STRING>\\f { yyextra->m_LexBuffer << "\f"; } <STRING>\\f { yyextra->m_LexBuffer += '\f'; }
<STRING>\\\n { yyextra->m_LexBuffer << yytext[1]; } <STRING>\\\n { yyextra->m_LexBuffer += yytext[1]; }
<STRING>\\. { <STRING>\\. {
BOOST_THROW_EXCEPTION(ScriptError("Bad escape sequence found: " + String( yytext), *yylloc)); BOOST_THROW_EXCEPTION(ScriptError("Bad escape sequence found: " + String( yytext), *yylloc));
} }
<STRING>[^\\\n\"]+ { <STRING>[^\\\n\"]+ {
char *yptr = yytext; char *yptr = yytext;
while (*yptr) while (*yptr)
yyextra->m_LexBuffer << *yptr++; yyextra->m_LexBuffer += *yptr++;
} }
<STRING><<EOF>> { <STRING><<EOF>> {
BOOST_THROW_EXCEPTION(ScriptError("End-of-file while in string literal", DebugInfoRange(yyextra->m_LocationBegin, *yylloc))); BOOST_THROW_EXCEPTION(ScriptError("End-of-file while in string literal", DebugInfoRange(yyextra->m_LocationBegin, *yylloc)));
} }
\{\{\{ { \{\{\{ {
yyextra->m_LexBuffer.str(""); yyextra->m_LexBuffer.Clear();
yyextra->m_LexBuffer.clear();
yyextra->m_LocationBegin = *yylloc; yyextra->m_LocationBegin = *yylloc;
BEGIN(HEREDOC); BEGIN(HEREDOC);
} }
<HEREDOC><<EOF>> {
BOOST_THROW_EXCEPTION(ScriptError("End-of-file while in string literal",
DebugInfoRange(yyextra->m_LocationBegin, *yylloc)));
}
<HEREDOC>\}\}\} { <HEREDOC>\}\}\} {
BEGIN(INITIAL); BEGIN(INITIAL);
yylloc->FirstLine = yyextra->m_LocationBegin.FirstLine; yylloc->FirstLine = yyextra->m_LocationBegin.FirstLine;
yylloc->FirstColumn = yyextra->m_LocationBegin.FirstColumn; yylloc->FirstColumn = yyextra->m_LocationBegin.FirstColumn;
yylval->text = new String(yyextra->m_LexBuffer.str()); yylval->text = new String(std::move(yyextra->m_LexBuffer));
return T_STRING; return T_STRING;
} }
<HEREDOC>(.|\n) { yyextra->m_LexBuffer << yytext[0]; } <HEREDOC>(.|\n) { yyextra->m_LexBuffer += yytext[0]; }
<INITIAL>{ <INITIAL>{
"/*" BEGIN(C_COMMENT); "/*" BEGIN(C_COMMENT);
} }
<C_COMMENT>{ <C_COMMENT>{
"*/" BEGIN(INITIAL); "*/" BEGIN(INITIAL);
[^*] /* ignore comment */ [^*] /* ignore comment */
"*" /* ignore star */ "*" /* ignore star */
} }
 End of changes. 10 change blocks. 
17 lines changed or deleted 21 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)