From 08f590f73d9b4591d0912bda36b407a0f450606d Mon Sep 17 00:00:00 2001 From: ccremers Date: Wed, 16 Nov 2005 19:50:40 +0000 Subject: [PATCH] - More progress, enough for now. --- scripts/if2spdl/parser.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/if2spdl/parser.py b/scripts/if2spdl/parser.py index e2febea..a294fd1 100755 --- a/scripts/if2spdl/parser.py +++ b/scripts/if2spdl/parser.py @@ -45,9 +45,15 @@ def ifParse (str): Basic = MatchFirst([ Variable, Constant, Number ]) + # Message definition is recursive Message = Forward() def parseType(s,l,t): + if t[0][0] == "pk": + # Public key thing, that's not really a type for + # us but a function + return [Term.TermEncrypt(t[0][1], t[0][0]) ] + term = t[0][1] term.setType(t[0][0]) return [term] @@ -57,6 +63,9 @@ def ifParse (str): def parseCrypt(s,l,t): # Crypto types are ignored for now + type = t[0][0] + if type == "c": + return [Term.TermTuple( t[0][1],t[0][2] ) ] return [Term.TermEncrypt(t[0][2],t[0][1])] CryptOp = oneOf ("crypt scrypt c funct rcrypt tb")