2020-11-23 11:22:47 +03:00
|
|
|
(library
|
|
|
|
(name surface)
|
2021-04-29 18:05:53 +03:00
|
|
|
(public_name catala.surface)
|
2021-04-22 12:57:50 +03:00
|
|
|
(libraries
|
2022-11-21 12:46:17 +03:00
|
|
|
catala_utils
|
2021-04-22 12:57:50 +03:00
|
|
|
menhirLib
|
|
|
|
sedlex
|
|
|
|
re
|
|
|
|
zarith
|
|
|
|
zarith_stubs_js
|
2022-11-07 15:50:28 +03:00
|
|
|
shared_ast)
|
2020-11-23 11:22:47 +03:00
|
|
|
(preprocess
|
2021-01-20 18:06:04 +03:00
|
|
|
(pps sedlex.ppx visitors.ppx)))
|
2020-11-23 11:22:47 +03:00
|
|
|
|
2021-08-19 19:26:06 +03:00
|
|
|
(rule
|
|
|
|
(with-stdout-to
|
|
|
|
lexer_en.ml
|
|
|
|
(run %{bin:cppo} %{dep:lexer_en.cppo.ml} %{dep:lexer.cppo.ml})))
|
|
|
|
|
|
|
|
(rule
|
|
|
|
(with-stdout-to
|
|
|
|
lexer_fr.ml
|
|
|
|
(run %{bin:cppo} %{dep:lexer_fr.cppo.ml} %{dep:lexer.cppo.ml})))
|
|
|
|
|
|
|
|
(rule
|
|
|
|
(with-stdout-to
|
|
|
|
lexer_pl.ml
|
|
|
|
(run %{bin:cppo} %{dep:lexer_pl.cppo.ml} %{dep:lexer.cppo.ml})))
|
|
|
|
|
2020-03-08 02:21:55 +03:00
|
|
|
(menhir
|
2021-04-29 19:40:29 +03:00
|
|
|
(modules tokens)
|
|
|
|
(flags --only-tokens))
|
|
|
|
|
|
|
|
(menhir
|
|
|
|
(modules tokens parser)
|
|
|
|
(merge_into parser)
|
2021-08-19 12:19:45 +03:00
|
|
|
(flags --external-tokens Tokens --table --explain))
|
2020-11-25 13:53:56 +03:00
|
|
|
|
2022-08-01 20:29:34 +03:00
|
|
|
(rule
|
|
|
|
(target grammar.html)
|
|
|
|
(action
|
2023-03-30 16:30:08 +03:00
|
|
|
(run obelisk html -i -o %{target} %{dep:parser.mly})))
|
2022-08-01 20:29:34 +03:00
|
|
|
|
2020-11-25 13:53:56 +03:00
|
|
|
(documentation
|
2020-12-14 17:23:04 +03:00
|
|
|
(package catala)
|
|
|
|
(mld_files surface))
|
2021-02-12 19:29:45 +03:00
|
|
|
|
|
|
|
;; No built-in support for Menhir's parser messages yet
|
|
|
|
|
2021-02-17 12:57:48 +03:00
|
|
|
(rule
|
|
|
|
(with-stdout-to
|
|
|
|
parser.messages.new
|
2021-05-14 19:44:06 +03:00
|
|
|
(run
|
|
|
|
menhir
|
|
|
|
%{dep:tokens.mly}
|
|
|
|
%{dep:parser.mly}
|
|
|
|
--base
|
|
|
|
parser
|
|
|
|
--list-errors)))
|
2021-02-17 12:57:48 +03:00
|
|
|
|
2021-02-12 19:29:45 +03:00
|
|
|
(rule
|
|
|
|
(with-stdout-to
|
|
|
|
parser_errors.ml
|
2021-05-14 19:44:06 +03:00
|
|
|
(run
|
|
|
|
menhir
|
|
|
|
%{dep:tokens.mly}
|
|
|
|
%{dep:parser.mly}
|
|
|
|
--base
|
|
|
|
parser
|
|
|
|
--compile-errors
|
|
|
|
%{dep:parser.messages})))
|
2021-02-12 19:29:45 +03:00
|
|
|
|
|
|
|
(rule
|
|
|
|
(with-stdout-to
|
|
|
|
parser.messages.updated
|
2021-05-14 19:44:06 +03:00
|
|
|
(run
|
|
|
|
menhir
|
|
|
|
%{dep:tokens.mly}
|
|
|
|
%{dep:parser.mly}
|
|
|
|
--base
|
|
|
|
parser
|
|
|
|
--update-errors
|
|
|
|
%{dep:parser.messages})))
|
2021-02-12 19:29:45 +03:00
|
|
|
|
|
|
|
(rule
|
|
|
|
(alias update-parser-messages)
|
|
|
|
(action
|
|
|
|
(diff parser.messages parser.messages.updated)))
|
2021-02-17 12:57:48 +03:00
|
|
|
|
|
|
|
(rule
|
|
|
|
(alias create-parser-messages)
|
|
|
|
(action
|
|
|
|
(diff parser.messages parser.messages.new)))
|