Merge branch 'dev' of gitlab.com:ligolang/ligo into feature/doc-pascaligo-loop

This commit is contained in:
Christian Rinderknecht 2020-02-01 15:09:04 +01:00
commit e6119db35a
21 changed files with 12902 additions and 1539 deletions

View File

@ -2,10 +2,14 @@
## [Unreleased]
## [Add crypto reference page to docs](https://gitlab.com/ligolang/ligo/-/merge_requests/370)
### Changed
- Corrected typo in CameLIGO/ReasonLIGO front end where Crypto.blake2b was 'Crypto.black2b'
## [Failwith do not fail](https://gitlab.com/ligolang/ligo/merge_requests/337) - 2020-01-17
### Added
- running failing code in `ligo interpret`, `ligo dry-run`, `ligo run-function` will no longer be an error (return value : 0)
## [1899dfe8d7285580b3aa30fab933ed589f8f1bc5] - 2020-01-08
### Added
- Partial application and OCaml-like currying behavior to CameLIGO & ReasonLIGO

View File

@ -0,0 +1,155 @@
---
id: crypto-reference
title: Crypto
---
## Crypto.blake2b(data: bytes): bytes
Runs the [blake2b hash algorithm](https://en.wikipedia.org/wiki/BLAKE_(hash_function)#BLAKE2)
over the given `bytes` data and returns a `bytes` representing the hash.
<!--DOCUSAURUS_CODE_TABS-->
<!--PascaLIGO-->
```pascaligo
function hasherman_blake (const s: bytes) : bytes is blake2b(s)
```
<!--CameLIGO-->
```cameligo
let hasherman_blake (s: bytes) : bytes = Crypto.blake2b s
```
<!--ReasonLIGO-->
```reasonligo
let hasherman_blake = (s: bytes) => Crypto.blake2b(s);
```
<!--END_DOCUSAURUS_CODE_TABS-->
## Crypto.sha256(data: bytes) : bytes
Runs the [sha256 hash algorithm](https://en.wikipedia.org/wiki/SHA-2) over the given
`bytes` data and returns a `bytes` representing the hash.
<!--DOCUSAURUS_CODE_TABS-->
<!--PascaLIGO-->
```pascaligo
function hasherman (const s : bytes) : bytes is
begin skip end with sha_256(s)
```
<!--CameLIGO-->
```cameligo
let hasherman (s : bytes) : bytes =
Crypto.sha256 s
```
<!--ReasonLIGO-->
```reasonligo
let hasherman = (s: bytes): bytes => Crypto.sha256(s);
```
<!--END_DOCUSAURUS_CODE_TABS-->
## Crypto.sha512(data: bytes) : bytes
Runs the [sha512 hash algorithm](https://en.wikipedia.org/wiki/SHA-2) over the given
`bytes` data and returns a `bytes` representing the hash.
<!--DOCUSAURUS_CODE_TABS-->
<!--PascaLIGO-->
```pascaligo
function hasherman512 (const s: bytes) : bytes is sha_512(s)
```
<!--CameLIGO-->
```cameligo
let hasherman512 (s: bytes) : bytes = Crypto.sha512 s
```
<!--ReasonLIGO-->
```reasonligo
let hasherman512 = (s: bytes) => Crypto.sha512(s);
```
<!--END_DOCUSAURUS_CODE_TABS-->
## Crypto.hash_key(k: key) : key_hash
Hashes a key for easy comparison and storage.
<!--DOCUSAURUS_CODE_TABS-->
<!--PascaLIGO-->
```pascaligo
function check_hash_key (const kh1 : key_hash; const k2 : key) : bool * key_hash is block {
var ret : bool := False ;
var kh2 : key_hash := crypto_hash_key(k2) ;
if kh1 = kh2 then ret := True else skip;
} with (ret, kh2)
```
<!--CameLIGO-->
```cameligo
let check_hash_key (kh1, k2: key_hash * key) : bool * key_hash =
let kh2 : key_hash = Crypto.hash_key k2 in
if kh1 = kh2
then (true, kh2)
else (false, kh2)
```
<!--ReasonLIGO-->
```reasonligo
let check_hash_key = ((kh1, k2): (key_hash, key)) : (bool, key_hash) => {
let kh2 : key_hash = Crypto.hash_key(k2);
if (kh1 == kh2) {
(true, kh2);
}
else {
(false, kh2);
}
};
```
<!--END_DOCUSAURUS_CODE_TABS-->
## Crypto.check(pk: key, signed: signature, data: bytes) : bool
Check that a message has been signed by a particular key.
> ⚠️ There is no way to *generate* a signed message in LIGO. This is because that would require storing a private key on chain, at which point it isn't very private anymore.
<!--DOCUSAURUS_CODE_TABS-->
<!--PascaLIGO-->
```pascaligo
function check_signature
(const pk: key;
const signed: signature;
const msg: bytes) : bool
is crypto_check(pk, signed, msg)
```
<!--CameLIGO-->
```cameligo
let check_signature (pk, signed, msg: key * signature * bytes) : bool =
Crypto.check pk signed msg
```
<!--ReasonLIGO-->
```reasonligo
let check_signature = ((pk, signed, msg): (key, signature, bytes)) : bool => {
Crypto.check(pk, signed, msg);
};
```
<!--END_DOCUSAURUS_CODE_TABS-->

View File

@ -3,8 +3,8 @@ open Cli_expect
let%expect_test _ =
run_ligo_bad [ "compile-contract" ; "../../test/contracts/negative/error_syntax.ligo" ; "main" ] ;
[%expect {|
ligo: : Parse error in file "error_syntax.ligo", line 1, characters 16-17, after "bar" and before "-".
{}
ligo: : Parse error in file "error_syntax.ligo", line 1, characters 16-17, after "bar" and before "-":
15: <syntax error> {}
If you're not sure how to fix this error, you can

View File

@ -23,7 +23,7 @@ module PreIO =
~offsets:true
~mode:`Point
~cmd:EvalOpt.Quiet
~mono:true
~mono:false
end
module Parser =

View File

@ -1,442 +0,0 @@
(* This file was auto-generated based on "Parser.msg". *)
(* Please note that the function [message] can raise [Not_found]. *)
let message =
fun s ->
match s with
| 0 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 1 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 2 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 3 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 4 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 5 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 7 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 49 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 51 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 52 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 53 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 18 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 8 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 9 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 10 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 42 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 43 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 46 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 47 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 33 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 478 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 27 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 31 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 28 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 35 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 12 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 16 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 6 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 13 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 61 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 133 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 379 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 381 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 472 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 169 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 134 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 136 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 137 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 153 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 380 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 63 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 142 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 143 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 128 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 145 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 72 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 94 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 106 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 95 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 108 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 109 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 110 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 73 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 91 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 93 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 92 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 90 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 77 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 78 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 65 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 66 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 67 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 120 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 121 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 124 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 125 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 147 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 148 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 149 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 157 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 156 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 481 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 483 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 221 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 246 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 223 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 225 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 219 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 230 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 259 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 260 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 247 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 268 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 232 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 261 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 262 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 270 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 272 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 274 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 276 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 278 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 195 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 263 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 289 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 292 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 249 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 297 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 266 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 160 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 164 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 445 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 337 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 317 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 447 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 319 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 320 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 321 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 448 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 462 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 463 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 449 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 450 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 452 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 451 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 453 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 454 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 455 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 457 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 333 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 335 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 339 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 336 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 334 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 345 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 346 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 348 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 347 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 349 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 350 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 351 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 373 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 352 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 354 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 458 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 460 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 464 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 446 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 316 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 444 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 165 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 167 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 168 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 172 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 171 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 163 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 465 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 467 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 468 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 166 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 239 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 240 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 243 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 244 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 441 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 173 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 428 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 429 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 174 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 175 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 434 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 435 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 438 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 439 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 427 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 421 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 422 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 423 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 177 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 308 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 309 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 412 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 419 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 411 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 310 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 312 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 324 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 325 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 326 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 327 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 329 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 328 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 330 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 331 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 332 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 384 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 385 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 387 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 340 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 314 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 311 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 401 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 402 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 404 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 403 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 405 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 406 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 407 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 415 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 408 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 410 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 178 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 179 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 182 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 183 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 186 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 306 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 304 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 188 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 190 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 191 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 192 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 193 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 198 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 218 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 197 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 214 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| _ ->
raise Not_found

View File

@ -69,3 +69,104 @@
(targets all.mligo)
(deps (:script_cover ../../../../vendors/ligo-utils/simple-utils/cover.sh) Parser.mly LexToken.mli ParToken.mly Parser.msg Unlexer.exe)
(action (run %{script_cover} --lex-tokens=LexToken.mli --par-tokens=ParToken.mly --ext=mligo --unlexer=./Unlexer.exe --messages=Parser.msg --dir=. --concatenate Parser.mly )))
;; Error messages
;; Generate error messages from scratch
; (rule
; (targets error.messages)
; (deps Parser.mly ParToken.mly error.messages.checked-in)
; (action
; (with-stdout-to %{targets}
; (bash
; "menhir \
; --unused-tokens \
; --list-errors \
; --table \
; --strict \
; --external-tokens LexToken.mli \
; --base Parser.mly \
; ParToken.mly \
; Parser.mly
; "
; )
; ))
; )
(rule
(targets error.messages)
(deps Parser.mly ParToken.mly error.messages.checked-in LexToken.mli)
(action
(with-stdout-to %{targets}
(run
menhir
--unused-tokens
--update-errors error.messages.checked-in
--table
--strict
--external-tokens LexToken.mli
--base Parser.mly
ParToken.mly
Parser.mly
)
))
)
(rule
(target error.messages.new)
(action
(with-stdout-to %{target}
(run
menhir
--unused-tokens
--list-errors
--table
--strict
--external-tokens LexToken.mli
--base Parser.mly
ParToken.mly
Parser.mly
)
)
)
)
(alias
(name runtest)
(deps error.messages error.messages.new)
(action
(run
menhir
--unused-tokens
--table
--strict
--external-tokens LexToken.mli
--base Parser.mly
ParToken.mly
Parser.mly
--compare-errors error.messages.new
--compare-errors error.messages
)
)
)
(rule
(targets ParErr.ml)
(deps Parser.mly ParToken.mly error.messages.checked-in LexToken.mli)
(action
(with-stdout-to %{targets}
(run
menhir
--unused-tokens
--table
--strict
--external-tokens LexToken.mli
--base Parser.mly
ParToken.mly
Parser.mly
--compile-errors error.messages.checked-in
)
))
)

File diff suppressed because it is too large Load Diff

View File

@ -23,7 +23,7 @@ module PreIO =
~offsets:true
~mode:`Point
~cmd:EvalOpt.Quiet
~mono:true
~mono:false
end
module Parser =

View File

@ -1,546 +0,0 @@
(* This file was auto-generated based on "Parser.msg". *)
(* Please note that the function [message] can raise [Not_found]. *)
let message =
fun s ->
match s with
| 0 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 1 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 2 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 3 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 25 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 5 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 7 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 8 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 48 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 9 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 10 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 52 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 53 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 56 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 57 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 59 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 11 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 12 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 20 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 21 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 13 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 6 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 61 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 34 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 15 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 64 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 543 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 29 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 32 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 541 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 35 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 26 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 39 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 27 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 18 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 67 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 68 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 84 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 85 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 86 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 87 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 514 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 373 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 374 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 507 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 377 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 375 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 376 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 378 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 379 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 380 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 381 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 382 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 484 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 485 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 486 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 487 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 504 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 511 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 510 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 386 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 387 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 388 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 389 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 393 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 395 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 397 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 398 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 402 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 399 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 400 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 404 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 408 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 405 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 406 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 390 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 396 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 413 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 414 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 415 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 500 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 501 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 502 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 416 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 496 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 417 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 461 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 456 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 462 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 418 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 419 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 425 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 429 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 430 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 420 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 433 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 434 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 435 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 422 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 424 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 444 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 445 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 446 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 449 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 450 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 478 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 479 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 482 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 481 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 447 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 476 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 448 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 437 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 438 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 439 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 440 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 441 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 536 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 515 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 516 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 517 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 518 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 519 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 520 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 529 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 532 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 524 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 525 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 547 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 181 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 549 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 159 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 172 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 188 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 189 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 180 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 195 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 174 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 190 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 191 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 197 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 199 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 201 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 203 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 205 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 182 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 192 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 179 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 185 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 209 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 91 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 342 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 343 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 346 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 347 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 371 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 366 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 368 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 92 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 93 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 362 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 94 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 95 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 144 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 145 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 148 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 149 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 364 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 96 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 158 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 100 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 217 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 218 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 220 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 221 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 224 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 225 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 358 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 353 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 355 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 101 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 102 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 350 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 336 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 338 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 103 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 332 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 330 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 333 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 334 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 328 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 156 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 105 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 320 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 321 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 322 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 323 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 324 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 137 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 138 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 139 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 140 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 151 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 106 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 107 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 309 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 310 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 154 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 177 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 312 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 315 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 316 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 133 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 108 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 69 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 70 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 71 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 72 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 79 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 80 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 75 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 76 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 77 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 109 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 110 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 111 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 112 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 114 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 117 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 230 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 231 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 269 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 293 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 270 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 272 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 273 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 294 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 300 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 299 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 303 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 302 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 240 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 283 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 284 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 287 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 288 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 291 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 277 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 279 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 241 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 266 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 267 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 275 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 263 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 232 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 297 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 233 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 245 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 246 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 262 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 247 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 248 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 256 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 118 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 122 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 228 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 123 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 130 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| _ ->
raise Not_found

View File

@ -69,3 +69,105 @@
(targets all.ligo)
(deps (:script_cover ../../../../vendors/ligo-utils/simple-utils/cover.sh) Parser.mly LexToken.mli ParToken.mly Parser.msg Unlexer.exe)
(action (run %{script_cover} --lex-tokens=LexToken.mli --par-tokens=ParToken.mly --ext=ligo --unlexer=./Unlexer.exe --messages=Parser.msg --dir=. --concatenate Parser.mly)))
;; Error messages
;; Generate error messages from scratch
; (rule
; (targets error.messages)
; (deps Parser.mly ParToken.mly error.messages.checked-in)
; (action
; (with-stdout-to %{targets}
; (bash
; "menhir \
; --unused-tokens \
; --list-errors \
; --table \
; --strict \
; --external-tokens LexToken.mli \
; --base Parser.mly \
; ParToken.mly \
; Parser.mly
; "
; )
; ))
; )
(rule
(targets error.messages)
(deps Parser.mly ParToken.mly error.messages.checked-in LexToken.mli)
(action
(with-stdout-to %{targets}
(run
menhir
--unused-tokens
--update-errors error.messages.checked-in
--table
--strict
--external-tokens LexToken.mli
--base Parser.mly
ParToken.mly
Parser.mly
)
))
)
(rule
(target error.messages.new)
(action
(with-stdout-to %{target}
(run
menhir
--unused-tokens
--list-errors
--table
--strict
--external-tokens LexToken.mli
--base Parser.mly
ParToken.mly
Parser.mly
)
)
)
)
(alias
(name runtest)
(deps error.messages error.messages.new)
(action
(run
menhir
--unused-tokens
--table
--strict
--external-tokens LexToken.mli
--base Parser.mly
ParToken.mly
Parser.mly
--compare-errors error.messages.new
--compare-errors error.messages
)
)
)
(rule
(targets ParErr.ml)
(deps Parser.mly ParToken.mly error.messages.checked-in LexToken.mli)
(action
(with-stdout-to %{targets}
(run
menhir
--unused-tokens
--table
--strict
--external-tokens LexToken.mli
--base Parser.mly
ParToken.mly
Parser.mly
--compile-errors error.messages.checked-in
)
))
)

File diff suppressed because it is too large Load Diff

View File

@ -26,7 +26,7 @@ module PreIO =
~offsets:true
~mode:`Point
~cmd:EvalOpt.Quiet
~mono:true
~mono:false
end
module Parser =

View File

@ -1,542 +0,0 @@
(* This file was auto-generated based on "Parser.msg". *)
(* Please note that the function [message] can raise [Not_found]. *)
let message =
fun s ->
match s with
| 0 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 1 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 2 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 3 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 4 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 5 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 55 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 6 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 52 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 54 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 7 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 38 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 8 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 9 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 32 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 36 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 35 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 10 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 31 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 11 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 544 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 61 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 48 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 12 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 19 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 20 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 43 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 46 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 49 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 13 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 14 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 65 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 70 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 540 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 185 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 186 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 184 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 302 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 304 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 303 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 66 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 69 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 64 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 183 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 311 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 313 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 312 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 191 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 192 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 118 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 298 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 300 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 299 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 132 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 195 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 158 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 165 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 127 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 145 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 147 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 148 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 146 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 128 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 133 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 120 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 121 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 122 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 172 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 307 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 309 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 308 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 173 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 176 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 177 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 197 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 199 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 198 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 59 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 547 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 225 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 549 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 223 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 257 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 255 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 256 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 237 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 242 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 259 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 261 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 262 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 265 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 226 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 233 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 234 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 267 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 269 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 271 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 273 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 201 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 202 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 213 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 222 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 206 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 214 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 215 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 203 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 204 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 205 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 263 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 284 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 240 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 286 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 72 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 499 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 500 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 427 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 161 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 162 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 160 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 502 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 503 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 520 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 529 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 514 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 515 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 513 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 504 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 505 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 506 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 508 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 509 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 510 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 511 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 525 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 526 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 507 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 536 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 534 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 501 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 376 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 370 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 371 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 373 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 372 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 369 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 76 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 450 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 326 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 332 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 333 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 336 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 337 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 328 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 339 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 100 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 78 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 80 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 315 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 316 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 117 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 82 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 452 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 453 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 455 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 456 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 200 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 236 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 79 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 483 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 484 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 492 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 493 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 495 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 496 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 485 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 486 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 81 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 476 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 477 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 461 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 458 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 464 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 465 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 470 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 474 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 473 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 469 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 459 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 463 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 340 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 341 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 346 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 347 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 348 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 349 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 350 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 360 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 364 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 363 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 357 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 359 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 342 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 343 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 344 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 84 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 85 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 318 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 323 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 324 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 393 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 440 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 441 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 442 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 443 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 444 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 445 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 439 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 325 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 366 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 367 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 377 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 378 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 417 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 424 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 412 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 413 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 411 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 379 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 380 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 381 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 406 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 407 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 408 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 409 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 421 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 422 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 405 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 433 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 431 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 368 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 388 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 389 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 387 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 382 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 383 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 384 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 398 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 399 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 400 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 401 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 403 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 402 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 397 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 320 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 321 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 86 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 87 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 88 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 89 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 90 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 91 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 96 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 97 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 98 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 111 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| 244 ->
"<YOUR SYNTAX ERROR MESSAGE HERE>\n"
| _ ->
raise Not_found

View File

@ -71,3 +71,104 @@
(targets all.religo)
(deps (:script_cover ../../../../vendors/ligo-utils/simple-utils/cover.sh) Parser.mly LexToken.mli ParToken.mly Parser.msg Unlexer.exe)
(action (run %{script_cover} --lex-tokens=LexToken.mli --par-tokens=ParToken.mly --ext=religo --unlexer=./Unlexer.exe --messages=Parser.msg --dir=. --concatenate Parser.mly )))
;; Error messages
;; Generate error messages from scratch
; (rule
; (targets error.messages)
; (deps Parser.mly ParToken.mly error.messages.checked-in)
; (action
; (with-stdout-to %{targets}
; (bash
; "menhir \
; --unused-tokens \
; --list-errors \
; --table \
; --strict \
; --external-tokens LexToken.mli \
; --base Parser.mly \
; ParToken.mly \
; Parser.mly
; "
; )
; ))
; )
(rule
(targets error.messages)
(deps Parser.mly ParToken.mly error.messages.checked-in LexToken.mli)
(action
(with-stdout-to %{targets}
(run
menhir
--unused-tokens
--update-errors error.messages.checked-in
--table
--strict
--external-tokens LexToken.mli
--base Parser.mly
ParToken.mly
Parser.mly
)
))
)
(rule
(target error.messages.new)
(action
(with-stdout-to %{target}
(run
menhir
--unused-tokens
--list-errors
--table
--strict
--external-tokens LexToken.mli
--base Parser.mly
ParToken.mly
Parser.mly
)
)
)
)
(alias
(name runtest)
(deps error.messages error.messages.new)
(action
(run
menhir
--unused-tokens
--table
--strict
--external-tokens LexToken.mli
--base Parser.mly
ParToken.mly
Parser.mly
--compare-errors error.messages.new
--compare-errors error.messages
)
)
)
(rule
(targets ParErr.ml)
(deps Parser.mly ParToken.mly error.messages.checked-in LexToken.mli)
(action
(with-stdout-to %{targets}
(run
menhir
--unused-tokens
--table
--strict
--external-tokens LexToken.mli
--base Parser.mly
ParToken.mly
Parser.mly
--compile-errors error.messages.checked-in
)
))
)

File diff suppressed because it is too large Load Diff

View File

@ -110,6 +110,11 @@ module Make (IO : IO)
let failure get_win checkpoint =
let message = ParErr.message (state checkpoint) in
let message = if message = "<YOUR SYNTAX ERROR MESSAGE HERE>\n" then
(string_of_int (state checkpoint)) ^ ": <syntax error>"
else
message
in
match get_win () with
Lexer.Nil -> assert false
| Lexer.One invalid ->

View File

@ -162,7 +162,7 @@ module Simplify = struct
| "failwith" -> ok C_FAILWITH
| "Crypto.hash" -> ok C_HASH
| "Crypto.black2b" -> ok C_BLAKE2b
| "Crypto.blake2b" -> ok C_BLAKE2b
| "Crypto.sha256" -> ok C_SHA256
| "Crypto.sha512" -> ok C_SHA512
| "Crypto.hash_key" -> ok C_HASH_KEY

View File

@ -0,0 +1,3 @@
function hasherman512 (const s: bytes) : bytes is sha_512(s)
function hasherman_blake (const s: bytes) : bytes is blake2b(s)

View File

@ -0,0 +1,2 @@
let hasherman512 (s: bytes) : bytes = Crypto.sha512 s
let hasherman_blake (s: bytes) : bytes = Crypto.blake2b s

View File

@ -0,0 +1,2 @@
let hasherman512 = (s: bytes) => Crypto.sha512(s);
let hasherman_blake = (s: bytes) => Crypto.blake2b(s);

View File

@ -428,6 +428,48 @@ let bytes_arithmetic () : unit result =
let%bind () = Assert.assert_fail @@ Ast_simplified.Misc.assert_value_eq (b3 , b1) in
ok ()
let crypto () : unit result =
let%bind program = type_file "./contracts/crypto.ligo" in
let%bind foo = e_bytes_hex "0f00" in
let%bind foototo = e_bytes_hex "0f007070" in
let%bind b1 = Test_helpers.run_typed_program_with_simplified_input program "hasherman512" foo in
let%bind () = expect_eq program "hasherman512" foo b1 in
let%bind b2 = Test_helpers.run_typed_program_with_simplified_input program "hasherman512" foototo in
let%bind () = Assert.assert_fail @@ Ast_simplified.Misc.assert_value_eq (b2 , b1) in
let%bind b4 = Test_helpers.run_typed_program_with_simplified_input program "hasherman_blake" foo in
let%bind () = expect_eq program "hasherman_blake" foo b4 in
let%bind b5 = Test_helpers.run_typed_program_with_simplified_input program "hasherman_blake" foototo in
let%bind () = Assert.assert_fail @@ Ast_simplified.Misc.assert_value_eq (b5 , b4) in
ok ()
let crypto_mligo () : unit result =
let%bind program = mtype_file "./contracts/crypto.mligo" in
let%bind foo = e_bytes_hex "0f00" in
let%bind foototo = e_bytes_hex "0f007070" in
let%bind b1 = Test_helpers.run_typed_program_with_simplified_input program "hasherman512" foo in
let%bind () = expect_eq program "hasherman512" foo b1 in
let%bind b2 = Test_helpers.run_typed_program_with_simplified_input program "hasherman512" foototo in
let%bind () = Assert.assert_fail @@ Ast_simplified.Misc.assert_value_eq (b2 , b1) in
let%bind b4 = Test_helpers.run_typed_program_with_simplified_input program "hasherman_blake" foo in
let%bind () = expect_eq program "hasherman_blake" foo b4 in
let%bind b5 = Test_helpers.run_typed_program_with_simplified_input program "hasherman_blake" foototo in
let%bind () = Assert.assert_fail @@ Ast_simplified.Misc.assert_value_eq (b5 , b4) in
ok ()
let crypto_religo () : unit result =
let%bind program = retype_file "./contracts/crypto.religo" in
let%bind foo = e_bytes_hex "0f00" in
let%bind foototo = e_bytes_hex "0f007070" in
let%bind b1 = Test_helpers.run_typed_program_with_simplified_input program "hasherman512" foo in
let%bind () = expect_eq program "hasherman512" foo b1 in
let%bind b2 = Test_helpers.run_typed_program_with_simplified_input program "hasherman512" foototo in
let%bind () = Assert.assert_fail @@ Ast_simplified.Misc.assert_value_eq (b2 , b1) in
let%bind b4 = Test_helpers.run_typed_program_with_simplified_input program "hasherman_blake" foo in
let%bind () = expect_eq program "hasherman_blake" foo b4 in
let%bind b5 = Test_helpers.run_typed_program_with_simplified_input program "hasherman_blake" foototo in
let%bind () = Assert.assert_fail @@ Ast_simplified.Misc.assert_value_eq (b5 , b4) in
ok ()
let bytes_arithmetic_mligo () : unit result =
let%bind program = mtype_file "./contracts/bytes_arithmetic.mligo" in
let%bind foo = e_bytes_hex "0f00" in
@ -2189,8 +2231,7 @@ let main = test_suite "Integration (End to End)" [
test "bool (religo)" bool_expression_religo ;
test "arithmetic" arithmetic ;
test "arithmetic (mligo)" arithmetic_mligo ;
test "arithmetic (religo)" arithmetic_religo ;
test "bitwise_arithmetic" bitwise_arithmetic ;
test "arithmetic (religo)" arithmetic_religo ; test "bitwise_arithmetic" bitwise_arithmetic ;
test "bitwise_arithmetic (mligo)" bitwise_arithmetic_mligo;
test "bitwise_arithmetic (religo)" bitwise_arithmetic_religo;
test "string_arithmetic" string_arithmetic ;
@ -2199,6 +2240,9 @@ let main = test_suite "Integration (End to End)" [
test "bytes_arithmetic" bytes_arithmetic ;
test "bytes_arithmetic (mligo)" bytes_arithmetic_mligo ;
test "bytes_arithmetic (religo)" bytes_arithmetic_religo ;
test "crypto" crypto ;
test "crypto (mligo)" crypto_mligo ;
test "crypto (religo)" crypto_religo ;
test "set_arithmetic" set_arithmetic ;
test "set_arithmetic (mligo)" set_arithmetic_mligo ;
test "set_arithmetic (religo)" set_arithmetic_religo ;