aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Parborg <darkdefende@gmail.com>2011-06-17 19:55:50 +0200
committerSebastian Parborg <darkdefende@gmail.com>2011-06-17 19:55:50 +0200
commit9765e7d7b17f6a378a4a1b93a78dc1e542b38c62 (patch)
tree88527fb0e9a79ccdb096eeaccb089912e5892e3e
parentDone with some work on the command parser (diff)
downloadebuildgen-9765e7d7b17f6a378a4a1b93a78dc1e542b38c62.tar.gz
ebuildgen-9765e7d7b17f6a378a4a1b93a78dc1e542b38c62.tar.bz2
ebuildgen-9765e7d7b17f6a378a4a1b93a78dc1e542b38c62.zip
added support for "{}" chars a command characters
-rw-r--r--filetypes/makefilecom.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/filetypes/makefilecom.py b/filetypes/makefilecom.py
index 3a037e3..99b8180 100644
--- a/filetypes/makefilecom.py
+++ b/filetypes/makefilecom.py
@@ -55,11 +55,11 @@ def com_interp(string,variables):
r"[^\$\(\{\)\}]"
def t_BEGINCOM(t):
- r"\("
+ r"(\(|\{)"
return t
def t_ENDCOM(t):
- r"\)"
+ r"(\)|\})"
return t
def t_PERCENT(t):
@@ -79,7 +79,7 @@ def com_interp(string,variables):
return t
def t_TEXT(t):
- r"[^ \n\t:=\)\\\$,]+"
+ r"[^ \n\t:=\)\}\\\$,]+"
return t
def t_SPACE(t):
@@ -203,10 +203,6 @@ def com_interp(string,variables):
p[0] = p[1] + com_interp(p[2],variables)[0]
else:
p[0] = com_interp(p[1],variables)[0]
- #if len(com) == 1:
- # p[0] = com_interp(com[0],variables)
- #else:
- # p[0] = expand(com,variables)
def p_textstr(p):
"""
@@ -240,4 +236,4 @@ def com_interp(string,variables):
return retlst
-print(com_interp("($(x)z:%=%.$(y))",{"x":["y"], "y":["z"], "yz":["u","v"]}))
+print(com_interp("($(${x}))",{"x":["y"], "y":["z"], "z":["u"],"yz":["u","v"]}))