Optional dot syntax for anchored keys (#423)
This commit is contained in:
parent
f95a27b412
commit
7e04eb51ff
6 changed files with 36 additions and 18 deletions
|
|
@ -12,10 +12,13 @@ some of its arguments is proved, it means that a valid Merkle proof of the
|
|||
value behind it exists and was used at some point to construct a `Contains`
|
||||
statement that introduced that anchored key.
|
||||
|
||||
In PODLang, anchored key indexing can use subscript syntax `foo["bar"]` which
|
||||
allows any string key, or dot syntax `foo.bar` if the key is a valid identifier.
|
||||
|
||||
For example:
|
||||
```
|
||||
0: None
|
||||
1: Contains(foo, bar, 42) <- ContainsFromEntries 0 0 0 mt_proof
|
||||
2: Lt(foo[bar], 100) <- LtFromEntries 1 0
|
||||
3: NotEqual(foo[bar], 100) <- LtToNotEqual 2
|
||||
1: Contains(foo, "bar", 42) <- ContainsFromEntries 0 0 0 mt_proof
|
||||
2: Lt(foo["bar"], 100) <- LtFromEntries 1 0
|
||||
3: NotEqual(foo.bar, 100) <- LtToNotEqual 2
|
||||
```
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ Equals(a, c)
|
|||
First, we need to decompose all the anchored keys as (dict, key) pairs. This is the frontend description of the deduction rule.
|
||||
```
|
||||
IF
|
||||
Equals(a_or[a_key], b_or[b_key)
|
||||
Equals(a_or[a_key], b_or[b_key])
|
||||
AND
|
||||
Equals(b_or[b_key], c_or[c_key])
|
||||
THEN
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue