瀏覽代碼

Rename --neko-lib to --neko-lib-path

tobil4sk 2 年之前
父節點
當前提交
9a75023c44
共有 4 個文件被更改,包括 7 次插入7 次删除
  1. 3 3
      src/compiler/args.ml
  2. 1 1
      src/compiler/compiler.ml
  3. 2 2
      src/context/common.ml
  4. 1 1
      src/generators/genneko.ml

+ 3 - 3
src/compiler/args.ml

@@ -198,9 +198,9 @@ let parse_args com =
 		("Target-specific",["--swf-lib"],["-swf-lib"],Arg.String (fun file ->
 		("Target-specific",["--swf-lib"],["-swf-lib"],Arg.String (fun file ->
 			add_native_lib file false;
 			add_native_lib file false;
 		),"<file>","add the SWF library to the compiled SWF");
 		),"<file>","add the SWF library to the compiled SWF");
-		("Target-specific",["--neko-lib"],[],Arg.String (fun file ->
-			com.neko_libs <- file :: com.neko_libs
-		),"<file>","add the neko library");
+		("Target-specific",["--neko-lib-path"],[],Arg.String (fun dir ->
+			com.neko_lib_paths <- dir :: com.neko_lib_paths
+		),"<directory>","add the neko library path");
 		("Target-specific",["--swf-lib-extern"],["-swf-lib-extern"],Arg.String (fun file ->
 		("Target-specific",["--swf-lib-extern"],["-swf-lib-extern"],Arg.String (fun file ->
 			add_native_lib file true;
 			add_native_lib file true;
 		),"<file>","use the SWF library for type checking");
 		),"<file>","use the SWF library for type checking");

+ 1 - 1
src/compiler/compiler.ml

@@ -481,7 +481,7 @@ module HighLevel = struct
 					"-cp" :: l :: acc
 					"-cp" :: l :: acc
 				else match (try ExtString.String.split l " " with _ -> l, "") with
 				else match (try ExtString.String.split l " " with _ -> l, "") with
 				| ("-L",dir) ->
 				| ("-L",dir) ->
-					"--neko-lib" :: (String.sub l 3 (String.length l - 3)) :: acc
+					"--neko-lib-path" :: (String.sub l 3 (String.length l - 3)) :: acc
 				| param, value ->
 				| param, value ->
 					let acc = if value <> "" then value :: acc else acc in
 					let acc = if value <> "" then value :: acc else acc in
 					let acc = param :: acc in
 					let acc = param :: acc in

+ 2 - 2
src/context/common.ml

@@ -402,7 +402,7 @@ type context = {
 	mutable resources : (string,string) Hashtbl.t;
 	mutable resources : (string,string) Hashtbl.t;
 	(* target-specific *)
 	(* target-specific *)
 	mutable flash_version : float;
 	mutable flash_version : float;
-	mutable neko_libs : string list;
+	mutable neko_lib_paths : string list;
 	mutable include_files : (string * string) list;
 	mutable include_files : (string * string) list;
 	mutable native_libs : native_libraries;
 	mutable native_libs : native_libraries;
 	mutable net_std : string list;
 	mutable net_std : string list;
@@ -820,7 +820,7 @@ let create compilation_step cs version args =
 		native_libs = create_native_libs();
 		native_libs = create_native_libs();
 		net_path_map = Hashtbl.create 0;
 		net_path_map = Hashtbl.create 0;
 		c_args = [];
 		c_args = [];
-		neko_libs = [];
+		neko_lib_paths = [];
 		include_files = [];
 		include_files = [];
 		js_gen = None;
 		js_gen = None;
 		load_extern_type = [];
 		load_extern_type = [];

+ 1 - 1
src/generators/genneko.ml

@@ -801,7 +801,7 @@ let build ctx types =
 let generate com =
 let generate com =
 	Hashtbl.clear files;
 	Hashtbl.clear files;
 	let ctx = new_context com (if Common.defined com Define.NekoV1 then 1 else 2) false in
 	let ctx = new_context com (if Common.defined com Define.NekoV1 then 1 else 2) false in
-	let libs = (EBlock (generate_libs_init com.neko_libs) , { psource = "<header>"; pline = 1; }) in
+	let libs = (EBlock (generate_libs_init com.neko_lib_paths) , { psource = "<header>"; pline = 1; }) in
 	let el = build ctx com.types in
 	let el = build ctx com.types in
 	let emain = (match com.main with None -> [] | Some e -> [gen_expr ctx e]) in
 	let emain = (match com.main with None -> [] | Some e -> [gen_expr ctx e]) in
 	let e = (EBlock ((header()) @ libs :: el @ emain), null_pos) in
 	let e = (EBlock ((header()) @ libs :: el @ emain), null_pos) in