aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYakov Goldberg <yakov.g@samsung.com>2013-10-15 13:32:45 +0300
committerYakov Goldberg <yakov.g@samsung.com>2013-10-15 17:01:24 +0300
commit75be3cfbfb3d80ba47059730ab318014e5bcadd4 (patch)
tree64452b3d801e1894e9ae5ad828f6387c79072546
parentadd COMMENT for funcs and properties in xml and eo files (diff)
downloadeo_bindings-75be3cfbfb3d80ba47059730ab318014e5bcadd4.tar.gz
fix comma in the end of last param and in the list of inherited classes
-rw-r--r--eoparser/cparser.py34
1 files changed, 29 insertions, 5 deletions
diff --git a/eoparser/cparser.py b/eoparser/cparser.py
index aba83b2..fe2e911 100644
--- a/eoparser/cparser.py
+++ b/eoparser/cparser.py
@@ -751,8 +751,12 @@ class Cparser(object):
lines.append("inherit")
lines.append("%s%s"%(tab_level * tab, "{"))
tab_level += 1
+ param_num = len(parents)
for l in parents:
- lines.append("%s%s"%(tab_level * tab, l))
+ line = "%s%s"%(tab_level * tab, l)
+ line += "," if param_num > 1 else ";"
+ lines.append(line)
+ param_num -= 1
tab_level -= 1
lines.append("%s%s"%(tab_level * tab, "}"))
@@ -766,8 +770,13 @@ class Cparser(object):
lines.append("%s /* %s */"%(tab_level * tab, f[const.COMMENT]))
lines.append("%s%s("%(tab_level * tab, name))
tab_level += 1
+ param_num = len(f[const.PARAMETERS])
for (n, m ,t1, d, c) in f[const.PARAMETERS]:
- lines.append("%s%s %s /* %s */,"%(tab_level * tab, t1, n, c))
+ line = "%s%s %s /* %s */"%(tab_level * tab, t1, n, c)
+ if param_num > 1:
+ line += ","
+ lines.append(line)
+ param_num -=1
tab_level -= 1
lines.append("%s);"%(tab_level * tab))
tab_level -= 1
@@ -782,8 +791,13 @@ class Cparser(object):
lines.append("%s /* %s */"%(tab_level * tab, f[const.COMMENT]))
lines.append("%s%s("%(tab_level * tab, name))
tab_level += 1
+ param_num = len(f[const.PARAMETERS])
for (n, m ,t1, d, c) in f[const.PARAMETERS]:
- lines.append("%s%s %s /* %s */,"%(tab_level * tab, t1, n, c))
+ line = "%s%s %s /* %s */"%(tab_level * tab, t1, n, c)
+ if param_num > 1:
+ line += ","
+ lines.append(line)
+ param_num -=1
tab_level -= 1
lines.append("%s);"%(tab_level * tab))
tab_level -= 1
@@ -798,8 +812,13 @@ class Cparser(object):
lines.append("%s /* %s */"%(tab_level * tab, f[const.COMMENT]))
lines.append("%s%s("%(tab_level * tab, name))
tab_level += 1
+ param_num = len(f[const.PARAMETERS])
for (n, m ,t1, d, c) in f[const.PARAMETERS]:
- lines.append("%s%s %s /* %s */,"%(tab_level * tab, t1, n, c))
+ line = "%s%s %s /* %s */"%(tab_level * tab, t1, n, c)
+ if param_num > 1:
+ line += ","
+ lines.append(line)
+ param_num -=1
tab_level -= 1
lines.append("%s);"%(tab_level * tab))
tab_level -= 1
@@ -814,8 +833,13 @@ class Cparser(object):
lines.append("%s /* %s */"%(tab_level * tab, f[const.COMMENT]))
lines.append("%s%s("%(tab_level * tab, name))
tab_level += 1
+ param_num = len(f[const.PARAMETERS])
for (n, m ,t1, d, c) in f[const.PARAMETERS]:
- lines.append("%s%s %s %s /* %s */,"%(tab_level * tab, d, t1, n, c))
+ line = "%s%s %s %s /* %s */"%(tab_level * tab, d, t1, n, c)
+ if param_num > 1:
+ line += ","
+ lines.append(line)
+ param_num -=1
tab_level -= 1
lines.append("%s);"%(tab_level * tab))
tab_level -= 1