+Version 0.5 (2017-04-??)
+
+ Use parsimonious instead of grako.
+
Version 0.4 (2016-07-11)
Use grako instead of PLY to compile EBNF to Python.
Search for tags in my blog.
Author: Oleg Broytman <phd@phdru.name>
-Copyright (C) 2014-2016 PhiloSoft Design.
+Copyright (C) 2014-2017 PhiloSoft Design.
License: GPL.
-Use parsimonious or parsley instead of grako.
+Use parsley instead of parsimonious.
+
+
+Use lark instead of parsley.
Sort posts by date or tags.
"""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!"