Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/Manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,7 @@ <h1><a href="https://github.com/bloomberg/bucklescript">BuckleScript</a> User Ma
<li><a href="#__bs_no_warn_ffi_type">-bs-no-warn-ffi-type</a></li>
<li><a href="#__bs_eval">-bs-eval</a></li>
<li><a href="#__bs_no_builtin_ppx_ml_bs_no_builtin_ppx_mli">-bs-no-builtin-ppx-ml, -bs-no-builtin-ppx-mli</a></li>
<li><a href="#__bs_no_version_header">-bs-no-version-header</a></li>
</ul>
</li>
<li><a href="#_semantics_difference_from_other_backends">Semantics difference from other backends</a>
Expand Down Expand Up @@ -3544,6 +3545,12 @@ <h3 id="__bs_no_builtin_ppx_ml_bs_no_builtin_ppx_mli"><a class="anchor" href="#_
</div>
</div>
</div>
<div class="sect2">
<h3 id="__bs_no_version_header"><a class="anchor" href="#__bs_no_version_header"></a>-bs-no-version-header</h3>
<div class="paragraph">
<p>Don&#8217;t print version header</p>
</div>
</div>
</div>
</div>
<div class="sect1">
Expand Down
54 changes: 53 additions & 1 deletion jscomp/bin/bsdep.ml
Original file line number Diff line number Diff line change
@@ -1,12 +1,64 @@
module Config = Config_bsdep
module Bs_version : sig
#1 "bs_version.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* In addition to the permissions granted to you by the LGPL, you may combine
* or link a "work that uses the Library" with a publicly distributed version
* of this file to produce a combined library or application, then distribute
* that combined work under the terms of your choosing, with no requirement
* to comply with the obligations normally placed on you by section 4 of the
* LGPL version 3 (or the corresponding section of a later version of the LGPL
* should you choose to use a later version).
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

val version : string

val header : string

end = struct
#1 "bs_version.ml"
let version = "1.4.3"

(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* In addition to the permissions granted to you by the LGPL, you may combine
* or link a "work that uses the Library" with a publicly distributed version
* of this file to produce a combined library or application, then distribute
* that combined work under the terms of your choosing, with no requirement
* to comply with the obligations normally placed on you by section 4 of the
* LGPL version 3 (or the corresponding section of a later version of the LGPL
* should you choose to use a later version).
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
let version = "1.4.3"
let header =
"// Generated by BUCKLESCRIPT VERSION 1.4.3, PLEASE EDIT WITH CARE"

end
module Terminfo : sig
#1 "terminfo.mli"
Expand Down
54 changes: 53 additions & 1 deletion jscomp/bin/bsppx.ml
Original file line number Diff line number Diff line change
Expand Up @@ -9178,12 +9178,64 @@ let make_obj ~loc xs =
end
module Bs_version : sig
#1 "bs_version.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* In addition to the permissions granted to you by the LGPL, you may combine
* or link a "work that uses the Library" with a publicly distributed version
* of this file to produce a combined library or application, then distribute
* that combined work under the terms of your choosing, with no requirement
* to comply with the obligations normally placed on you by section 4 of the
* LGPL version 3 (or the corresponding section of a later version of the LGPL
* should you choose to use a later version).
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

val version : string

val header : string

end = struct
#1 "bs_version.ml"
let version = "1.4.3"

(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* In addition to the permissions granted to you by the LGPL, you may combine
* or link a "work that uses the Library" with a publicly distributed version
* of this file to produce a combined library or application, then distribute
* that combined work under the terms of your choosing, with no requirement
* to comply with the obligations normally placed on you by section 4 of the
* LGPL version 3 (or the corresponding section of a later version of the LGPL
* should you choose to use a later version).
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
let version = "1.4.3"
let header =
"// Generated by BUCKLESCRIPT VERSION 1.4.3, PLEASE EDIT WITH CARE"

end
module Ast_ffi_types : sig
#1 "ast_ffi_types.mli"
Expand Down
60 changes: 54 additions & 6 deletions jscomp/bin/whole_compiler.ml
Original file line number Diff line number Diff line change
@@ -1,12 +1,64 @@
module Config = Config_whole_compiler
module Bs_version : sig
#1 "bs_version.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* In addition to the permissions granted to you by the LGPL, you may combine
* or link a "work that uses the Library" with a publicly distributed version
* of this file to produce a combined library or application, then distribute
* that combined work under the terms of your choosing, with no requirement
* to comply with the obligations normally placed on you by section 4 of the
* LGPL version 3 (or the corresponding section of a later version of the LGPL
* should you choose to use a later version).
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

val version : string

val header : string

end = struct
#1 "bs_version.ml"
let version = "1.4.3"

(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* In addition to the permissions granted to you by the LGPL, you may combine
* or link a "work that uses the Library" with a publicly distributed version
* of this file to produce a combined library or application, then distribute
* that combined work under the terms of your choosing, with no requirement
* to comply with the obligations normally placed on you by section 4 of the
* LGPL version 3 (or the corresponding section of a later version of the LGPL
* should you choose to use a later version).
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
let version = "1.4.3"
let header =
"// Generated by BUCKLESCRIPT VERSION 1.4.3, PLEASE EDIT WITH CARE"

end
module Terminfo : sig
#1 "terminfo.mli"
Expand Down Expand Up @@ -82647,10 +82699,6 @@ let es6_program ~output_prefix f ( x : J.deps_program) =
Linguist::FileBlob.new('jscomp/test/test_u.js').generated?
]}
*)
let bs_header =
"// Generated by BUCKLESCRIPT VERSION " ^
Bs_version.version ^
" , PLEASE EDIT WITH CARE"

