Merge branch 'rinderknecht@cover' into 'dev'
cover.sh --messages .... See merge request ligolang/ligo!312
This commit is contained in:
commit
3fecff3a60
25
vendors/ligo-utils/simple-utils/cover.sh
vendored
25
vendors/ligo-utils/simple-utils/cover.sh
vendored
@ -87,6 +87,15 @@ while : ; do
|
||||
no_eq=$1
|
||||
break
|
||||
;;
|
||||
--messages=*)
|
||||
if test -n "$messages"; then
|
||||
fatal_error "Repeated option --messages."; fi
|
||||
messages=$(expr "$1" : "[^=]*=\(.*\)")
|
||||
;;
|
||||
--messages)
|
||||
no_eq=$1
|
||||
break
|
||||
;;
|
||||
-h | --help | -help)
|
||||
help=yes
|
||||
;;
|
||||
@ -113,6 +122,7 @@ usage () {
|
||||
Usage: $(basename $0) [-h|--help]
|
||||
--par-tokens=<par_tokens>.mly
|
||||
--lex-tokens=<lex_tokens>.mli
|
||||
--messages=<parser>.msg
|
||||
--unlexer=<binary>
|
||||
--ext=<extension>
|
||||
--dir=<path>
|
||||
@ -135,6 +145,7 @@ Display control:
|
||||
Mandatory options:
|
||||
--lex-tokens=<name>.mli the lexical tokens
|
||||
--par-tokens=<name>.mly the syntactical tokens
|
||||
--messages=<parser>.msg the complete errors messages
|
||||
--ext=EXT Unix file extension for the
|
||||
generated LIGO files
|
||||
(no starting period)
|
||||
@ -160,6 +171,9 @@ fi
|
||||
|
||||
# Checking options
|
||||
|
||||
if test -z "$messages"; then
|
||||
fatal_error "Messages not found (use --messages)."; fi
|
||||
|
||||
if test -z "$unlexer"; then
|
||||
fatal_error "Unlexer binary not found (use --unlexer)."; fi
|
||||
|
||||
@ -172,6 +186,9 @@ if test -z "$par_tokens"; then
|
||||
if test -z "$lex_tokens"; then
|
||||
fatal_error "No lexical tokens specification (use --lex-tokens)."; fi
|
||||
|
||||
if test ! -e "$messages"; then
|
||||
fatal_error "Error messages \"$messages\" not found (use messages.sh)."; fi
|
||||
|
||||
if test ! -e "$parser"; then
|
||||
fatal_error "Parser specification \"$parser\" not found."; fi
|
||||
|
||||
@ -218,12 +235,6 @@ if test "$ext_start" != "0"
|
||||
then fatal_error "LIGO extensions must not start with a period."
|
||||
fi
|
||||
|
||||
# Checking the presence of the messages
|
||||
|
||||
msg=$parser_base.msg
|
||||
if test ! -e $msg; then
|
||||
fatal_error "File $msg not found."; fi
|
||||
|
||||
# ====================================================================
|
||||
# Menhir's flags
|
||||
|
||||
@ -233,7 +244,7 @@ flags="--table --strict --external-tokens $lex_tokens_base \
|
||||
# ====================================================================
|
||||
# Producing erroneous sentences from Menhir's error messages
|
||||
|
||||
msg=$parser_base.msg
|
||||
msg=$messages
|
||||
raw=$parser_base.msg.raw
|
||||
printf "Making $raw from $msg... "
|
||||
menhir --echo-errors $parser_base.msg $flags $mly > $raw 2>/dev/null
|
||||
|
Loading…
Reference in New Issue
Block a user