Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
764 commits
Select commit Hold shift + click to select a range
e86ab60
Renaming
rinderknecht Feb 26, 2025
a1c29f7
Added filtering of pattern matching in the AST stripper.
rinderknecht Feb 27, 2025
d283e0e
Added E_ctor_app node to stripped AST and the corresponding filter (d…
rinderknecht Feb 27, 2025
72cb28a
Changed the filter of match clauses to be one pattern or none.
rinderknecht Feb 28, 2025
1f2b285
Restricted match rhs to an expression.
rinderknecht Feb 28, 2025
b823d6d
Added non-initial node P_ctor_app, to ease translation to unified AST…
rinderknecht Feb 28, 2025
08789ae
Formatting
rinderknecht Feb 28, 2025
c351a0c
Added compilation to unified AST of sum types, constructor applicatio…
rinderknecht Feb 28, 2025
f306ab1
Fixed compilation of pattern matching to unified AST.
rinderknecht Mar 1, 2025
9f6cbad
[Fix] Added normalisation of strings in the translation to unified AST.
rinderknecht Mar 2, 2025
e3e7640
Constructors are now matched as strings (property names that are stri…
rinderknecht Mar 3, 2025
fea7b2f
Fixed compilation to unified AST of for-of loops (ranges were wrong).
rinderknecht Mar 4, 2025
084f558
[Fix] for-of and for-in loops were mixed up.
rinderknecht Mar 7, 2025
7b56571
Upgraded test contracts of integration test. All ok except disc union…
rinderknecht Mar 8, 2025
aee1968
Added a non-initial constructor S_decorated in the stripped AST, to
rinderknecht Mar 9, 2025
15e35a9
Forgot to commit disc_union.jsligo.
rinderknecht Mar 10, 2025
5337266
Committed test that raises an exception also on dev.
rinderknecht Mar 10, 2025
05b00ac
[Fix] Decoding functions need to reset the global buffer containing t…
rinderknecht Mar 11, 2025
a92ef85
[Fix] The grammar says:
rinderknecht Mar 12, 2025
5df2136
Upgrade of var_consts test contract.
rinderknecht Mar 12, 2025
4d0d1ba
Upgradfe of the contract testing deep pattern matching in JsLIGO.
rinderknecht Mar 12, 2025
8a03101
Upgraded the contracts testing sum types and subtyping. NOTE: The res…
rinderknecht Mar 12, 2025
57aca1c
Fixed forgotten test contract about union types. Checked the expect t…
rinderknecht Mar 13, 2025
1b53612
[Fix] Forgot to normalise file path as a string in the compilation to…
rinderknecht Mar 13, 2025
4288c6b
Threaded comments to function declarations and property signatures (@…
rinderknecht Mar 13, 2025
ed9c76a
[Fix] Set property the optional flag for interface entries.
rinderknecht Mar 13, 2025
22b8aad
Fixed the stripped AST and the compilation to the unified AST of
rinderknecht Mar 14, 2025
52edbb0
[Fix] The type _never_ is actually valid in JsLIGO.
rinderknecht Mar 14, 2025
46e079d
More contract upgrades from contract_tests.ml. Half-way.
rinderknecht Mar 14, 2025
ca28866
Upgraded some tests in repl_test.ml
rinderknecht Mar 15, 2025
fe832e9
Added 'bytes' as a predefined function taking a template string.
rinderknecht Mar 15, 2025
f9dd99b
Added threading of leading comment (with possible decorator) to union…
rinderknecht Mar 15, 2025
380b048
More contract upgrades.
rinderknecht Mar 16, 2025
23a689f
[Fix] I forgot to extract and compile decorators in comments about un…
rinderknecht Mar 16, 2025
f9754a4
Formatting
rinderknecht Mar 16, 2025
66df929
[Fix] Pattern and expressions of objects are now correctly compiled t…
rinderknecht Mar 17, 2025
b9464dd
More contracts upgraded.
rinderknecht Mar 17, 2025
5da5cb3
Fixed typo in message and OCaml variable.
rinderknecht Mar 17, 2025
4abb095
Finish upgrade of contract_tests.ml for JsLIGO.
rinderknecht Mar 18, 2025
7b9cfa2
[Fix] Object updates were not copied to the stripped AST.
rinderknecht Mar 18, 2025
3ab4829
[Fix] Added back predefined function "external"/"External".
rinderknecht Mar 18, 2025
fc6235a
Removed automatic_semicolon_jsligo.ml and related tests, as being unu…
rinderknecht Mar 18, 2025
05fa259
Removed jsligo_unreachable_code.ml and jsligo_unreachable_code.jsligo…
rinderknecht Mar 18, 2025
f779cc6
Removed bitwise_operators.ml as not being used.
rinderknecht Mar 18, 2025
ddd36d0
Revert "Removed bitwise_operators.ml as not being used."
rinderknecht Mar 18, 2025
2ff5455
Revert "Removed jsligo_unreachable_code.ml and jsligo_unreachable_cod…
rinderknecht Mar 18, 2025
0977f12
Updated metadata test contracts.
rinderknecht Mar 18, 2025
720a4a9
Upgraded syntax of let_destructing.jsligo.
rinderknecht Mar 18, 2025
5299371
Removed lexing tests as we do not control the lexer anymore.
rinderknecht Mar 18, 2025
04c4e62
Upgraded doc code example in JsLIGO.
rinderknecht Mar 18, 2025
3e60438
Upgrading test contracts in the directory interpreter_tests. (Not ove…
rinderknecht Mar 18, 2025
f50f2f2
[Fix] Regression: Indices in subscript expressions can be strings den…
rinderknecht Mar 19, 2025
e80026e
Upgrades interpreter tests (positive and negative).
rinderknecht Mar 19, 2025
c3e465c
Added detection of ERROR children in print_cst.ml
rinderknecht Mar 19, 2025
d5840c7
[Fix] Previous commit printed ERROR node when there was not: I invert…
rinderknecht Mar 19, 2025
e3645bf
[Fix] In the decoder, for each decoding function, I added post-condit…
rinderknecht Mar 19, 2025
fcbeca7
More test contracts upgraded.
rinderknecht Mar 19, 2025
6fcc2b2
More contracts
rinderknecht Mar 19, 2025
7a26291
Upgrades pattern matching tests. TODO: Fix source location on redunda…
rinderknecht Mar 20, 2025
5fad92f
Fixed comment.
rinderknecht Mar 20, 2025
31d9c9c
Upgraded more pattern matching tests.
rinderknecht Mar 20, 2025
18a7b85
Upgraded tests of polymorphism. TODO: Revisit when import statements …
rinderknecht Mar 20, 2025
bd62505
Removed test of preprocessor #define.
rinderknecht Mar 20, 2025
513f7b2
Upgrade tests on signatures.
rinderknecht Mar 21, 2025
1fca944
Upgraded tests on singleton types (nat is not supported anymore).
rinderknecht Mar 21, 2025
e202df0
Upgraded switch tests.
rinderknecht Mar 21, 2025
331c17c
Remove a couple of syntax error tests.
rinderknecht Mar 21, 2025
b372580
Upgraded test on unused tail recursion.
rinderknecht Mar 21, 2025
26cf708
Upgraded and added tests for top-level patterns.
rinderknecht Mar 21, 2025
df05c29
Disabled test in type_doc.ml until import statements work.
rinderknecht Mar 21, 2025
7192efd
Upgraded typer error for JsLIGO (ugly error message btw).
rinderknecht Mar 21, 2025
5890647
Upgraded tests for vars_consts.
rinderknecht Mar 21, 2025
aad2994
Upgraded tests about views in JsLIGO.
rinderknecht Mar 21, 2025
1129e6a
Fixed warning on type_doc.ml and upgraded tests for infinite loops.
rinderknecht Mar 21, 2025
7e241be
Fixed typo: infinte -> infinite in warn_infinite_for_loop.ml and main…
rinderknecht Mar 21, 2025
84c861e
Upgraded JsLIGO excerpts and contracts in docs/advanced.
rinderknecht Mar 24, 2025
cea88be
Upgraded JsLIGO in docs/api.
rinderknecht Mar 24, 2025
f0a7fda
Upgraded JsLIGO excerpts in docs/compiling.
rinderknecht Mar 24, 2025
1293f12
Upgraded JsLIGO excerpts in docs/data-types.
rinderknecht Mar 24, 2025
184e195
Upgraded faq
rinderknecht Mar 25, 2025
7259a18
Upgraded docs/imperative
rinderknecht Mar 25, 2025
ff54478
Upgraded docs/language-basics
rinderknecht Mar 25, 2025
47cec92
Added a `michelson_of_file` primitive function for JsLIGO, to avoid
rinderknecht Mar 27, 2025
ce13fcd
Disconnected some tests from src/test/dune
rinderknecht Mar 28, 2025
763dd93
[Fix] Added support for compilation of decorators on variants, like @…
rinderknecht Mar 28, 2025
e4a48b0
Formatting
rinderknecht Mar 28, 2025
5a5715a
Fixed signatures in JsLIGO.
rinderknecht Mar 31, 2025
04f85b1
Upgraded documentation docs/testing
rinderknecht Mar 31, 2025
a1a5cf3
Upgraded docs/tezos/big_maps
rinderknecht Mar 31, 2025
7e167b9
Upgrades docs/tutorials
rinderknecht Mar 31, 2025
9b53eff
Promoted and fixed some tests.
rinderknecht Apr 1, 2025
4c82b61
[Fix] Michelson injection is done with function names 'Michelson', no…
rinderknecht Apr 1, 2025
23603fc
Unplugged LSP tests. All other tests now pass, except documentation.
rinderknecht Apr 2, 2025
0e8b454
Unplugged preprocessing for JsLIGO.
rinderknecht Apr 4, 2025
e78fc56
Fixed more JsLIGO excerpts in the md files of the documentation.
rinderknecht Apr 5, 2025
04041ab
[Fix] Forgot to keep escape sequences in template strings while strip…
rinderknecht Apr 8, 2025
0c6659b
Fixed the last md of documentation and committed all modified excerpts.
rinderknecht Apr 8, 2025
aac9dea
ctypes in ligo.opam
rinderknecht Apr 8, 2025
3fd69d4
Fixed imports of variables in ast_stripped and pass 3.
rinderknecht Apr 9, 2025
9b9efae
Enabled equivalent of "export import". Upgraded contracts and tests t…
rinderknecht Apr 9, 2025
7434828
More upgrades to the new import statements in JsLIGO.
rinderknecht Apr 11, 2025
1c74c81
Fixed order or type parameters printed in alias type declarations.
rinderknecht Apr 16, 2025
75ecbc2
Complete syntax block
timothymcmackin Apr 17, 2025
24d62a7
Started upgrading CameLIGO contracts, in view of later upgrade of the…
rinderknecht Apr 21, 2025
beec180
Finished upgrading CameLIGO test contracts to new LIGO standard library.
rinderknecht Apr 22, 2025
6dc1f17
More upgrades to Next.
rinderknecht Apr 22, 2025
b51c3ce
Clarify decorators in 2.0 and that escaping them is no longer necessa…
timothymcmackin Apr 23, 2025
e96caea
Clarify variants doc (JsLIGO v2) (#50)
timothymcmackin Apr 23, 2025
2c67445
Update examples of dry-run command for JsLIGO 2.0 (#53)
timothymcmackin Apr 24, 2025
2d8c13c
Update taco shop tutorial for JsLIGO v2 (#49)
timothymcmackin Apr 24, 2025
3848a0f
fix(docs): docs on classes (#51)
timothymcmackin Apr 25, 2025
ce04233
Good place to mention the ignore function (#54)
timothymcmackin Apr 25, 2025
080f031
Change references to "records" to "objects" in JsLIGO (#55)
timothymcmackin Apr 25, 2025
01aa792
Upgraded more contracts to *Next.
rinderknecht Apr 25, 2025
35f48e2
Merge branch 'rinderknecht@ts_with_imports' of github.com:ligolang/li…
rinderknecht Apr 25, 2025
86ace16
Fixes for code tests in docs
timothymcmackin Apr 25, 2025
0fc7180
Merge pull request #56 from ligolang/tpm/v2-fixes
rinderknecht Apr 25, 2025
76b1708
Merge branch 'rinderknecht@ts_with_imports' of github.com:ligolang/li…
rinderknecht Apr 25, 2025
7372df1
Better example of ignore in both syntaxes (#57)
timothymcmackin Apr 25, 2025
4857131
Started upgrading to *.Next some code excerpt from the documentation.
rinderknecht Apr 25, 2025
7398550
Merge branch 'rinderknecht@ts_with_imports' of github.com:ligolang/li…
rinderknecht Apr 25, 2025
0de093d
More upgrades to Next in the docs
rinderknecht Apr 28, 2025
5fee1e7
More doc upgraded to Tezos.Next and Test.Next.
rinderknecht Apr 29, 2025
e37f1ce
More upgrades to Next.
rinderknecht May 2, 2025
2747ec2
Upgraded more contracts. dune runtest passes.
rinderknecht May 5, 2025
6ab05a7
More contracts updated.
rinderknecht May 5, 2025
0f5c050
Removed Tezos.get_source.
rinderknecht May 6, 2025
71cff7c
Removed Tezos.self
rinderknecht May 6, 2025
8c6654c
Removed Tezos.get_self_address.
rinderknecht May 6, 2025
3b6e4d2
Removed one more function from Tezos
rinderknecht May 6, 2025
891abc3
More removals from Tezos (using Tezos.Next instead).
rinderknecht May 7, 2025
aa96f52
Removed Tezos.call_view and Tezos.create_ticket.
rinderknecht May 7, 2025
e48ee57
Removed more functions from Tezos.
rinderknecht May 8, 2025
2c0325a
Add tutorial files to tests (#58)
timothymcmackin May 8, 2025
3d10611
Fix test by moving this syntax block (#59)
timothymcmackin May 8, 2025
02979a3
Removed Tezos.get_amount.
rinderknecht May 9, 2025
1422f43
Merge branch 'rinderknecht@ts_with_imports' of github.com:ligolang/li…
rinderknecht May 9, 2025
7656b92
Removed Tezos.get_now and fixed some issued due to pulling.
rinderknecht May 9, 2025
a80dc79
Removed Tezos.get_min_block_time
rinderknecht May 9, 2025
8cfbac0
fix(docs): remove preprocessor info and provide import alternative (#60)
timothymcmackin May 9, 2025
81d21da
Removed Tezos.get_level and Tezos.get_chain_id.
rinderknecht May 9, 2025
d284692
Merge branch 'rinderknecht@ts_with_imports' of github.com:ligolang/li…
rinderknecht May 9, 2025
ab36047
Upgrade info for JsLIGO 2.0 (#48)
timothymcmackin May 9, 2025
d2b1413
Corrections to fix tests
timothymcmackin May 9, 2025
fed5843
Upgraded the comments in the std lib for the new syntax of constructo…
rinderknecht May 9, 2025
f1a3333
Merge branch 'rinderknecht@ts_with_imports' of github.com:ligolang/li…
rinderknecht May 9, 2025
e72f6e0
Last functions removed from the top-level of module Tezos.
rinderknecht May 12, 2025
9d5bf2d
fix(docs): clarify how imports work for different kinds of definition…
timothymcmackin May 12, 2025
19e6b3b
fix(docs): remove unused topic on basic functions (#63)
timothymcmackin May 13, 2025
92e84dd
Remove old modules topics (#64)
timothymcmackin May 13, 2025
0a4848b
Remove unused topics (#65)
timothymcmackin May 13, 2025
6d7112f
fix(docs): mine duplicate numbers topic for needed info and delete it…
timothymcmackin May 13, 2025
2f1b30e
fix(docs): remove duplicate strings-bytes topic (#67)
timothymcmackin May 13, 2025
84557d6
Finished upgrading Tezos.Next into Tezos.
rinderknecht May 13, 2025
b854d3f
Merge branch 'rinderknecht@ts_with_imports' of github.com:ligolang/li…
rinderknecht May 13, 2025
62c72e1
Adding a cameligo file from the docs.
rinderknecht May 13, 2025
25b45f4
fix(docs): remove duplicate unit/option/matching topic (#68)
timothymcmackin May 13, 2025
ee3da58
fix(docs): move topic on types and clarify (#69)
timothymcmackin May 13, 2025
b6a827b
Reorg of the stdlib to have Test.Next standalone.
rinderknecht May 14, 2025
6090ffd
Merge branch 'rinderknecht@ts_with_imports' of github.com:ligolang/li…
rinderknecht May 14, 2025
61a7ec0
Removed 'include Typed_address' from module Test in the standard libr…
rinderknecht May 16, 2025
4e73470
Removed use of Test.Next.failwith, in favour of Test.Next.Assert.fail…
rinderknecht May 16, 2025
54e8619
Cleaned up Option and a bit of Next.
rinderknecht May 16, 2025
8181684
Removed List.head_opt
rinderknecht May 16, 2025
2359d2a
Removed List.tail_opt
rinderknecht May 16, 2025
2442f26
Removed more functions from Test (using Test.Next instead).
rinderknecht May 18, 2025
7121e9d
Removed more deprecated functions from Test.
rinderknecht May 19, 2025
e1e3687
Removed the last deprecated functions from the LIGO standard library.
rinderknecht May 19, 2025
837407d
fix(docs): dedupe and clarify topics onf list, sets, and tuples (#72)
timothymcmackin May 20, 2025
2e8a034
Removed Test.Next from test contracts and documentation snippets.
rinderknecht May 20, 2025
84d6f89
Merge branch 'rinderknecht@ts_with_imports' of github.com:ligolang/li…
rinderknecht May 20, 2025
6d78cc7
fix(docs): table of changed test functions (#73)
timothymcmackin May 22, 2025
6a53378
More upgrades to the documentation.
rinderknecht May 27, 2025
720d81d
Upgraded the structure of the reference pages.
rinderknecht May 27, 2025
1e5c554
Fixed test.md and test.mutation*md
rinderknecht May 27, 2025
dc91220
Removed deprecated function from test.md
rinderknecht May 27, 2025
4dfa1be
Cleaned toplevel.md from deprecated functions.
rinderknecht May 27, 2025
6a40955
Remove stray </SyntaxTitle>
timothymcmackin May 27, 2025
2e9a659
Fixed closing tag.
rinderknecht May 27, 2025
e968239
Ditto.
rinderknecht May 27, 2025
d0430c6
Fixed > with &gt;
rinderknecht May 27, 2025
c5eb0cb
Hacking the structure of the documentation.
rinderknecht May 27, 2025
47e25f9
Fixing the JsLIGO signatures in the documentation (they were in Curry…
rinderknecht May 28, 2025
e3fd67a
Tezos.call_view -> Tezos.View.call and fixed more JsLIGO signatures i…
rinderknecht May 29, 2025
90433e0
Forgot to commit these MD about call_view
rinderknecht May 29, 2025
cc7acfb
Finished upgrade of the reference in the docs.
rinderknecht May 29, 2025
aad1cc7
Corrections to the reference sidebar (#75)
timothymcmackin May 29, 2025
ea2b3e7
Lower-case vs Upper-case nonsense. To be fixed later.
rinderknecht May 29, 2025
fbb2278
Removed in the sidebar a link to Proxy_ticket.
rinderknecht May 30, 2025
278c8f3
Removed unused files under docs/reference
rinderknecht May 30, 2025
ff54911
Upgraded pattern matching.
rinderknecht Jun 3, 2025
a39ff3d
Upgraded mutez, tez and nat literals (with systematic parenthesises).
rinderknecht Jun 3, 2025
7e403db
Upgraded parameter_of.
rinderknecht Jun 3, 2025
987383e
Upgraded singleton type 1n to 1.
rinderknecht Jun 3, 2025
5f11083
Converted top-level 'let' declarations into 'const'.
rinderknecht Jun 4, 2025
013b76e
Upgrade of do-statements (but not all typecheck as a result)
rinderknecht Jun 4, 2025
35fd879
Introduced printing of decorators in comments. To be tested.
rinderknecht Jun 5, 2025
a4fb874
Undid name punning.
rinderknecht Jun 5, 2025
c3225df
Forced decorators on patterns and expressions to be in a comment.
rinderknecht Jun 5, 2025
d36a7b1
Removed more tests on error recovery on JsLIGO.
rinderknecht Jun 6, 2025
cb265ae
Fixed some remaining @layout decorators.
rinderknecht Jun 6, 2025
9c25ca7
Decorators in comment before type expressions.
rinderknecht Jun 6, 2025
27d7648
Added control over separator in object expressions etc.
rinderknecht Jun 6, 2025
9f43749
Added heuristic to upgrade some pattern matchings on lists.
rinderknecht Jun 6, 2025
8fa9a17
@foo -> __foo. Preparing #import.
rinderknecht Jun 10, 2025
1759d44
@foo -> foo__ (not __foo, which is silent). Fixed upgrade of do-expre…
rinderknecht Jun 10, 2025
8eac11f
export import -> import (v1.0 semantics already).
rinderknecht Jun 10, 2025
f1f49ed
let -> const at top-level and namespaces.
rinderknecht Jun 11, 2025
9be8557
#import -> import. Fixed a couple of contracts.
rinderknecht Jun 12, 2025
f809799
Upgrade constructor applications.
rinderknecht Jun 12, 2025
805f007
CLI: Added a --classes option to ParserMain.exe for --pretty.
rinderknecht Jun 18, 2025
065ce52
CLI: Added a --classes option to ParserMain.exe for --pretty.
rinderknecht Jun 18, 2025
4ef754c
Merge branch 'rinderknecht@new_jsligo' of github.com:ligolang/ligo in…
rinderknecht Jun 18, 2025
70d8900
Added more threading of in_comment to leave decorators in classes.
rinderknecht Jun 18, 2025
1b13526
Pretty-printing of functions in namespaces as methods. Handled export…
rinderknecht Jun 19, 2025
cc6d507
Handled nested namespaces.
rinderknecht Jun 19, 2025
e6f19ca
Added printing of an UPGRADE comment when --classes and nested namesp…
rinderknecht Jun 20, 2025
f8cfeb1
Added upgrade of 'implements' clauses. Note: Pretty-printing was alre…
rinderknecht Jun 20, 2025
921767d
Upgrade of namespaces to classes is now not performed is there are no…
rinderknecht Jun 23, 2025
d3951e0
Removed useless attributes in upgrading namespaces.
rinderknecht Jun 23, 2025
1a80c1f
Renaming.
rinderknecht Jun 23, 2025
8c0d4f7
Upgrading interfaces.
rinderknecht Jun 23, 2025
6132029
[Fix] Translate function declarations in namespaces into methods.
rinderknecht Jun 24, 2025
0491e2c
Fix: Decorator + export was broken.
rinderknecht Jun 24, 2025
208d838
More polishing of the upgrading of namespaces.
rinderknecht Jun 24, 2025
4f9087d
Fix: I duplicated the return type when translating function declarati…
rinderknecht Jun 25, 2025
d08861d
Renamed --pretty into --upgrade, and --classes into --namespaces. Int…
rinderknecht Jun 25, 2025
58bc1c1
Added --stdlib and threaded optional argument stdlib in the declarati…
rinderknecht Jun 27, 2025
6629720
Fixed missing comment attached to const/let that needs to be reattach…
rinderknecht Jun 30, 2025
034627b
Finished first pass at threading ~stdlib.
rinderknecht Jun 30, 2025
57722c5
Move pattern matching near variant types
timothymcmackin Jun 30, 2025
f50edc5
Match cases can accept only one parameter
timothymcmackin Jun 30, 2025
885df00
Merge pull request #78 from ligolang/tpm/match-case-single-param
timothymcmackin Jun 30, 2025
e193efd
Started upgrading namespace Option. Fixed a bug in recognising --stdlib
rinderknecht Jun 30, 2025
00da383
Merge branch 'rinderknecht@new_jsligo' of github.com:ligolang/ligo in…
rinderknecht Jun 30, 2025
c17dd8b
Fixed upgrade of empty bytes (0x -> as bytes).
rinderknecht Jun 30, 2025
14c62ba
Fixed upgrade of LHS in pattern matching clauses: one tuple argument …
rinderknecht Jun 30, 2025
d533e4c
Forgot to remove a trace
rinderknecht Jun 30, 2025
fbddef1
fix(docs): add info on compiling expressions for views (#80)
timothymcmackin Jul 7, 2025
44acf85
monkey patch pretty to runtest
EduardoRFS Jul 7, 2025
0106cf0
fix(docs): clarify type annotations, assumptions, and inferences (#82)
timothymcmackin Jul 8, 2025
c49ea1a
another pretty related monkey patch
EduardoRFS Jul 8, 2025
820de32
Test file fixes
timothymcmackin Jul 8, 2025
180ddd3
fix(doc): review topics on maps and big-maps (#81)
timothymcmackin Jul 11, 2025
dfb267a
Typos
timothymcmackin Jul 11, 2025
ad42ee2
correct link
timothymcmackin Jul 15, 2025
70fcf8a
fix(docs): remove unneeded test files
timothymcmackin Jul 18, 2025
8ae1321
fix interpreter testing of contracts with tickets
EduardoRFS Jul 21, 2025
1e19f2a
typo
timothymcmackin Aug 1, 2025
feadc5b
fix(docs): clarify security topic and add JsLIGO examples (#86)
timothymcmackin Aug 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
187 changes: 187 additions & 0 deletions gitlab-pages/docs/advanced/attributes-decorators.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
---
id: decorators
title: Attributes or Decorators
---

import Syntax from '@theme/Syntax';

<Syntax syntax="cameligo">

# Attributes

Attributes (also known as "decorators" in JsLIGO, annotations or pragmas in other languages) are markers that can affect how the code immediately after is compiled or interpreted. Depending on the attribute, that code can be a definition, variable, statement block and so on. The sections below describe the attributes supported by CameLIGO.

It is possible to specify multiple attributes as follows:

```cameligo
type storage = int
type result = operation list * storage

[@entry] [@no_mutation]
let sub (delta : int) (store : storage) : result =
[], store - delta
```

## @entry to mark a function as a Smart Contract entrypoint

The `@entry` attribute is used to indicate that a function should be available as an entrypoint of the smart contract. It is essentially declaring that function as one of the several "main" functions. For more information, see [Entrypoints](../syntax/contracts/entrypoints).

## @dyn_entry to mark a function as a dynamic entrypoint

The `@dyn_entry` attribute is used to indicate that a function should be available as a dynamic entrypoint of the smart contract. Dynamic entrypoints can be removed or updated without deploying a new contract, unlike entrypoints marked with `@entry`, which cannot be modified after the contract is originated. Dynamic entrypoints can be used for example to implement a DAO (Decentralized Autonomous Organization) with a built-in update mechanism that allows participants to vote on upgrades to the contract, somewhat akin to the process which allows to amend the Tezos protocol. For more information, see [Dynamic entrypoints](../syntax/contracts/dynamic-entrypoints.md).

## @inline to ensure a function is inlined at its call sites

The `@inline` attribute indicates that the code of the function it annotates must be inlined wherever it is called. This allows some optimizations to be performed, possibly at the expense of a larger compiled code. Benchmarks and profiling can help decide whether a function should be inlined or nor. For more information, see [Inlining](../syntax/functions#inlining).

## @view to mark a function as a Smart Contract on-chain view

Views are a form of read-only entrypoints, that can be called synchronously. For more information, see [LIGO views](../syntax/contracts/views).

## @no_mutation

See [the documentation on mutation testing](../testing/mutation-testing.md#preventing-mutation).

## @private to prevent an identifier from being accessed outside of its defining module

The `[@private]` decorator can be used on a top-level declaration, to prevent that value from being used outside the declaring module.

```cameligo group=module-with-private
(* This is gitlab-pages/docs/advanced/src/attributes-decorators/module-with-private.mligo *)
[@private] let stuff = 42
[@private] let g x = x * stuff
let f x = (g x) + 1
```

```cameligo group=import-module-with-private
module ModuleWithPrivate =
Gitlab_pages.Docs.Advanced.Src.Attributes_decorators.Module_with_private

(* foo = 5167 = (123 * 42) + 1 *)
let foo = ModuleWithPrivate.f 123

(*
The following lines cause errors because g and stuff are private:

let bad_1 = ModuleWithPrivate.g 123
let bad_2 = ModuleWithPrivate.stuff
*)
```

## @annot to ornate the generated code with Michelson annotations

This attribute can be used to choose the name of the Michelson equivalent of record fields or variant constructors. By default, a variant is compiled to a comb of Michelson `or`, and each leaf in the nested tree of `or` that corresponds to a constructor is annotated with that constructor's name. Similarly, a record is compiled to a comb of Michelson `pair`, and each leaf in the nested tree of `pair` that corresponds to a field is annotated with that field's name.

Using `@annot`, the Michelson annotation for a given field or constructor can be customized. This is useful for interoperability, where a third-party program or contract expects specific Michelson annotations, even if the LIGO code might not use these names internally.

For more information, see [Interop: Different Michelson annotations](../syntax/contracts/interop.md#different-michelson-annotations)?

## @layout to specify the Michelson layout of composite data types (structures and variants)

Michelson does not natively support records or variants. These have to be encoded using nested `pair`s or nested `or`s. Many tree representations could translate to the same linear sequence of fields or constructors. LIGO makes it possible to choose between a right comb which preserves the order or the fields or constructors as declared in the source code, and a left-balanced, alphabetically ordered binary tree. The attributes `[@layout comb]` and `[@layout tree]` can be placed before the `{ ... }` for records and before the first constructor or leading `|` for variants, in order to explicitly choose the desired layout.

For more information, see [Interop: Michelson layout of LIGO data structures](../syntax/contracts/interop.md##michelson-layout-of-ligo-data-structures).

## @tzip16_compatible to enable TZIP-16 storage checks

The `@tzip16_compatible` attribute is used to indicate a storage variable that is expected to contain metadata compliant with [TZIP-16 specification](https://gitlab.com/tezos/tzip/-/blob/master/proposals/tzip-16/tzip-16.md). Values marked with this attribute are subject to automatic checks verifying that the storage indeed satisfies TZIP-16 rules.

Note that at the moment there is no support for thus feature from the LIGO compiler; IDEs however can recognize the attribute and provide additional verification.

The attribute works only on variables that are not functions. In case a function returning storage needs to be verified, one can create one or several sample storages out of it and apply the attribute to them.

## Internal attributes

Furthermore, the following attributes are used internally by the compiler, you may encounter them when exporting the AST after a certain compilation pass, but they should not appear in normal source code.

* `@thunk`
* `@hidden`
* `@deprecated`

</Syntax>

<Syntax syntax="jsligo">

# Decorators

Decorators (also known as "attributes" in CameLIGO, annotations or pragmas in other languages) are markers that can affect how the code immediately after is compiled or interpreted. Depending on the decorator, that code can be a definition, variable, statement block and so on. The sections below describe the decorators supported by JsLIGO.

It is possible to specify multiple decorators as follows:

```jsligo
type storage = int;
type result = [list<operation>, storage];

// @entry
// @no_mutation
const sub = (delta : int, store : storage) : result =>
[[], store - delta]
```

## @entry to mark a function as a Smart Contract entrypoint

The `@entry` decorator is used to indicate that a function should be available as an entrypoint of the smart contract. It is essentially declaring that function as one of the several "main" functions. For more information, see [Entrypoints](../syntax/contracts/entrypoints).

## @dyn_entry to mark a function as a dynamic entrypoint

The `@dyn_entry` decorator is used to indicate that a function should be available as a dynamic entrypoint of the smart contract. Dynamic entrypoints can be removed or updated without deploying a new contract, unlike entrypoints marked with `@entry`, which cannot be modified after the contract is originated. Dynamic entrypoints can be used for example to implement a DAO (Decentralized Autonomous Organization) with a built-in update mechanism that allows participants to vote on upgrades to the contract, somewhat akin to the process which allows to amend the Tezos protocol. For more information, see [Dynamic entrypoints](../syntax/contracts/dynamic-entrypoints.md).

## @inline to ensure a function is inlined at its call sites

The `@inline` decorator indicates that the code of the function it annotates must be inlined wherever it is called. This allows some optimizations to be performed, possibly at the expense of a larger compiled code. Benchmarks and profiling can help decide whether a function should be inlined or nor. For more information, see [Inlining](../syntax/functions#inlining).

## @view to mark a function as a Smart Contract on-chain view

Views are a form of read-only entrypoints, that can be called synchronously. For more information, see [LIGO views](../syntax/contracts/views).

## @no_mutation

See [the documentation on mutation testing](../testing/mutation-testing.md#preventing-mutation).

## @private to prevent an identifier from being accessed outside of its defining module

This decorator is meant to be used in CameLIGO, where definitions are public/exported by default. It has no use in JsLIGO.

## @annot to ornate the generated code with Michelson annotations

This decorator can be used to choose the name of the Michelson equivalent of record fields or variant constructors. By default, a variant is compiled to a comb of Michelson `or`, and each leaf in the nested tree of `or` that corresponds to a constructor is annotated with that constructor's name. Similarly, a record is compiled to a comb of Michelson `pair`, and each leaf in the nested tree of `pair` that corresponds to a field is annotated with that field's name.

Using `@annot`, the Michelson annotation for a given field or constructor can be customized. This is useful for interoperability, where a third-party program or contract expects specific Michelson annotations, even if the LIGO code might not use these names internally.

For more information, see [Interop: Different Michelson annotations](../syntax/contracts/interop.md#different-michelson-annotations)?

## @layout to specify the Michelson layout of composite data types (structures and variants)

Michelson does not natively support objects or variants. These have to be encoded using nested `pair`s or nested `or`s. Many tree representations could translate to the same linear sequence of fields or constructors. LIGO makes it possible to choose between a right comb which preserves the order or the fields or constructors as declared in the source code, and a left-balanced, alphabetically ordered binary tree. The decorators `@layout("comb")` and `@layout("tree")` can be placed before the `{ ... }` for objects and before the first constructor or leading `|` for variants, in order to explicitly choose the desired layout.

For more information, see [Interop: Michelson layout of LIGO data structures](../syntax/contracts/interop.md##michelson-layout-of-ligo-data-structures).

## @tzip16_compatible to enable TZIP-16 storage checks

The `@tzip16_compatible` decorator is used to indicate a storage variable that is expected to contain metadata compliant with [TZIP-16 specification](https://gitlab.com/tezos/tzip/-/blob/master/proposals/tzip-16/tzip-16.md). Values marked with this decorator are subject to automatic checks verifying that the storage indeed satisfies TZIP-16 rules.

Note that at the moment there is no support for thus feature from the LIGO compiler; IDEs however can recognize the decorator and provide additional verification.

The decorator works only on variables that are not functions. In case a function returning storage needs to be verified, one can create one or several sample constant storages out of it and apply the decorator to them.

## export to mark an identifier as accessible outside its defining module

This decorator is slightly different from the others in that it does not need `@` and simply appears as follows:

```jsligo
namespace MathPi {
export const pi_millionth_numerator : int = 3141593
export const pi_millionth_denominator : nat = 1000000 as nat
}
```

## Internal decorators

Furthermore, the following attributes are used internally by the compiler, you may encounter them when exporting the AST after a certain compilation pass, but they should not appear in normal source code.

* `@thunk`
* `@hidden`
* `@public`
* `@deprecated`

</Syntax>
11 changes: 5 additions & 6 deletions gitlab-pages/docs/advanced/code-injection.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,19 @@ let main (action : parameter) (store : storage) : operation list * storage =

<Syntax syntax="jsligo">

```jsligo skip
```jsligo group=never
type parameter =
["Increment", int]
| ["Extend", never];

type storage = int;

@entry
// @entry
function main (action: parameter, store: storage) : [list<operation>, storage] {
let storage =
match(action, {
Increment: n => store + n,
Extend: k => (Michelson`{ NEVER }` as ((n: never) => int))(k)
$match(action, {
"Increment": n => store + n,
"Extend": k => (Michelson`{ NEVER }` as ((n: never) => int))(k)
});
return [[], storage];
};
Expand All @@ -155,4 +155,3 @@ ligo compile contract --protocol nairobi --disable-michelson-typechecking gitlab
> instruction `NEVER` directly from LIGO, using `Tezos.never`.

<!-- updated use of entry -->

50 changes: 25 additions & 25 deletions gitlab-pages/docs/advanced/global-constants.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ let main (_p : unit) (s : int) : operation list * int =
<Syntax syntax="jsligo">

```jsligo group=global_call
const c : ((_p : int) => int) = Tezos.constant("expruCKsgmUZjC7k8NRcwbcGbFSuLHv5rUyApNd972MwArLuxEZQm2")
const c : (_p : int) => int = Tezos.constant("expruCKsgmUZjC7k8NRcwbcGbFSuLHv5rUyApNd972MwArLuxEZQm2")

@entry
let main = (_p : unit, s : int) : [list<operation>, int] =>
// @entry
const main = (_p : unit, s : int) : [list<operation>, int] =>
[[], c(s)]
```

Expand Down Expand Up @@ -147,7 +147,7 @@ let main (p : string) (s : int) : operation list * int =
const helper = ([s, x]: [string, int]) =>
String.length(s) + x * 3 + 2;

@entry
// @entry
const main = (p: string, s: int) : [list<operation>, int] =>
[[], helper ([p, s])];
```
Expand All @@ -165,7 +165,7 @@ ligo compile constant cameligo "helper" --init-file ./gitlab-pages/docs/advanced
# Michelson constant as JSON string:
# "{ UNPAIR ;\n PUSH int 2 ;\n PUSH int 3 ;\n DIG 3 ;\n MUL ;\n DIG 2 ;\n SIZE ;\n ADD ;\n ADD }"
# This string can be passed in `--constants` argument when compiling a contract.
#
#
# Remember to register it in the network, e.g.:
# > tezos-client register global constant "{ UNPAIR ;
# PUSH int 2 ;
Expand All @@ -176,7 +176,7 @@ ligo compile constant cameligo "helper" --init-file ./gitlab-pages/docs/advanced
# SIZE ;
# ADD ;
# ADD }" from bootstrap1
#
#
# Constant hash:
# exprv547Y7U5wKLbQGmkDU9Coh5tKPzvEJjyUed7px9yGt9nrkELXf
```
Expand All @@ -191,7 +191,7 @@ ligo compile constant jsligo "helper" --init-file ./gitlab-pages/docs/advanced/s
# Michelson constant as JSON string:
# "{ UNPAIR ;\n PUSH int 2 ;\n PUSH int 3 ;\n DIG 3 ;\n MUL ;\n DIG 2 ;\n SIZE ;\n ADD ;\n ADD }"
# This string can be passed in `--constants` argument when compiling a contract.
#
#
# Remember to register it in the network, e.g.:
# > tezos-client register global constant "{ UNPAIR ;
# PUSH int 2 ;
Expand All @@ -202,7 +202,7 @@ ligo compile constant jsligo "helper" --init-file ./gitlab-pages/docs/advanced/s
# SIZE ;
# ADD ;
# ADD }" from bootstrap1
#
#
# Constant hash:
# exprv547Y7U5wKLbQGmkDU9Coh5tKPzvEJjyUed7px9yGt9nrkELXf
```
Expand Down Expand Up @@ -241,7 +241,7 @@ references to `helper` by
<Syntax syntax="jsligo">

```
(Tezos.constant("exprv547Y7U5wKLbQGmkDU9Coh5tKPzvEJjyUed7px9yGt9nrkELXf") as ((_ps : [string, int]) => int))
(Tezos.constant("exprv547Y7U5wKLbQGmkDU9Coh5tKPzvEJjyUed7px9yGt9nrkELXf") as (_ps : [string, int]) => int)
```

</Syntax>
Expand All @@ -261,7 +261,7 @@ let main (p : string) (s : int) : operation list * int =
<Syntax syntax="jsligo">

```jsligo group=global_call_2
@entry
// @entry
const main = (p: string, s: int) : [list<operation>, int] =>
[ [], Tezos.constant("exprv547Y7U5wKLbQGmkDU9Coh5tKPzvEJjyUed7px9yGt9nrkELXf")([p, s]) ];
```
Expand Down Expand Up @@ -340,7 +340,7 @@ The string returned by `Test.register_constant` can be used via
`Tezos.constant`, as in the examples above.

A simple usage case is the following, in which we obtain a
`michelson_program` by using `Test.eval`:
`michelson_program` by using `Test.Michelson.eval`:

<Syntax syntax="cameligo">

Expand All @@ -352,41 +352,41 @@ module C = struct

let f (x : int) = x * 3 + 2

let ct = Test.register_constant (Test.eval f)
let ct = Test.State.register_constant (Test.Michelson.eval f)

[@entry]
let main (() : parameter) (store : storage) : return =
[], (Tezos.constant ct store)
[], Tezos.constant ct store
end

let test =
let orig = Test.originate (contract_of C) 1 0tez in
let _ = Test.transfer_exn orig.addr (Main ()) 0tez in
assert (Test.get_storage orig.addr = 5)
let orig = Test.Originate.contract (contract_of C) 1 0tez in
let _ = Test.Typed_address.transfer_exn orig.taddr (Main ()) 0tez in
Assert.assert (Test.Typed_address.get_storage orig.taddr = 5)
```

</Syntax>

<Syntax syntax="jsligo">

```jsligo test-ligo group=test_global
namespace C {
type storage = int
type parameter = unit
type storage = int;
type parameter = unit;

const f = (x : int) => x * 3 + 2;
class C {
static f = (x : int) => x * 3 + 2;

const ct = Test.register_constant(Test.eval(f));
static ct = Test.State.register_constant(Test.Michelson.eval(f));

@entry
const main = (p: parameter, s: storage) : [list<operation>, storage] =>
main = (_p: parameter, s: storage) : [list<operation>, storage] =>
[[], Tezos.constant(ct)(s)];
}

const _test = () => {
let orig = Test.originate(contract_of(C), 1, 0tez);
Test.transfer_exn(orig.addr, Main(unit), 0tez);
assert (Test.get_storage(orig.addr) == 5);
let orig = Test.Originate.contract(contract_of(C), 1, 0 as tez);
Test.Typed_address.transfer_exn(orig.taddr, ["Main" as "Main"], 0 as tez);
Assert.assert (Test.Typed_address.get_storage(orig.taddr) == 5);
};

const test = _test();
Expand Down
33 changes: 33 additions & 0 deletions gitlab-pages/docs/advanced/include.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
id: include
title: Including Other Contracts
---

import Syntax from '@theme/Syntax';

<Syntax syntax="cameligo">

Let us say that we have a contract that is getting a too large. If it
has a modular structure, you might find it useful to use the
`#include` statement to split the contract up over multiple files.

You take the code that you want to include and put it in a separate
file, for example the contract names `included`:

```cameligo group=included
(* This is "included.mligo" *)
(* Demonstrate CameLIGO inclusion statements, see includer.mligo *)

let foo = 144
```

And then you can include this code using the `#include` statement like
so:

```cameligo
#include "gitlab-pages/docs/advanced/src/include/included.mligo"

let bar = foo
```

</Syntax>
Loading