aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYakov Goldberg <yakov.g@samsung.com>2013-10-29 15:54:38 +0200
committerYakov Goldberg <yakov.g@samsung.com>2013-10-29 15:54:38 +0200
commit600e5acd935511fcacd3dbecbf8ed2259eff3b5e (patch)
treeb0c5bcc7fbb7df9f467b3fde97a6c4ff57909dbe
parentadd search of reloaded funcs (diff)
downloadeo_bindings-600e5acd935511fcacd3dbecbf8ed2259eff3b5e.tar.gz
fix regex to match multiple quoted lines with quotes inside
-rw-r--r--eoparser/cparser.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/eoparser/cparser.py b/eoparser/cparser.py
index b7701be..7231f37 100644
--- a/eoparser/cparser.py
+++ b/eoparser/cparser.py
@@ -212,7 +212,12 @@ class Cparser(object):
for tup in all_op_descs:
s_tmp = tup[1]
# fetching op_ids and descriptions
- reg = "EO_OP_DESCRIPTION[^\)]*\([ ]*([A-Z0-9_]*)[ ]*,[ ]*\"([^\"]*)\"[ ]*\),"
+ # this awful RegEx is for catching comment like this:
+ # "This is comment \" with escaped quotes \" in the middle "
+ # " and next line which should be combined with C preprocessor "
+ reg = "EO_OP_DESCRIPTION[^\)]*\([ ]*([A-Z0-9_]*)[ ]*,([ ]*\"([^\"]*((?<=\\\)\")*)*\"[ ]*[\n]*)+\),"
+ # reg = "EO_OP_DESCRIPTION[^\)]*\([ ]*([A-Z0-9_]*)[ ]*,([ ]*\"([^\"]*)\"[ ]*[\n]*)+\),"
+ # reg = "EO_OP_DESCRIPTION[^\)]*\([ ]*([A-Z0-9_]*)[ ]*,[ ]*\"([^\"]*)\"[ ]*\),"
ids_and_descs = re.findall(reg, s_tmp)
op_list = []
@@ -427,7 +432,6 @@ class Cparser(object):
break;
break;
-
# resolving parameters's types and names according to
# #define, @def and op_ids