Commit 489221aa authored by Hitoshi Yoshida's avatar Hitoshi Yoshida Committed by Commit Bot

IDL Compiler: Make empty dict value dict()

We used object() as a python value for empty dictionary literal "{}".
But it doesn't work with (current) make_copy() well.

This CL changes the value as dict() to work with make_copy() and
describe its actual type better.


Bug: 984949, 839389
Change-Id: I3f14319bae91ab3b7510636cca103ca25f6b6424
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1826067Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarKenichi Ishibashi <bashi@chromium.org>
Reviewed-by: default avatarYuki Shiino <yukishiino@chromium.org>
Commit-Queue: Hitoshi Yoshida <peria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#700121}
parent becaa513
...@@ -484,7 +484,7 @@ class _IRBuilder(object): ...@@ -484,7 +484,7 @@ class _IRBuilder(object):
idl_type = factory.simple_type( idl_type = factory.simple_type(
name='object', debug_info=debug_info) name='object', debug_info=debug_info)
assert value_token == '{}' assert value_token == '{}'
value = object() value = dict()
literal = '{}' literal = '{}'
else: else:
assert False, 'Unknown literal type: {}'.format(type_token) assert False, 'Unknown literal type: {}'.format(type_token)
......
...@@ -47,7 +47,7 @@ class LiteralConstant(object): ...@@ -47,7 +47,7 @@ class LiteralConstant(object):
The values of the following literals are represented as follows. The values of the following literals are represented as follows.
- null: None - null: None
- []: list() - []: list()
- {}: object() - {}: dict()
- true / false: True / False - true / false: True / False
- INTEGER_NUMERICS: an instance of long - INTEGER_NUMERICS: an instance of long
- FLOATING_POINTS: an instance of float - FLOATING_POINTS: an instance of float
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment