diff options
author | nyamatongwe <devnull@localhost> | 2012-06-13 09:08:35 +1000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2012-06-13 09:08:35 +1000 |
commit | 19e301e1ebe0669873659bad5200ca2367830dae (patch) | |
tree | c34c98f6d0cfb3866d523f05ef8d4bfdc43f02fc /include/Face.py | |
parent | 4c19b3254ea82ab497f9c42ca153b59cc288c2b1 (diff) | |
download | scintilla-mirror-19e301e1ebe0669873659bad5200ca2367830dae.tar.gz |
Detect too many parameters in function, display error and throw exception.
Diffstat (limited to 'include/Face.py')
-rw-r--r-- | include/Face.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/Face.py b/include/Face.py index 97b700dc5..855d6321a 100644 --- a/include/Face.py +++ b/include/Face.py @@ -12,7 +12,7 @@ def decodeFunction(featureVal): nameIdent, params = rest.split("(") name, value = nameIdent.split("=") params, rest = params.split(")") - param1, param2 = params.split(",")[0:2] + param1, param2 = params.split(",") return retType, name, value, param1, param2 def decodeEvent(featureVal): @@ -60,7 +60,11 @@ class Face: currentCommentFinished = 1 featureType, featureVal = line.split(" ", 1) if featureType in ["fun", "get", "set"]: - retType, name, value, param1, param2 = decodeFunction(featureVal) + try: + retType, name, value, param1, param2 = decodeFunction(featureVal) + except ValueError: + print("Failed to decode %s" % line) + raise p1 = decodeParam(param1) p2 = decodeParam(param2) self.features[name] = { |