null+****@clear*****
null+****@clear*****
2012年 7月 27日 (金) 18:06:28 JST
Kouhei Sutou 2012-07-27 18:06:28 +0900 (Fri, 27 Jul 2012) New Revision: 392eec5cfac491e05f80d0edd794563ebd335ced https://github.com/groonga/gcs/commit/392eec5cfac491e05f80d0edd794563ebd335ced Log: BqTranslator: change method order Modified files: lib/bq-translator.js Modified: lib/bq-translator.js (+35 -35) =================================================================== --- lib/bq-translator.js 2012-07-27 18:05:47 +0900 (69fbdff) +++ lib/bq-translator.js 2012-07-27 18:06:28 +0900 (5947794) @@ -207,41 +207,6 @@ BooleanQueryTranslator.prototype = { // TODO: report error return ""; }, - translateExpressionValuePhrase: function(query, field, context) { - if (!(query[context.offset] == "'" && query[context.offset + 1] == "\"")) { - // TODO: report error - return ""; - } - - context.offset += 2; - var value = ""; - for (; context.offset < query.length; context.offset++) { - var character = query[context.offset]; - if (character == "'") { - // TODO: report error: missing close quote <"> - return ""; - } - - if (character == "\\") { - context.offset++; - character = query[context.offset]; - value += character; - } else if (character == "\"") { - context.offset++; - if (query[context.offset] != "'") { - // TODO: report error: missing close quote <'> after <"> - return ""; - } - context.offset++; - return field + " @ " + "\"" + value + "\""; - } else { - value += character; - } - } - - // TODO: report error: missing close quote <"'> - return ""; - }, translateExpressionValueString: function(query, field, context) { if (query[context.offset] != "'") { // TODO: report error @@ -284,6 +249,41 @@ BooleanQueryTranslator.prototype = { // TODO: report error: missing close quote <'> return ""; }, + translateExpressionValuePhrase: function(query, field, context) { + if (!(query[context.offset] == "'" && query[context.offset + 1] == "\"")) { + // TODO: report error + return ""; + } + + context.offset += 2; + var value = ""; + for (; context.offset < query.length; context.offset++) { + var character = query[context.offset]; + if (character == "'") { + // TODO: report error: missing close quote <"> + return ""; + } + + if (character == "\\") { + context.offset++; + character = query[context.offset]; + value += character; + } else if (character == "\"") { + context.offset++; + if (query[context.offset] != "'") { + // TODO: report error: missing close quote <'> after <"> + return ""; + } + context.offset++; + return field + " @ " + "\"" + value + "\""; + } else { + value += character; + } + } + + // TODO: report error: missing close quote <"'> + return ""; + }, translateExpressionValueUnsignedInteger: function(query, field, context) { var value = ""; for (; context.offset < query.length; context.offset++) { -------------- next part -------------- HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B...Download