| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright 2008 the V8 project authors. All rights reserved. | 3 # Copyright 2008 the V8 project authors. All rights reserved. |
| 4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
| 5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
| 6 # met: | 6 # met: |
| 7 # | 7 # |
| 8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
| 9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
| 10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
| (...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 879 right = ParseOperatorExpression(scan) | 879 right = ParseOperatorExpression(scan) |
| 880 if not right: | 880 if not right: |
| 881 return None | 881 return None |
| 882 left = Operation(left, op, right) | 882 left = Operation(left, op, right) |
| 883 return left | 883 return left |
| 884 | 884 |
| 885 | 885 |
| 886 def ParseConditionalExpression(scan): | 886 def ParseConditionalExpression(scan): |
| 887 left = ParseOperatorExpression(scan) | 887 left = ParseOperatorExpression(scan) |
| 888 if not left: return None | 888 if not left: return None |
| 889 while scan.HasMore() and (scan.Current() == 'IF'): | 889 while scan.HasMore() and (scan.Current() == 'if'): |
| 890 scan.Advance() | 890 scan.Advance() |
| 891 right = ParseOperatorExpression(scan) | 891 right = ParseOperatorExpression(scan) |
| 892 if not right: | 892 if not right: |
| 893 return None | 893 return None |
| 894 left= Operation(left, 'if', right) | 894 left= Operation(left, 'if', right) |
| 895 return left | 895 return left |
| 896 | 896 |
| 897 | 897 |
| 898 LOGICALS = ["&&", "||", ","] | 898 LOGICALS = ["&&", "||", ","] |
| 899 def ParseLogicalExpression(scan): | 899 def ParseLogicalExpression(scan): |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1298 for entry in timed_tests[:20]: | 1298 for entry in timed_tests[:20]: |
| 1299 t = FormatTime(entry.duration) | 1299 t = FormatTime(entry.duration) |
| 1300 sys.stderr.write("%4i (%s) %s\n" % (index, t, entry.GetLabel())) | 1300 sys.stderr.write("%4i (%s) %s\n" % (index, t, entry.GetLabel())) |
| 1301 index += 1 | 1301 index += 1 |
| 1302 | 1302 |
| 1303 return result | 1303 return result |
| 1304 | 1304 |
| 1305 | 1305 |
| 1306 if __name__ == '__main__': | 1306 if __name__ == '__main__': |
| 1307 sys.exit(Main()) | 1307 sys.exit(Main()) |
| OLD | NEW |