aboutsummaryrefslogtreecommitdiffstats
path: root/src/syntax.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/syntax.c')
-rw-r--r--src/syntax.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/syntax.c b/src/syntax.c
index 272e9cf1b12..8bfa62b49fc 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -2799,12 +2799,23 @@ do { prev_from = from; \
2799 INC_FROM; 2799 INC_FROM;
2800 code = prev_from_syntax & 0xff; 2800 code = prev_from_syntax & 0xff;
2801 2801
2802 if (code == Scomment) 2802 if (from < end
2803 && SYNTAX_FLAGS_COMSTART_FIRST (prev_from_syntax)
2804 && (c1 = FETCH_CHAR (from_byte),
2805 SYNTAX_COMSTART_SECOND (c1)))
2806 /* Duplicate code to avoid a complex if-expression
2807 which causes trouble for the SGI compiler. */
2803 { 2808 {
2804 state.comstyle = SYNTAX_FLAGS_COMMENT_STYLE (prev_from_syntax); 2809 /* Record the comment style we have entered so that only
2805 state.incomment = (SYNTAX_FLAGS_COMMENT_NESTED (prev_from_syntax) ? 2810 the comment-end sequence of the same style actually
2806 1 : -1); 2811 terminates the comment section. */
2812 state.comstyle = SYNTAX_COMMENT_STYLE (c1);
2813 comnested = SYNTAX_FLAGS_COMMENT_NESTED (prev_from_syntax);
2814 comnested = comnested || SYNTAX_COMMENT_NESTED (c1);
2815 state.incomment = comnested ? 1 : -1;
2807 state.comstr_start = prev_from; 2816 state.comstr_start = prev_from;
2817 INC_FROM;
2818 code = Scomment;
2808 } 2819 }
2809 else if (code == Scomment_fence) 2820 else if (code == Scomment_fence)
2810 { 2821 {
@@ -2816,24 +2827,13 @@ do { prev_from = from; \
2816 state.comstr_start = prev_from; 2827 state.comstr_start = prev_from;
2817 code = Scomment; 2828 code = Scomment;
2818 } 2829 }
2819 else if (from < end) 2830 else if (code == Scomment)
2820 if (SYNTAX_FLAGS_COMSTART_FIRST (prev_from_syntax)) 2831 {
2821 if (c1 = FETCH_CHAR (from_byte), 2832 state.comstyle = SYNTAX_FLAGS_COMMENT_STYLE (prev_from_syntax);
2822 SYNTAX_COMSTART_SECOND (c1)) 2833 state.incomment = (SYNTAX_FLAGS_COMMENT_NESTED (prev_from_syntax) ?
2823 /* Duplicate code to avoid a complex if-expression 2834 1 : -1);
2824 which causes trouble for the SGI compiler. */ 2835 state.comstr_start = prev_from;
2825 { 2836 }
2826 /* Record the comment style we have entered so that only
2827 the comment-end sequence of the same style actually
2828 terminates the comment section. */
2829 state.comstyle = SYNTAX_COMMENT_STYLE (c1);
2830 comnested = SYNTAX_FLAGS_COMMENT_NESTED (prev_from_syntax);
2831 comnested = comnested || SYNTAX_COMMENT_NESTED (c1);
2832 state.incomment = comnested ? 1 : -1;
2833 state.comstr_start = prev_from;
2834 INC_FROM;
2835 code = Scomment;
2836 }
2837 2837
2838 if (SYNTAX_FLAGS_PREFIX (prev_from_syntax)) 2838 if (SYNTAX_FLAGS_PREFIX (prev_from_syntax))
2839 continue; 2839 continue;