diff --git a/source/csml.l b/source/csml.l index b834de0..11012c5 100644 --- a/source/csml.l +++ b/source/csml.l @@ -24,8 +24,8 @@ void _ECHO_CANDIDATE(){ static const char COMMENT_START[] = ""; -static const char ATTRIBUTE_VALUE_START[] = "'"; -static const char ATTRIBUTE_VALUE_END[] = "'"; +const char DEFAULT_QUOTE = '\''; +char quote = DEFAULT_QUOTE; static unsigned short current_unicode_size; @@ -60,7 +60,6 @@ void pop_tag() { %x BODY HEAD HEAD_VALUE %x COMMENT COMMENT_MULTILINE %x IGNORE IGNORE_COUNT_START IGNORE_COUNT_END -%x STRING %s UNICODE ws [ \t\r\v\f] @@ -171,7 +170,7 @@ unicode [\300-\364] } :{wsnl}* { ECHOC('='); - ECHOS(ATTRIBUTE_VALUE_START); + ECHOC(quote); BEGIN HEAD_VALUE; } .|\n { @@ -181,11 +180,11 @@ unicode [\300-\364] { , { - ECHOS(ATTRIBUTE_VALUE_END); + ECHOC(quote); BEGIN HEAD; } \) { - ECHOS(ATTRIBUTE_VALUE_END); + ECHOC(quote); yyless(0); BEGIN HEAD; } diff --git a/source/main.cpp b/source/main.cpp index 0878179..c000647 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -22,8 +22,6 @@ extern std::stack tag_stack; DECLARE_LEXER(csml); DECLARE_LEXER(xml); -const char DEFAULT_QUOTE = '\''; -char quote = DEFAULT_QUOTE; char * output = NULL; char * input = NULL; const char * const csml_extension = ".csml"; diff --git a/source/scanner.hpp b/source/scanner.hpp index e2d7dc2..d89a53d 100644 --- a/source/scanner.hpp +++ b/source/scanner.hpp @@ -24,6 +24,7 @@ bool do_ignore(const std::string ¤t_tag) { extern int ignore_count; // number of '{' / '}'s to be placed around the current ignored block extern int ignore_i; // number of '}'s so far extern std::string buffer; +extern char quote; #define SCANNER_H #endif