Browse Source

[parser] improve some error message terminology (#7964)

Jens Fischer 6 years ago
parent
commit
9f206a3c3c
4 changed files with 9 additions and 9 deletions
  1. 2 2
      extra/CHANGES.txt
  2. 3 3
      src/syntax/lexer.ml
  3. 2 2
      src/syntax/parser.ml
  4. 2 2
      src/syntax/parserEntry.ml

+ 2 - 2
extra/CHANGES.txt

@@ -30,7 +30,7 @@ unreleased: 4.0.0-rc.2
 
 
 	all : improved unification error messages (#7547)
 	all : improved unification error messages (#7547)
 	all : added `haxe4` define
 	all : added `haxe4` define
-	all : do not require semicolon for XML literals (#7438)
+	all : do not require semicolon for markup literals (#7438)
 	all : made `@:expose` imply `@:keep` (#7695)
 	all : made `@:expose` imply `@:keep` (#7695)
 	all : unified cast, catch and Std.is behavior of null-values (#7532)
 	all : unified cast, catch and Std.is behavior of null-values (#7532)
 	macro : static variables are now always re-initialized when using the compilation server (#5746)
 	macro : static variables are now always re-initialized when using the compilation server (#5746)
@@ -66,7 +66,7 @@ unreleased: 4.0.0-rc.2
 	all : added support for write-mode `@:op(a.b)`
 	all : added support for write-mode `@:op(a.b)`
 	all : support `inline call()` and `inline new` expressions (#7425)
 	all : support `inline call()` and `inline new` expressions (#7425)
 	all : support `@:using` on type declarations (#7462)
 	all : support `@:using` on type declarations (#7462)
-	all : support XML literal strings but require them to be macro-processed (#7438)
+	all : support markup literal strings but require them to be macro-processed (#7438)
 	all : allow enum values without arguments as default function argument values (#7439)
 	all : allow enum values without arguments as default function argument values (#7439)
 	lua : add -D lua-vanilla, which emits code with reduced functionality but no additional lib dependencies
 	lua : add -D lua-vanilla, which emits code with reduced functionality but no additional lib dependencies
 
 

+ 3 - 3
src/syntax/lexer.ml

@@ -30,7 +30,7 @@ type error_msg =
 	| Unclosed_code
 	| Unclosed_code
 	| Invalid_escape of char
 	| Invalid_escape of char
 	| Invalid_option
 	| Invalid_option
-	| Unterminated_xml
+	| Unterminated_markup
 
 
 exception Error of error_msg * pos
 exception Error of error_msg * pos
 
 
@@ -49,7 +49,7 @@ let error_msg = function
 	| Unclosed_code -> "Unclosed code string"
 	| Unclosed_code -> "Unclosed code string"
 	| Invalid_escape c -> Printf.sprintf "Invalid escape sequence \\%s" (Char.escaped c)
 	| Invalid_escape c -> Printf.sprintf "Invalid escape sequence \\%s" (Char.escaped c)
 	| Invalid_option -> "Invalid regular expression option"
 	| Invalid_option -> "Invalid regular expression option"
-	| Unterminated_xml -> "Unterminated XML literal"
+	| Unterminated_markup -> "Unterminated markup literal"
 
 
 type lexer_file = {
 type lexer_file = {
 	lfile : string;
 	lfile : string;
@@ -605,4 +605,4 @@ let lex_xml p lexbuf =
 	try
 	try
 		not_xml ctx 0 (name <> "") (* don't allow self-closing fragments *)
 		not_xml ctx 0 (name <> "") (* don't allow self-closing fragments *)
 	with Exit ->
 	with Exit ->
-		error Unterminated_xml p
+		error Unterminated_markup p

+ 2 - 2
src/syntax/parser.ml

@@ -27,7 +27,7 @@ type error_msg =
 	| Unexpected of token
 	| Unexpected of token
 	| Duplicate_default
 	| Duplicate_default
 	| Missing_semicolon
 	| Missing_semicolon
-	| Unclosed_macro
+	| Unclosed_conditional
 	| Unimplemented
 	| Unimplemented
 	| Missing_type
 	| Missing_type
 	| Expected of string list
 	| Expected of string list
@@ -59,7 +59,7 @@ let error_msg = function
 	| Unexpected t -> "Unexpected "^(s_token t)
 	| Unexpected t -> "Unexpected "^(s_token t)
 	| Duplicate_default -> "Duplicate default"
 	| Duplicate_default -> "Duplicate default"
 	| Missing_semicolon -> "Missing ;"
 	| Missing_semicolon -> "Missing ;"
-	| Unclosed_macro -> "Unclosed macro"
+	| Unclosed_conditional -> "Unclosed conditional compilation block"
 	| Unimplemented -> "Not implemented for current platform"
 	| Unimplemented -> "Not implemented for current platform"
 	| Missing_type -> "Missing type declaration"
 	| Missing_type -> "Missing type declaration"
 	| Expected sl -> "Expected " ^ (String.concat " or " sl)
 	| Expected sl -> "Expected " ^ (String.concat " or " sl)

+ 2 - 2
src/syntax/parserEntry.ml

@@ -160,7 +160,7 @@ let parse ctx code file =
 		| Sharp "if" ->
 		| Sharp "if" ->
 			skip_tokens_loop p test (skip_tokens p false)
 			skip_tokens_loop p test (skip_tokens p false)
 		| Eof ->
 		| Eof ->
-			syntax_error Unclosed_macro ~pos:(Some p) sraw tk
+			syntax_error Unclosed_conditional ~pos:(Some p) sraw tk
 		| _ ->
 		| _ ->
 			skip_tokens p test
 			skip_tokens p test
 
 
@@ -174,7 +174,7 @@ let parse ctx code file =
 	) in
 	) in
 	try
 	try
 		let l = parse_file s in
 		let l = parse_file s in
-		(match !mstack with p :: _ -> syntax_error Unclosed_macro ~pos:(Some p) sraw () | _ -> ());
+		(match !mstack with p :: _ -> syntax_error Unclosed_conditional ~pos:(Some p) sraw () | _ -> ());
 		let was_display_file = !in_display_file in
 		let was_display_file = !in_display_file in
 		restore();
 		restore();
 		Lexer.restore old;
 		Lexer.restore old;