diff options
author | Patrick Simianer <simianer@cl.uni-heidelberg.de> | 2012-05-18 13:16:03 +0200 |
---|---|---|
committer | Patrick Simianer <simianer@cl.uni-heidelberg.de> | 2012-05-18 13:16:03 +0200 |
commit | 22d2f3ce5bd3fae2db9744eb66f7b8c3996265d6 (patch) | |
tree | 5cebab1bd3a0e77b108a19a786fe541cd7ce546c /creg/json_feature_map_lexer.ll | |
parent | 78a0ee61c2d2d846306b60a8ac862a2d649bcf59 (diff) | |
parent | a70d6d3ed83a32d3cdf4bcb36a087426a4ed2c31 (diff) |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'creg/json_feature_map_lexer.ll')
-rw-r--r-- | creg/json_feature_map_lexer.ll | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/creg/json_feature_map_lexer.ll b/creg/json_feature_map_lexer.ll index cbb6d9a9..f9ce7977 100644 --- a/creg/json_feature_map_lexer.ll +++ b/creg/json_feature_map_lexer.ll @@ -77,6 +77,11 @@ UNESCAPED_CH [^\"\\\b\n\r\f\t] <JSON>{WS}*{LCB}{WS}* { BEGIN(PREVAL); } +<JSON>{WS}*{LCB}{WS}*{RCB}\n* {const SparseVector<float> x; + json_fmap_callback(instid, x, json_fmap_callback_extra); + curfeat = 0; + BEGIN(INITIAL);} + <PREVAL>\" { BEGIN(STRING); spos=0; } <STRING>\" { featname[spos] = 0; @@ -92,7 +97,8 @@ UNESCAPED_CH [^\"\\\b\n\r\f\t] <STRING>\\n { } <STRING>\\r { } <STRING>\\t { } -<STRING>\\u{HEX_D}{HEX_D}{HEX_D}{HEX_D} { abort(); +<STRING>\\u{HEX_D}{HEX_D}{HEX_D}{HEX_D} { uint16_t hex = strtol(&yytext[2], NULL, 16); + spos += unicode_escape_to_utf8(hex, 0, &featname[spos++])-1; } <JSONVAL>{WS}*:{WS}* { BEGIN(DOUBLE); } @@ -129,4 +135,3 @@ int main() { JSONFeatureMapLexer::ReadRules(&std::cin, cb, NULL); } #endif - |