| OLD | NEW |
| 1 # Copyright (C) 2013 Google Inc. All rights reserved. | 1 # Copyright (C) 2013 Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 def __init__(self, idl_type, value): | 521 def __init__(self, idl_type, value): |
| 522 self.idl_type = idl_type | 522 self.idl_type = idl_type |
| 523 self.value = value | 523 self.value = value |
| 524 self.is_null = False | 524 self.is_null = False |
| 525 | 525 |
| 526 def __str__(self): | 526 def __str__(self): |
| 527 if self.idl_type == 'DOMString': | 527 if self.idl_type == 'DOMString': |
| 528 if self.value: | 528 if self.value: |
| 529 return '"%s"' % self.value | 529 return '"%s"' % self.value |
| 530 else: | 530 else: |
| 531 return 'WTF::emptyString' | 531 return 'WTF::g_empty_string' |
| 532 if self.idl_type == 'integer': | 532 if self.idl_type == 'integer': |
| 533 return '%d' % self.value | 533 return '%d' % self.value |
| 534 if self.idl_type == 'float': | 534 if self.idl_type == 'float': |
| 535 return '%g' % self.value | 535 return '%g' % self.value |
| 536 if self.idl_type == 'boolean': | 536 if self.idl_type == 'boolean': |
| 537 return 'true' if self.value else 'false' | 537 return 'true' if self.value else 'false' |
| 538 raise ValueError('Unsupported literal type: %s' % self.idl_type) | 538 raise ValueError('Unsupported literal type: %s' % self.idl_type) |
| 539 | 539 |
| 540 | 540 |
| 541 class IdlLiteralNull(IdlLiteral): | 541 class IdlLiteralNull(IdlLiteral): |
| (...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1141 self.visit_typed_object(argument) | 1141 self.visit_typed_object(argument) |
| 1142 | 1142 |
| 1143 def visit_iterable(self, iterable): | 1143 def visit_iterable(self, iterable): |
| 1144 self.visit_typed_object(iterable) | 1144 self.visit_typed_object(iterable) |
| 1145 | 1145 |
| 1146 def visit_maplike(self, maplike): | 1146 def visit_maplike(self, maplike): |
| 1147 self.visit_typed_object(maplike) | 1147 self.visit_typed_object(maplike) |
| 1148 | 1148 |
| 1149 def visit_setlike(self, setlike): | 1149 def visit_setlike(self, setlike): |
| 1150 self.visit_typed_object(setlike) | 1150 self.visit_typed_object(setlike) |
| OLD | NEW |