Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: mojo/public/bindings/pylib/parse/mojo_translate.py

Issue 221663004: mojo: add handle<shared_buffer> support to generator (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « mojo/public/bindings/pylib/parse/mojo_parser.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2013 The Chromium Authors. All rights reserved. 2 # Copyright 2013 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Translate parse tree to Mojom IR""" 6 """Translate parse tree to Mojom IR"""
7 7
8 8
9 import os 9 import os
10 import sys 10 import sys
(...skipping 13 matching lines...) Expand all
24 'uint8': 'u8', 24 'uint8': 'u8',
25 'uint16': 'u16', 25 'uint16': 'u16',
26 'uint32': 'u32', 26 'uint32': 'u32',
27 'uint64': 'u64', 27 'uint64': 'u64',
28 'float': 'f', 28 'float': 'f',
29 'double': 'd', 29 'double': 'd',
30 'string': 's', 30 'string': 's',
31 'handle': 'h', 31 'handle': 'h',
32 'handle<data_pipe_consumer>': 'h:d:c', 32 'handle<data_pipe_consumer>': 'h:d:c',
33 'handle<data_pipe_producer>': 'h:d:p', 33 'handle<data_pipe_producer>': 'h:d:p',
34 'handle<message_pipe>': 'h:m'} 34 'handle<message_pipe>': 'h:m',
35 'handle<shared_buffer>': 'h:s'}
35 if kind.endswith('[]'): 36 if kind.endswith('[]'):
36 return 'a:' + MapKind(kind[0:len(kind)-2]) 37 return 'a:' + MapKind(kind[0:len(kind)-2])
37 if kind in map_to_kind: 38 if kind in map_to_kind:
38 return map_to_kind[kind] 39 return map_to_kind[kind]
39 return 'x:' + kind 40 return 'x:' + kind
40 41
41 def MapOrdinal(ordinal): 42 def MapOrdinal(ordinal):
42 if ordinal == None: 43 if ordinal == None:
43 return None 44 return None
44 return int(ordinal[1:]) # Strip leading '@' 45 return int(ordinal[1:]) # Strip leading '@'
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 print("usage: %s filename" % (sys.argv[0])) 136 print("usage: %s filename" % (sys.argv[0]))
136 sys.exit(1) 137 sys.exit(1)
137 tree = eval(open(sys.argv[1]).read()) 138 tree = eval(open(sys.argv[1]).read())
138 name = os.path.splitext(os.path.basename(sys.argv[1]))[0] 139 name = os.path.splitext(os.path.basename(sys.argv[1]))[0]
139 result = Translate(tree, name) 140 result = Translate(tree, name)
140 print(result) 141 print(result)
141 142
142 143
143 if __name__ == '__main__': 144 if __name__ == '__main__':
144 Main() 145 Main()
OLDNEW
« no previous file with comments | « mojo/public/bindings/pylib/parse/mojo_parser.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698