let pp_deps_program
~output_prefix
Expand All @@ -82659,7 +82707,7 @@ let pp_deps_program
begin
if not !Js_config.no_version_header then
begin
P.string f bs_header;
P.string f Bs_version.header;
P.newline f
end ;
P.string f L.strict_directive;
Expand Down
34 changes: 33 additions & 1 deletion jscomp/build_version.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,39 @@

/**
* This file is used only in dev time, feel free to use es6
*/
var fs = require('fs')
var path = require('path')
var version = JSON.parse(fs.readFileSync('../package.json','utf8')).version

fs.writeFileSync(
path.join(__dirname,'common', 'bs_version.ml'),
"let version = \"" + version + "\"\n",'utf8')
`
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* In addition to the permissions granted to you by the LGPL, you may combine
* or link a "work that uses the Library" with a publicly distributed version
* of this file to produce a combined library or application, then distribute
* that combined work under the terms of your choosing, with no requirement
* to comply with the obligations normally placed on you by section 4 of the
* LGPL version 3 (or the corresponding section of a later version of the LGPL
* should you choose to use a later version).
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
let version = "${version}"
let header =
"// Generated by BUCKLESCRIPT VERSION ${version}, PLEASE EDIT WITH CARE"
`
,'utf8')
27 changes: 27 additions & 0 deletions jscomp/common/bs_version.ml
Original file line number Diff line number Diff line change
@@ -1 +1,28 @@

(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* In addition to the permissions granted to you by the LGPL, you may combine
* or link a "work that uses the Library" with a publicly distributed version
* of this file to produce a combined library or application, then distribute
* that combined work under the terms of your choosing, with no requirement
* to comply with the obligations normally placed on you by section 4 of the
* LGPL version 3 (or the corresponding section of a later version of the LGPL
* should you choose to use a later version).
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
let version = "1.4.3"
let header =
"// Generated by BUCKLESCRIPT VERSION 1.4.3, PLEASE EDIT WITH CARE"

26 changes: 26 additions & 0 deletions jscomp/common/bs_version.mli
Original file line number Diff line number Diff line change
@@ -1 +1,27 @@
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* In addition to the permissions granted to you by the LGPL, you may combine
* or link a "work that uses the Library" with a publicly distributed version
* of this file to produce a combined library or application, then distribute
* that combined work under the terms of your choosing, with no requirement
* to comply with the obligations normally placed on you by section 4 of the
* LGPL version 3 (or the corresponding section of a later version of the LGPL
* should you choose to use a later version).
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

val version : string

val header : string
6 changes: 1 addition & 5 deletions jscomp/core/js_dump.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1830,10 +1830,6 @@ let es6_program ~output_prefix f ( x : J.deps_program) =
Linguist::FileBlob.new('jscomp/test/test_u.js').generated?
]}
*)
let bs_header =
"// Generated by BUCKLESCRIPT VERSION " ^
Bs_version.version ^
" , PLEASE EDIT WITH CARE"

let pp_deps_program
~output_prefix
Expand All @@ -1842,7 +1838,7 @@ let pp_deps_program
begin
if not !Js_config.no_version_header then
begin
P.string f bs_header;
P.string f Bs_version.header;
P.newline f
end ;
P.string f L.strict_directive;
Expand Down
5 changes: 5 additions & 0 deletions site/docsource/Compiler-options.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,8 @@ Another use case is that users can use `-ppx` explicitly as below:
--------------
bsc.exe -c -ppx bsppx.exe -bs-no-builtin-ppx-ml c.ml
--------------


### -bs-no-version-header

Don't print version header
5 changes: 5 additions & 0 deletions site/docsource/Release.1.4.3.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

WIP

# ES6 module support