Răsfoiți Sursa

[parser] remove -D use-rtti-doc

closes #7493
Simon Krajewski 7 ani în urmă
părinte
comite
38e8754852

+ 0 - 1
src/compiler/displayOutput.ml

@@ -555,7 +555,6 @@ let handle_display_argument com file_pos pre_compilation did_something =
 		com.display <- DisplayMode.create mode;
 		Parser.display_mode := mode;
 		if not com.display.dms_full_typing then Common.define_value com Define.Display (if smode <> "" then smode else "1");
-		Parser.use_doc := true;
 		DisplayPosition.display_position := {
 			pfile = Path.unique_full_path file;
 			pmin = pos;

+ 0 - 5
src/compiler/main.ml

@@ -415,7 +415,6 @@ let rec process_params create pl =
 	(* put --display in front if it was last parameter *)
 	let pl = (match List.rev pl with
 		| file :: "--display" :: pl when file <> "memory" -> "--display" :: file :: List.rev pl
-		| "use_rtti_doc" :: "-D" :: file :: "--display" :: pl -> "--display" :: file :: List.rev pl
 		| _ -> pl
 	) in
 	loop [] pl
@@ -481,7 +480,6 @@ try
 	com.error <- error ctx;
 	if CompilationServer.runs() then com.run_command <- run_command ctx;
 	Parser.display_error := (fun e p -> com.error (Parser.error_msg e) p);
-	Parser.use_doc := !Parser.display_mode <> DMNone || (CompilationServer.runs());
 	com.class_path <- get_std_class_paths ();
 	com.std_path <- List.filter (fun p -> ExtString.String.ends_with p "std/" || ExtString.String.ends_with p "std\\") com.class_path;
 	let define f = Arg.Unit (fun () -> Common.define com f) in
@@ -565,7 +563,6 @@ try
 		("Compilation",["-D";"--define"],[],Arg.String (fun var ->
 			begin match var with
 				| "no_copt" | "no-copt" -> com.foptimize <- false;
-				| "use_rtti_doc" | "use-rtti-doc" -> Parser.use_doc := true;
 				| _ -> 	if List.mem var reserved_flags then raise (Arg.Bad (var ^ " is a reserved compiler flag and cannot be defined from command line"));
 			end;
 			Common.raw_define com var;
@@ -690,11 +687,9 @@ try
 				DisplayOutput.handle_display_argument com input pre_compilation did_something;
 		),"","display code tips");
 		("Services",["--xml"],["-xml"],Arg.String (fun file ->
-			Parser.use_doc := true;
 			xml_out := Some file
 		),"<file>","generate XML types description");
 		("Services",["--json"],[],Arg.String (fun file ->
-			Parser.use_doc := true;
 			json_out := Some file
 		),"<file>","generate JSON types description");
 		("Services",["--gen-hx-classes"],[], Arg.Unit (fun() ->

+ 1 - 2
src/context/display/displayJson.ml

@@ -61,8 +61,7 @@ class display_handler (jsonrpc : jsonrpc_handler) com cs = object(self)
 	method enable_display mode =
 		com.display <- create mode;
 		Parser.display_mode := mode;
-		Common.define_value com Define.Display "1";
-		Parser.use_doc := true;
+		Common.define_value com Define.Display "1"
 
 	method set_display_file was_auto_triggered requires_offset =
 		let file = jsonrpc#get_string_param "file" in

+ 3 - 3
src/core/define.ml

@@ -106,7 +106,6 @@ type strict_defined =
 	| Sys
 	| Unsafe
 	| UseNekoc
-	| UseRttiDoc
 	| Utf16
 	| Vcproj
 	| WarnVarShadowing
@@ -221,7 +220,6 @@ let infos = function
 	| Sys -> "sys",("Defined for all system platforms",[])
 	| Unsafe -> "unsafe",("Allow unsafe code when targeting C#",[Platform Cs])
 	| UseNekoc -> "use_nekoc",("Use nekoc compiler instead of internal one",[Platform Neko])
-	| UseRttiDoc -> "use_rtti_doc",("Allows access to documentation during compilation",[])
 	| Utf16 -> "utf16",("Defined for all platforms that have utf16 encoding with ucs2 api",[])
 	| Vcproj -> "vcproj",("GenCPP internal",[Platform Cpp])
 	| WarnVarShadowing -> "warn_var_shadowing",("Warn about shadowing variable declarations",[])
@@ -285,7 +283,9 @@ let get_signature def =
 			(* don't make much difference between these special compilation flags *)
 			match String.concat "_" (ExtString.String.nsplit k "-") with
 			(* If we add something here that might be used in conditional compilation it should be added to
-			   Parser.parse_macro_ident as well (issue #5682). *)
+			   Parser.parse_macro_ident as well (issue #5682).
+			   Note that we should removed flags like use_rtti_doc here.
+			*)
 			| "display" | "use_rtti_doc" | "macro_times" | "display_details" | "no_copt" | "display_stdin" -> acc
 			| _ -> (k ^ "=" ^ v) :: acc
 		) def.values [] in

+ 0 - 2
src/syntax/parser.ml

@@ -98,7 +98,6 @@ end
 (* Global state *)
 
 let in_display = ref false
-let use_doc = ref false
 let was_auto_triggered = ref false
 let display_mode = ref DMNone
 let in_macro = ref false
@@ -107,7 +106,6 @@ let delayed_syntax_completion : (syntax_completion * pos) option ref = ref None
 
 let reset_state () =
 	in_display := false;
-	use_doc := false;
 	was_auto_triggered := false;
 	display_mode := DMNone;
 	display_position := null_pos;

+ 2 - 4
src/syntax/parserEntry.ml

@@ -99,10 +99,8 @@ let parse ctx code file =
 		| Comment s ->
 			(* if encloses_resume (pos tk) then syntax_completion SCComment (pos tk); *)
 			let tk = next_token() in
-			if !use_doc then begin
-				let l = String.length s in
-				if l > 0 && s.[0] = '*' then last_doc := Some (String.sub s 1 (l - (if l > 1 && s.[l-1] = '*' then 2 else 1)), (snd tk).pmin);
-			end;
+			let l = String.length s in
+			if l > 0 && s.[0] = '*' then last_doc := Some (String.sub s 1 (l - (if l > 1 && s.[l-1] = '*' then 2 else 1)), (snd tk).pmin);
 			tk
 		| CommentLine s ->
 			if !in_display_file && encloses_display_position (pos tk) then syntax_completion SCComment (pos tk);