diff options
| author | Po Lu | 2023-05-23 08:46:40 +0800 |
|---|---|---|
| committer | Po Lu | 2023-05-23 08:46:40 +0800 |
| commit | fb8d87e18d5540705761df9f3f18a5a103bca073 (patch) | |
| tree | e469ceb0046e3f8b039bf45ce55c0d358fbd4f7e /src | |
| parent | 6dc9a3eeb755b5b0047b39f2bd7ebdefb10a1dc4 (diff) | |
| parent | d4ff1d74209e97730c52ddd50c4d643c79087a33 (diff) | |
| download | emacs-fb8d87e18d5540705761df9f3f18a5a103bca073.tar.gz emacs-fb8d87e18d5540705761df9f3f18a5a103bca073.zip | |
Merge remote-tracking branch 'origin/master' into feature/android
Diffstat (limited to 'src')
| -rw-r--r-- | src/syntax.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/syntax.c b/src/syntax.c index 839ab36bb2f..0cac923bba7 100644 --- a/src/syntax.c +++ b/src/syntax.c | |||
| @@ -2323,13 +2323,16 @@ forw_comment (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t stop, | |||
| 2323 | return 0; | 2323 | return 0; |
| 2324 | } | 2324 | } |
| 2325 | c = FETCH_CHAR_AS_MULTIBYTE (from_byte); | 2325 | c = FETCH_CHAR_AS_MULTIBYTE (from_byte); |
| 2326 | prev_syntax = syntax; | ||
| 2326 | syntax = SYNTAX_WITH_FLAGS (c); | 2327 | syntax = SYNTAX_WITH_FLAGS (c); |
| 2327 | code = syntax & 0xff; | 2328 | code = syntax & 0xff; |
| 2328 | if (code == Sendcomment | 2329 | if (code == Sendcomment |
| 2329 | && SYNTAX_FLAGS_COMMENT_STYLE (syntax, 0) == style | 2330 | && SYNTAX_FLAGS_COMMENT_STYLE (syntax, 0) == style |
| 2330 | && (SYNTAX_FLAGS_COMMENT_NESTED (syntax) ? | 2331 | && (SYNTAX_FLAGS_COMMENT_NESTED (syntax) ? |
| 2331 | (nesting > 0 && --nesting == 0) : nesting < 0) | 2332 | (nesting > 0 && --nesting == 0) : nesting < 0) |
| 2332 | && !(comment_end_can_be_escaped && char_quoted (from, from_byte))) | 2333 | && !(comment_end_can_be_escaped |
| 2334 | && ((prev_syntax & 0xff) == Sescape | ||
| 2335 | || (prev_syntax & 0xff) == Scharquote))) | ||
| 2333 | /* We have encountered a comment end of the same style | 2336 | /* We have encountered a comment end of the same style |
| 2334 | as the comment sequence which began this comment | 2337 | as the comment sequence which began this comment |
| 2335 | section. */ | 2338 | section. */ |
| @@ -2353,7 +2356,11 @@ forw_comment (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t stop, | |||
| 2353 | inc_both (&from, &from_byte); | 2356 | inc_both (&from, &from_byte); |
| 2354 | UPDATE_SYNTAX_TABLE_FORWARD (from); | 2357 | UPDATE_SYNTAX_TABLE_FORWARD (from); |
| 2355 | if (from == stop) continue; /* Failure */ | 2358 | if (from == stop) continue; /* Failure */ |
| 2356 | } | 2359 | c = FETCH_CHAR_AS_MULTIBYTE (from_byte); |
| 2360 | prev_syntax = syntax; | ||
| 2361 | syntax = Smax; | ||
| 2362 | code = syntax; | ||
| 2363 | } | ||
| 2357 | inc_both (&from, &from_byte); | 2364 | inc_both (&from, &from_byte); |
| 2358 | UPDATE_SYNTAX_TABLE_FORWARD (from); | 2365 | UPDATE_SYNTAX_TABLE_FORWARD (from); |
| 2359 | 2366 | ||
| @@ -3334,7 +3341,14 @@ do { prev_from = from; \ | |||
| 3334 | are invalid now. Luckily, the `done' doesn't use them | 3341 | are invalid now. Luckily, the `done' doesn't use them |
| 3335 | and the INC_FROM sets them to a sane value without | 3342 | and the INC_FROM sets them to a sane value without |
| 3336 | looking at them. */ | 3343 | looking at them. */ |
| 3337 | if (!found) goto done; | 3344 | if (!found) |
| 3345 | { | ||
| 3346 | if ((prev_from_syntax & 0xff) == Sescape | ||
| 3347 | || (prev_from_syntax & 0xff) == Scharquote) | ||
| 3348 | goto endquoted; | ||
| 3349 | else | ||
| 3350 | goto done; | ||
| 3351 | } | ||
| 3338 | INC_FROM; | 3352 | INC_FROM; |
| 3339 | state->incomment = 0; | 3353 | state->incomment = 0; |
| 3340 | state->comstyle = 0; /* reset the comment style */ | 3354 | state->comstyle = 0; /* reset the comment style */ |