]> git.phdru.name Git - phdru.name/cgi-bin/blog-ru/search-tags.git/commitdiff
Version 0.5: Use parsimonious instead of grako parsimonious v0.5
authorOleg Broytman <phd@phdru.name>
Fri, 21 Apr 2017 22:18:08 +0000 (01:18 +0300)
committerOleg Broytman <phd@phdru.name>
Fri, 21 Apr 2017 22:45:41 +0000 (01:45 +0300)
ChangeLog
README
TODO
search-tags.py
version

index 215055ba0adacc3c78fc4b3df02b294a20b41343..838760876f367a8bcc1faf375e252a7455e9217f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+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.
diff --git a/README b/README
index b8b749cb3ca4ba21b9aa6e6bc24895906016446e..e5cfe832795f3d57a9e53a9810190bc60001ee69 100644 (file)
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
 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.
diff --git a/TODO b/TODO
index 0b14ced3796b52c067c0aa57e30882ec470110a9..c77d12f711c5a9469878676a04b2955b63bb5b7e 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,4 +1,7 @@
-Use parsimonious or parsley instead of grako.
+Use parsley instead of parsimonious.
+
+
+Use lark instead of parsley.
 
 
 Sort posts by date or tags.
index 33d141f33107c9f7fcdcc1728f4f160ba74d106d..c0919660befab6331cff2de6532e3b0b5c01b642 100755 (executable)
@@ -3,13 +3,13 @@
 """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'):
@@ -20,11 +20,8 @@ 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!"
diff --git a/version b/version
index bd73f47072b1fe4b9914ec14a7f6d47fcc8f816a..2eb3c4fe4eebcdea3da0790cc0ba74cb286ec4f4 100644 (file)
--- a/version
+++ b/version
@@ -1 +1 @@
-0.4
+0.5