Small refactoring.
This commit is contained in:
parent
c0f541a803
commit
ee8ff6ce41
@ -1,6 +1,8 @@
|
|||||||
%{
|
%{
|
||||||
(* START HEADER *)
|
(* START HEADER *)
|
||||||
|
|
||||||
|
[@@@warning "-42"]
|
||||||
|
|
||||||
open Region
|
open Region
|
||||||
open AST
|
open AST
|
||||||
|
|
||||||
@ -288,7 +290,7 @@ const_decl:
|
|||||||
var_decl:
|
var_decl:
|
||||||
Var var COLON type_expr ASGNMNT expr {
|
Var var COLON type_expr ASGNMNT expr {
|
||||||
let region = cover $1 (expr_to_region $6) in
|
let region = cover $1 (expr_to_region $6) in
|
||||||
let value = {
|
let value = {
|
||||||
kwd_var = $1;
|
kwd_var = $1;
|
||||||
name = $2;
|
name = $2;
|
||||||
colon = $3;
|
colon = $3;
|
||||||
|
28
dune
28
dune
@ -4,24 +4,14 @@
|
|||||||
(menhir
|
(menhir
|
||||||
(merge_into Parser)
|
(merge_into Parser)
|
||||||
(modules ParToken Parser)
|
(modules ParToken Parser)
|
||||||
(flags -la 1 --explain --external-tokens LexToken)
|
(flags -la 1 --explain --external-tokens LexToken))
|
||||||
)
|
|
||||||
|
|
||||||
(executables
|
(executables
|
||||||
(names LexerMain ParserMain)
|
(names LexerMain ParserMain)
|
||||||
(public_names ligo-lexer ligo-parser)
|
(public_names ligo-lexer ligo-parser)
|
||||||
(package ligo-parser)
|
(package ligo-parser)
|
||||||
(modules_without_implementation
|
(modules_without_implementation Error)
|
||||||
Error
|
(libraries getopt hex str uutf zarith))
|
||||||
)
|
|
||||||
(libraries
|
|
||||||
hex
|
|
||||||
zarith
|
|
||||||
getopt
|
|
||||||
uutf
|
|
||||||
str
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
;; Les deux directives (rule) qui suivent sont pour le dev local.
|
;; Les deux directives (rule) qui suivent sont pour le dev local.
|
||||||
;; Il suffit de faire "dune build Parser.exe" pour avoir un Parser.exe dans le dossier.
|
;; Il suffit de faire "dune build Parser.exe" pour avoir un Parser.exe dans le dossier.
|
||||||
@ -30,15 +20,13 @@
|
|||||||
(targets Parser.exe)
|
(targets Parser.exe)
|
||||||
(deps ParserMain.exe)
|
(deps ParserMain.exe)
|
||||||
(action (copy ParserMain.exe Parser.exe))
|
(action (copy ParserMain.exe Parser.exe))
|
||||||
(mode promote-until-clean)
|
(mode promote-until-clean))
|
||||||
)
|
|
||||||
|
|
||||||
(rule
|
(rule
|
||||||
(targets Lexer.exe)
|
(targets Lexer.exe)
|
||||||
(deps LexerMain.exe)
|
(deps LexerMain.exe)
|
||||||
(action (copy LexerMain.exe Lexer.exe))
|
(action (copy LexerMain.exe Lexer.exe))
|
||||||
(mode promote-until-clean)
|
(mode promote-until-clean))
|
||||||
)
|
|
||||||
|
|
||||||
(rule
|
(rule
|
||||||
(targets .git_main_dir)
|
(targets .git_main_dir)
|
||||||
@ -60,12 +48,10 @@
|
|||||||
(targets Version.gitHEAD)
|
(targets Version.gitHEAD)
|
||||||
(deps .gitHEAD)
|
(deps .gitHEAD)
|
||||||
;; TODO: re-compute .git_main_dir, just in case (since it does not have a dependency on .git)
|
;; TODO: re-compute .git_main_dir, just in case (since it does not have a dependency on .git)
|
||||||
(action (run "sh" "-c" "if git symbolic-ref HEAD >/dev/null 2>&1; then ln -s \"$(cat .git_main_dir)/$(git symbolic-ref HEAD)\" Version.gitHEAD; else ln -s \"$(cat .git_worktree_dir)/HEAD\" Version.gitHEAD; fi"))
|
(action (run "sh" "-c" "if git symbolic-ref HEAD >/dev/null 2>&1; then ln -s \"$(cat .git_main_dir)/$(git symbolic-ref HEAD)\" Version.gitHEAD; else ln -s \"$(cat .git_worktree_dir)/HEAD\" Version.gitHEAD; fi")))
|
||||||
)
|
|
||||||
|
|
||||||
(rule
|
(rule
|
||||||
(targets Version.ml)
|
(targets Version.ml)
|
||||||
(deps Version.gitHEAD)
|
(deps Version.gitHEAD)
|
||||||
(action (run "sh" "-c" "printf 'let version = \"%s\"'\\\\n \"$(cat Version.gitHEAD)\" > Version.ml"))
|
(action (run "sh" "-c" "printf 'let version = \"%s\"'\\\\n \"$(cat Version.gitHEAD)\" > Version.ml"))
|
||||||
(mode promote-until-clean)
|
(mode promote-until-clean))
|
||||||
)
|
|
||||||
|
Loading…
Reference in New Issue
Block a user