diff options
author | Christophe Fergeau <cfergeau@redhat.com> | 2011-06-22 13:23:47 +0200 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@gmail.com> | 2012-03-20 15:31:30 +0100 |
commit | 0067c31bad1fadbfceba7014497374b9daf9a6a0 (patch) | |
tree | b42efd130c7d017ef8b842a01186e957695820f3 /python_modules/spice_parser.py | |
parent | d8975877c6e275961ee7d891c8dd2fc67d30305e (diff) | |
download | spice-protocol-0067c31bad1fadbfceba7014497374b9daf9a6a0.tar.gz spice-protocol-0067c31bad1fadbfceba7014497374b9daf9a6a0.tar.xz spice-protocol-0067c31bad1fadbfceba7014497374b9daf9a6a0.zip |
allow attributes on channel elements in .proto files
We want to be able to add an @ifdef annotation to optional messages
For example, we want to compile in the smartcard messages only if
libcacard is available
Diffstat (limited to 'python_modules/spice_parser.py')
-rw-r--r-- | python_modules/spice_parser.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/python_modules/spice_parser.py b/python_modules/spice_parser.py index d0aabb0..44456ab 100644 --- a/python_modules/spice_parser.py +++ b/python_modules/spice_parser.py @@ -124,7 +124,7 @@ def SPICE_BNF(): enumDef = Group(enum_ + identifier + enumBody + attributes - semi).setParseAction(lambda toks: ptypes.EnumType(toks[0][0], toks[0][1], toks[0][2], toks[0][3])) flagsDef = Group(flags_ + identifier + flagsBody + attributes - semi).setParseAction(lambda toks: ptypes.FlagsType(toks[0][0], toks[0][1], toks[0][2], toks[0][3])) messageDef = Group(message_ + identifier + messageBody + attributes - semi).setParseAction(lambda toks: ptypes.MessageType(toks[0][1], toks[0][2], toks[0][3])) - channelDef = Group(channel_ + identifier + channelBody - semi).setParseAction(lambda toks: ptypes.ChannelType(toks[0][1], toks[0][2], toks[0][3])) + channelDef = Group(channel_ + identifier + channelBody + attributes - semi).setParseAction(lambda toks: ptypes.ChannelType(toks[0][1], toks[0][2], toks[0][3], toks[0][4])) structDef = Group(struct_ + identifier + structBody + attributes - semi).setParseAction(lambda toks: ptypes.StructType(toks[0][1], toks[0][2], toks[0][3])) typedefDef = Group(typedef_ + identifier + typeSpec + attributes - semi).setParseAction(lambda toks: ptypes.TypeAlias(toks[0][1], toks[0][2], toks[0][3])) |