diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a7db9bd..6300530a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ * Add support for marking properties as read-only, pr #470. * Added `dict.filter(..)` function, pr #471. +* Added `HID` as alias to `NO_IDS` return flag, pr #472. # v1.10.3 diff --git a/itest/test_statements.py b/itest/test_statements.py index ec285371..73f9db0a 100755 --- a/itest/test_statements.py +++ b/itest/test_statements.py @@ -288,6 +288,13 @@ async def test_return_flags(self, client): """) self.assertEqual(res, {'nested': {}}) + # pr #472 (alias HID flag) + res = await client.query("""//ti + .a = A(); + return .a, 2, HID; + """) + self.assertEqual(res, {'nested': {}}) + res = await client.query("""//ti return .a, 2, 1; """) @@ -304,6 +311,8 @@ async def test_return_flags(self, client): """) self.assertEqual(res, "|| return 'value',0,NO_IDS") + + async def test_format(self, client): res = await client.query("""//ti x = || { diff --git a/src/ti/flags.c b/src/ti/flags.c index fec4001f..3efd9fc7 100644 --- a/src/ti/flags.c +++ b/src/ti/flags.c @@ -16,6 +16,10 @@ int ti_flags_set_from_val(ti_val_t * val, uint8_t * flags, ex_t * e) return e->nr; } + /* pr #472 */ + if (VINT(val) & TI_TYPE_FLAG_HIDE_ID) + *flags |= TI_FLAGS_NO_IDS; + *flags |= VINT(val) & TI_FLAGS_NO_IDS; return 0; }