<!DOCTYPE html>
<html>
<head>
</head>
<body>
<dl style="line-height: 1.5; margin-left: 2em">
<dt style="clear: both; float: left; font-weight: bold; width: 8em">Author</dt>
<dd style="margin-left: 8.5em">Kouhei Sutou <kou****@clear*****></dd>
<dt style="clear: both; float: left; font-weight: bold; width: 8em">Date</dt>
<dd style="margin-left: 8.5em">2012-08-06 13:07:04 +0900 (Mon, 06 Aug 2012)</dd>
<dt style="clear: both; float: left; font-weight: bold; width: 8em">New Revision</dt>
<dd style="margin-left: 8.5em"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38">d6882185b7af2da7441c350d1f70918026a8bb38</a></dd>
<dt style="clear: both; float: left; font-weight: bold; width: 8em">Log</dt>
<dd style="margin-left: 8.5em"><pre style="border: 1px solid #aaa; font-family: Consolas, Menlo, "Liberation Mono", Courier, monospace; line-height: 1.2; padding: 0.5em">bq: throw exception for unknown group operator</pre></dd>
<dt style="clear: both; float: left; font-weight: bold; width: 8em">Modified files</dt>
<dd style="margin-left: 8.5em">
<ul>
<li><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#diff-0">lib/bq-translator.js</a></li>
<li><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#diff-1">test/bq-translator.test.js</a></li>
</ul>
</dd>
</dl>
<div class="diff-section" style="clear: both">
<table style="border-collapse: collapse; border: 1px solid #aaa">
<thead>
<tr class="diff-header" style="border: 1px solid #aaa">
<td colspan="3">
<pre style="border: 0; font-family: Consolas, Menlo, "Liberation Mono", Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal"><span class="diff-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre"> Modified: lib/bq-translator.js (+3 -2)</span>
<span class="diff-header-mark" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">===================================================================</span>
</pre>
</td>
</tr>
</thead>
<tbody>
<tr>
<th class="diff-line-number" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, "Liberation Mono", Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal"><span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L0L64">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L0L65">65</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L0L66">66</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L0L67">67</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L0L68">68</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L0L69">69</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L0L70">70</a></span>
<span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L0L80">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L0L81">81</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L0L82">82</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L0L83">83</a></span>
<span class="diff-line-number-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L0L84">84</a></span>
<span class="diff-line-number-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L0L85">85</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L0L86">86</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L0L87">87</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L0L88">88</a></span>
</pre>
</th>
<th class="diff-line-number" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, "Liberation Mono", Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal"><span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L0R64">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L0R65">65</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L0R66">66</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L0R67">67</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L0R68">68</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L0R69">69</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L0R70">70</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L0R71">71</a></span>
<span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L0R81">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L0R82">82</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L0R83">83</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L0R84">84</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L0R85">85</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L0R86">86</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L0R87">87</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L0R88">88</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L0R89">89</a></span>
</pre>
</th>
<td class="diff-content" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, "Liberation Mono", Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal"><span class="diff-hunk-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">@@ -65,6 +65,7 @@ <span class="diff-context" style="background-color: #ffffaa; color: #000000">BooleanQueryTranslator.prototype = {</span></span>
<span class="diff-not-changed" style="display: block; white-space: pre"> if (/^[a-z]$/.test(character)) {</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> operator += character;</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> } else if (character == " ") {</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+ var operatorEndOffset = this.offset;</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> this.skipSpaces();</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> var expression;</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> switch (operator) {</span>
<span class="diff-hunk-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">@@ -81,8 +82,8 @@ <span class="diff-context" style="background-color: #ffffaa; color: #000000">BooleanQueryTranslator.prototype = {</span></span>
<span class="diff-not-changed" style="display: block; white-space: pre"> expression = this.translateGroupSetOperation("||");</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> break;</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> default:</span>
<span class="diff-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre">- // TODO: report error: unknown operator</span>
<span class="diff-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre">- return "";</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+ this.offset = operatorEndOffset;</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+ this.throwTranslateError("unknown operator: <" + operator + ">");</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> break;</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> }</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> this.skipSpaces();</span>
</pre>
</td>
</tr>
</tbody>
</table>
<table style="border-collapse: collapse; border: 1px solid #aaa">
<thead>
<tr class="diff-header" style="border: 1px solid #aaa">
<td colspan="3">
<pre style="border: 0; font-family: Consolas, Menlo, "Liberation Mono", Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal"><span class="diff-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre"> Modified: test/bq-translator.test.js (+4 -0)</span>
<span class="diff-header-mark" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">===================================================================</span>
</pre>
</td>
</tr>
</thead>
<tbody>
<tr>
<th class="diff-line-number" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, "Liberation Mono", Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal"><span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L1L125">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L1L126">126</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L1L127">127</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L1L128">128</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L1L129">129</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L1L130">130</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L1L131">131</a></span>
</pre>
</th>
<th class="diff-line-number" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, "Liberation Mono", Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal"><span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L1R125">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L1R126">126</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L1R127">127</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L1R128">128</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L1R129">129</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L1R130">130</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L1R131">131</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L1R132">132</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L1R133">133</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L1R134">134</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/d6882185b7af2da7441c350d1f70918026a8bb38#L1R135">135</a></span>
</pre>
</th>
<td class="diff-content" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, "Liberation Mono", Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal"><span class="diff-hunk-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">@@ -126,6 +126,10 @@ <span class="diff-context" style="background-color: #ffffaa; color: #000000">suite('BoolanQueryTranslator', function() {</span></span>
<span class="diff-not-changed" style="display: block; white-space: pre"> "and f1:'k1' f2:'k2')",</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> "|a|nd f1:'k1' f2:'k2')",</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> "not started with <(>");</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+ testGroupError("unknown operator",</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+ "(nonexistent f1:'k1' f2:'k2')",</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+ "(nonexistent| |f1:'k1' f2:'k2')",</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+ "unknown operator: <nonexistent>");</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> </span>
<span class="diff-not-changed" style="display: block; white-space: pre"> testExpression("value only: stirng: and: space",</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> "'keyword1 keyword2' 'other keyword'",</span>
</pre>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>