aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2023-05-12 10:43:52 +0800
committerPo Lu2023-05-12 10:43:52 +0800
commit7ac8bcaacc1f3dbbda3febe09dde6d18a2d69729 (patch)
tree0f793adca34d302415ccb31b945b6c1084425724 /src
parent140c5bffc6441e6cee9ba60af114392729239abe (diff)
parent30501083f2ff24ee1291a68e83c65b89c644f44b (diff)
downloademacs-7ac8bcaacc1f3dbbda3febe09dde6d18a2d69729.tar.gz
emacs-7ac8bcaacc1f3dbbda3febe09dde6d18a2d69729.zip
Merge remote-tracking branch 'origin/master' into feature/android
Diffstat (limited to 'src')
-rw-r--r--src/lread.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/lread.c b/src/lread.c
index fe48e614393..1d49e7ae6cd 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -2883,12 +2883,6 @@ character_name_to_code (char const *name, ptrdiff_t name_len,
2883 Unicode 9.0.0 the maximum is 83, so this should be safe. */ 2883 Unicode 9.0.0 the maximum is 83, so this should be safe. */
2884enum { UNICODE_CHARACTER_NAME_LENGTH_BOUND = 200 }; 2884enum { UNICODE_CHARACTER_NAME_LENGTH_BOUND = 200 };
2885 2885
2886static AVOID
2887invalid_escape_syntax_error (void)
2888{
2889 error ("Invalid escape character syntax");
2890}
2891
2892/* Read a character escape sequence, assuming we just read a backslash 2886/* Read a character escape sequence, assuming we just read a backslash
2893 and one more character (next_char). */ 2887 and one more character (next_char). */
2894static int 2888static int
@@ -2920,7 +2914,7 @@ read_char_escape (Lisp_Object readcharfun, int next_char)
2920 2914
2921 case '\n': 2915 case '\n':
2922 /* ?\LF is an error; it's probably a user mistake. */ 2916 /* ?\LF is an error; it's probably a user mistake. */
2923 error ("Invalid escape character syntax"); 2917 error ("Invalid escape char syntax: \\<newline>");
2924 2918
2925 /* \M-x etc: set modifier bit and parse the char to which it applies, 2919 /* \M-x etc: set modifier bit and parse the char to which it applies,
2926 allowing for chains such as \M-\S-\A-\H-\s-\C-q. */ 2920 allowing for chains such as \M-\S-\A-\H-\s-\C-q. */
@@ -2944,7 +2938,7 @@ read_char_escape (Lisp_Object readcharfun, int next_char)
2944 } 2938 }
2945 else 2939 else
2946 /* \M, \S, \H, \A not followed by a hyphen is an error. */ 2940 /* \M, \S, \H, \A not followed by a hyphen is an error. */
2947 invalid_escape_syntax_error (); 2941 error ("Invalid escape char syntax: \\%c not followed by -", c);
2948 } 2942 }
2949 modifiers |= mod; 2943 modifiers |= mod;
2950 c1 = READCHAR; 2944 c1 = READCHAR;
@@ -2964,7 +2958,7 @@ read_char_escape (Lisp_Object readcharfun, int next_char)
2964 { 2958 {
2965 int c1 = READCHAR; 2959 int c1 = READCHAR;
2966 if (c1 != '-') 2960 if (c1 != '-')
2967 invalid_escape_syntax_error (); 2961 error ("Invalid escape char syntax: \\%c not followed by -", c);
2968 } 2962 }
2969 FALLTHROUGH; 2963 FALLTHROUGH;
2970 /* The prefixes \C- and \^ are equivalent. */ 2964 /* The prefixes \C- and \^ are equivalent. */
@@ -3029,7 +3023,7 @@ read_char_escape (Lisp_Object readcharfun, int next_char)
3029 } 3023 }
3030 3024
3031 if (count == 0) 3025 if (count == 0)
3032 invalid_escape_syntax_error (); 3026 error ("Invalid escape char syntax: \\x not followed by hex digit");
3033 if (count < 3 && i >= 0x80) 3027 if (count < 3 && i >= 0x80)
3034 i = BYTE8_TO_CHAR (i); 3028 i = BYTE8_TO_CHAR (i);
3035 modifiers |= i & CHAR_MODIFIER_MASK; 3029 modifiers |= i & CHAR_MODIFIER_MASK;