OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright (c) 2012 The Native Client Authors. All rights reserved. | 3 # Copyright (c) 2012 The Native Client Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 # | 6 # |
7 | 7 |
8 """ | 8 """ |
9 Some common boilerplates and helper functions for source code generation | 9 Some common boilerplates and helper functions for source code generation |
10 in files dgen_test_output.py and dgen_decode_output.py. | 10 in files dgen_test_output.py and dgen_decode_output.py. |
11 """ | 11 """ |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 """Returns true if the prefix is less than or equal to the | 77 """Returns true if the prefix is less than or equal to the |
78 corresponding prefix length of the decoder name.""" | 78 corresponding prefix length of the decoder name.""" |
79 decoder_name = name_fcn(decoder) | 79 decoder_name = name_fcn(decoder) |
80 prefix_len = len(prefix) | 80 prefix_len = len(prefix) |
81 decoder_len = len(decoder_name) | 81 decoder_len = len(decoder_name) |
82 decoder_prefix = (decoder_name[0:prefix_len] | 82 decoder_prefix = (decoder_name[0:prefix_len] |
83 if prefix_len < decoder_len | 83 if prefix_len < decoder_len |
84 else decoder_name) | 84 else decoder_name) |
85 return prefix <= decoder_prefix | 85 return prefix <= decoder_prefix |
86 | 86 |
OLD | NEW |