Small refactoring.
This commit is contained in:
parent
c0f541a803
commit
ee8ff6ce41
@ -1,6 +1,8 @@
|
||||
%{
|
||||
(* START HEADER *)
|
||||
|
||||
[@@@warning "-42"]
|
||||
|
||||
open Region
|
||||
open AST
|
||||
|
||||
@ -288,7 +290,7 @@ const_decl:
|
||||
var_decl:
|
||||
Var var COLON type_expr ASGNMNT expr {
|
||||
let region = cover $1 (expr_to_region $6) in
|
||||
let value = {
|
||||
let value = {
|
||||
kwd_var = $1;
|
||||
name = $2;
|
||||
colon = $3;
|
||||
|
28
dune
28
dune
@ -4,24 +4,14 @@
|
||||
(menhir
|
||||
(merge_into Parser)
|
||||
(modules ParToken Parser)
|
||||
(flags -la 1 --explain --external-tokens LexToken)
|
||||
)
|
||||
(flags -la 1 --explain --external-tokens LexToken))
|
||||
|
||||
(executables
|
||||
(names LexerMain ParserMain)
|
||||
(public_names ligo-lexer ligo-parser)
|
||||
(package ligo-parser)
|
||||
(modules_without_implementation
|
||||
Error
|
||||
)
|
||||
(libraries
|
||||
hex
|
||||
zarith
|
||||
getopt
|
||||
uutf
|
||||
str
|
||||
)
|
||||
)
|
||||
(modules_without_implementation Error)
|
||||
(libraries getopt hex str uutf zarith))
|
||||
|
||||
;; 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.
|
||||
@ -30,15 +20,13 @@
|
||||
(targets Parser.exe)
|
||||
(deps ParserMain.exe)
|
||||
(action (copy ParserMain.exe Parser.exe))
|
||||
(mode promote-until-clean)
|
||||
)
|
||||
(mode promote-until-clean))
|
||||
|
||||
(rule
|
||||
(targets Lexer.exe)
|
||||
(deps LexerMain.exe)
|
||||
(action (copy LexerMain.exe Lexer.exe))
|
||||
(mode promote-until-clean)
|
||||
)
|
||||
(mode promote-until-clean))
|
||||
|
||||
(rule
|
||||
(targets .git_main_dir)
|
||||
@ -60,12 +48,10 @@
|
||||
(targets Version.gitHEAD)
|
||||
(deps .gitHEAD)
|
||||
;; 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
|
||||
(targets Version.ml)
|
||||
(deps Version.gitHEAD)
|
||||
(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