diff options
Diffstat (limited to 'src/syntax.c')
| -rw-r--r-- | src/syntax.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/syntax.c b/src/syntax.c index d68628b181c..b062264ac24 100644 --- a/src/syntax.c +++ b/src/syntax.c | |||
| @@ -3023,12 +3023,23 @@ do { prev_from = from; \ | |||
| 3023 | INC_FROM; | 3023 | INC_FROM; |
| 3024 | code = prev_from_syntax & 0xff; | 3024 | code = prev_from_syntax & 0xff; |
| 3025 | 3025 | ||
| 3026 | if (code == Scomment) | 3026 | if (from < end |
| 3027 | && SYNTAX_FLAGS_COMSTART_FIRST (prev_from_syntax) | ||
| 3028 | && (c1 = FETCH_CHAR (from_byte), | ||
| 3029 | SYNTAX_COMSTART_SECOND (c1))) | ||
| 3030 | /* Duplicate code to avoid a complex if-expression | ||
| 3031 | which causes trouble for the SGI compiler. */ | ||
| 3027 | { | 3032 | { |
| 3028 | state.comstyle = SYNTAX_FLAGS_COMMENT_STYLE (prev_from_syntax); | 3033 | /* Record the comment style we have entered so that only |
| 3029 | state.incomment = (SYNTAX_FLAGS_COMMENT_NESTED (prev_from_syntax) ? | 3034 | the comment-end sequence of the same style actually |
| 3030 | 1 : -1); | 3035 | terminates the comment section. */ |
| 3036 | state.comstyle = SYNTAX_COMMENT_STYLE (c1); | ||
| 3037 | comnested = SYNTAX_FLAGS_COMMENT_NESTED (prev_from_syntax); | ||
| 3038 | comnested = comnested || SYNTAX_COMMENT_NESTED (c1); | ||
| 3039 | state.incomment = comnested ? 1 : -1; | ||
| 3031 | state.comstr_start = prev_from; | 3040 | state.comstr_start = prev_from; |
| 3041 | INC_FROM; | ||
| 3042 | code = Scomment; | ||
| 3032 | } | 3043 | } |
| 3033 | else if (code == Scomment_fence) | 3044 | else if (code == Scomment_fence) |
| 3034 | { | 3045 | { |
| @@ -3040,24 +3051,13 @@ do { prev_from = from; \ | |||
| 3040 | state.comstr_start = prev_from; | 3051 | state.comstr_start = prev_from; |
| 3041 | code = Scomment; | 3052 | code = Scomment; |
| 3042 | } | 3053 | } |
| 3043 | else if (from < end) | 3054 | else if (code == Scomment) |
| 3044 | if (SYNTAX_FLAGS_COMSTART_FIRST (prev_from_syntax)) | 3055 | { |
| 3045 | if (c1 = FETCH_CHAR_AS_MULTIBYTE (from_byte), | 3056 | state.comstyle = SYNTAX_FLAGS_COMMENT_STYLE (prev_from_syntax); |
| 3046 | SYNTAX_COMSTART_SECOND (c1)) | 3057 | state.incomment = (SYNTAX_FLAGS_COMMENT_NESTED (prev_from_syntax) ? |
| 3047 | /* Duplicate code to avoid a complex if-expression | 3058 | 1 : -1); |
| 3048 | which causes trouble for the SGI compiler. */ | 3059 | state.comstr_start = prev_from; |
| 3049 | { | 3060 | } |
| 3050 | /* Record the comment style we have entered so that only | ||
| 3051 | the comment-end sequence of the same style actually | ||
| 3052 | terminates the comment section. */ | ||
| 3053 | state.comstyle = SYNTAX_COMMENT_STYLE (c1); | ||
| 3054 | comnested = SYNTAX_FLAGS_COMMENT_NESTED (prev_from_syntax); | ||
| 3055 | comnested = comnested || SYNTAX_COMMENT_NESTED (c1); | ||
| 3056 | state.incomment = comnested ? 1 : -1; | ||
| 3057 | state.comstr_start = prev_from; | ||
| 3058 | INC_FROM; | ||
| 3059 | code = Scomment; | ||
| 3060 | } | ||
| 3061 | 3061 | ||
| 3062 | if (SYNTAX_FLAGS_PREFIX (prev_from_syntax)) | 3062 | if (SYNTAX_FLAGS_PREFIX (prev_from_syntax)) |
| 3063 | continue; | 3063 | continue; |