"""Search tags CGI"""
__author__ = "Oleg Broytman <phd@phdru.name>"
-__copyright__ = "Copyright (C) 2014-2016 PhiloSoft Design"
+__copyright__ = "Copyright (C) 2014-2017 PhiloSoft Design"
__license__ = "GNU GPL"
import cgi, sys
-from grako.exceptions import FailedParse
-
+from parsimonious import ParseError
from html.response import redirect, response
+from parser import parser
form = cgi.FieldStorage()
if not form.has_key('q'):
else:
q = form['q'].value
try:
- from parser.parser import TagsParser
- from parser.build_ast import TagsSemantics
- parser = TagsParser(parseinfo=False)
- tree = parser.parse(q, semantics=TagsSemantics())
- except FailedParse:
+ tree = parser.compile(q)
+ except ParseError:
status = "400 Bad request"
title = "Error!"
body = "Bad query syntax!"