diff --git a/docs/reference/assignments.js b/docs/reference/assignments.js index f774df29..a56d16a0 100644 --- a/docs/reference/assignments.js +++ b/docs/reference/assignments.js @@ -52,7 +52,7 @@ export const assignments = { ], fails: [ { - keyword: '"NatAssign"', + keyword: '"NAT_NEG_ASSIGN"', desc:
when a (typed nat)is less than b (typed nat).
}, { diff --git a/docs/reference/declarations/entrypoint.md b/docs/reference/declarations/entrypoint.md index e70cc32b..b60bf1ab 100644 --- a/docs/reference/declarations/entrypoint.md +++ b/docs/reference/declarations/entrypoint.md @@ -31,7 +31,7 @@ The body of the transaction is made of the following *sections*: ### `from` -The `from` section, followed by a state value, specifies the required state of the contract to transition from. It fails with `"InvalidState"` if the transition is called while the contract is in another state. +The `from` section, followed by a state value, specifies the required state of the contract to transition from. It fails with `"INVALID_STATE"` if the transition is called while the contract is in another state. For example: ```archetype @@ -361,7 +361,7 @@ If the effect section is the only section in entry point body, the `effect` keyw ```archetype entry set_owner_candidate(oc : address) { - if caller = owner then fail("InvalidCaller"); + if caller = owner then fail("INVALID_CALLER"); owner_candidate := some(oc) } ``` diff --git a/docs/reference/expressions/operators/access.md b/docs/reference/expressions/operators/access.md index 7a329b54..baf886b1 100644 --- a/docs/reference/expressions/operators/access.md +++ b/docs/reference/expressions/operators/access.md @@ -21,7 +21,7 @@ const b = t[2]; /* 0xbc */ Accesses value associated with key `b` in [map](/docs/language-basics/container#map) `a` (also [`big_map`](/docs/reference/types#big_map) and [`iterable_big_map`](/docs/reference/types#iterable_big_map)). -It fails with `"NotFound"` if `b` is not found in `a`. +It fails with `"NOT_FOUND"` if `b` is not found in `a`. For example: ```archetype diff --git a/docs/reference/expressions/operators/operators.js b/docs/reference/expressions/operators/operators.js index 4ff4a917..e9a91b98 100644 --- a/docs/reference/expressions/operators/operators.js +++ b/docs/reference/expressions/operators/operators.js @@ -169,6 +169,7 @@ export const operators = { { typa: 'int', typb : 'int', typr: 'rational' }, { typa: 'duration', typb : 'duration', typr: 'rational' }, { typa: 'rational', typb : 'rational', typr: 'rational' }, + { typa: 'tez', typb : 'tez', typr: 'rational' }, ], promotions: [ { typa: 'nat', typb : 'int', typr: 'rational' }, diff --git a/src/components/desc/get_desc.md b/src/components/desc/get_desc.md index 232dc53c..0c8b2ca7 100644 --- a/src/components/desc/get_desc.md +++ b/src/components/desc/get_desc.md @@ -18,6 +18,6 @@ It is equivalent to: const h = match ledger.get(caller) with | some av -> av - | none -> fail(("ledger","AssetNotFound")) + | none -> fail(("ledger","ASSET_NOT_FOUND")) end ``` \ No newline at end of file diff --git a/src/components/desc/opt_get_desc.md b/src/components/desc/opt_get_desc.md index a209d6df..27cbc4c3 100644 --- a/src/components/desc/opt_get_desc.md +++ b/src/components/desc/opt_get_desc.md @@ -2,6 +2,6 @@ Extracts some value from optional value `o`. It is equivalent to the following e ```archetype match o with | some(v) -> v -| none -> fail("NotFound") +| none -> fail("NOT_FOUND") end ``` \ No newline at end of file diff --git a/src/theme/prism-archetype.js b/src/theme/prism-archetype.js index b2c70111..f21bc46f 100644 --- a/src/theme/prism-archetype.js +++ b/src/theme/prism-archetype.js @@ -47,7 +47,7 @@ 'verif': /\b(?:invariant|specification)\b/, 'type': /\b(?:lambda|contract|big_map|map|set|option|list|int|nat|tez|string|rational|bytes|key|key_hash|address|sapling|signature|date|duration|bool|operation|aggregate|partition|asset_view|asset_key|asset_value|iterable_big_map)\b/, 'constant': /\b(?:now|balance|transferred|self|caller|source|self_address|state|operations)\b/, - 'control': /\b(?:assert|iter|begin|end|do|done|else|return|before|for|if|in|match|in|forall|added|removed|exists|then|the|from|to|while|with|InvalidCondition|InvalidCaller|NotFound|NatAssign|SliceError|DivByZero|OutOfBound)\b/, + 'control': /\b(?:assert|iter|begin|end|do|done|else|return|before|for|if|in|match|in|forall|added|removed|exists|then|the|from|to|while|with|InvalidCondition|InvalidCaller|NotFound|NatAssign|SliceError|DIV_BY_ZERO|OUT_OF_BOUND)\b/, 'decl': /\b(?:const|var|let some|let)\b/, 'boolean': /\b(?:false|true)\b/, 'logic': /\b(?:and|or|=|not|asr|land|lor|lsl|lsr|lxor)\b/,