nitx: do not call `perform` on nitx special commands
authorAlexandre Terrasa <alexandre@moz-code.org>
Sat, 30 May 2015 00:01:37 +0000 (20:01 -0400)
committerAlexandre Terrasa <alexandre@moz-code.org>
Sat, 30 May 2015 00:28:14 +0000 (20:28 -0400)
Fixes #1420

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

src/doc/doc_phases/doc_console.nit

index 4c0c193..17cd4b1 100644 (file)
@@ -80,19 +80,14 @@ class Nitx
 
        # Processes the query string and performs it.
        fun do_query(str: String) do
-               var query = parse_query(str)
-               var res = query.perform(self, doc)
-               var page = query.make_results(self, res)
-               print page.write_to_string
-       end
-
-       # Returns an `NitxQuery` from a raw query string.
-       fun parse_query(str: String): NitxQuery do
                var query = new NitxQuery(str)
                if query isa NitxCommand then
                        query.execute(self)
+                       return
                end
-               return query
+               var res = query.perform(self, doc)
+               var page = query.make_results(self, res)
+               print page.write_to_string
        end
 end