diff options
| author | Kenichi Handa | 2012-08-16 21:25:17 +0900 |
|---|---|---|
| committer | Kenichi Handa | 2012-08-16 21:25:17 +0900 |
| commit | d75ffb4ed0b2e72a9361a07d16a5c884a9459728 (patch) | |
| tree | 8ac5a6a8ae033fef7fbc7fb7b09a703ef4b0ed5b /src/syntax.c | |
| parent | 69c41c4070c86baac11a627e9c3d366420aeb7cc (diff) | |
| parent | 250c8ab9b8f6322959fa3122db83944c30c3894b (diff) | |
| download | emacs-d75ffb4ed0b2e72a9361a07d16a5c884a9459728.tar.gz emacs-d75ffb4ed0b2e72a9361a07d16a5c884a9459728.zip | |
merge trunk
Diffstat (limited to 'src/syntax.c')
| -rw-r--r-- | src/syntax.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/syntax.c b/src/syntax.c index 69c2789ed39..1cbad1ae0a4 100644 --- a/src/syntax.c +++ b/src/syntax.c | |||
| @@ -171,7 +171,7 @@ struct gl_state_s gl_state; /* Global state of syntax parser. */ | |||
| 171 | direction than the intervals - or in an interval. We update the | 171 | direction than the intervals - or in an interval. We update the |
| 172 | current syntax-table basing on the property of this interval, and | 172 | current syntax-table basing on the property of this interval, and |
| 173 | update the interval to start further than CHARPOS - or be | 173 | update the interval to start further than CHARPOS - or be |
| 174 | NULL_INTERVAL. We also update lim_property to be the next value of | 174 | NULL. We also update lim_property to be the next value of |
| 175 | charpos to call this subroutine again - or be before/after the | 175 | charpos to call this subroutine again - or be before/after the |
| 176 | start/end of OBJECT. */ | 176 | start/end of OBJECT. */ |
| 177 | 177 | ||
| @@ -192,7 +192,7 @@ update_syntax_table (ptrdiff_t charpos, EMACS_INT count, int init, | |||
| 192 | i = interval_of (charpos, object); | 192 | i = interval_of (charpos, object); |
| 193 | gl_state.backward_i = gl_state.forward_i = i; | 193 | gl_state.backward_i = gl_state.forward_i = i; |
| 194 | invalidate = 0; | 194 | invalidate = 0; |
| 195 | if (NULL_INTERVAL_P (i)) | 195 | if (!i) |
| 196 | return; | 196 | return; |
| 197 | /* interval_of updates only ->position of the return value, so | 197 | /* interval_of updates only ->position of the return value, so |
| 198 | update the parents manually to speed up update_interval. */ | 198 | update the parents manually to speed up update_interval. */ |
| @@ -217,7 +217,7 @@ update_syntax_table (ptrdiff_t charpos, EMACS_INT count, int init, | |||
| 217 | 217 | ||
| 218 | /* We are guaranteed to be called with CHARPOS either in i, | 218 | /* We are guaranteed to be called with CHARPOS either in i, |
| 219 | or further off. */ | 219 | or further off. */ |
| 220 | if (NULL_INTERVAL_P (i)) | 220 | if (!i) |
| 221 | error ("Error in syntax_table logic for to-the-end intervals"); | 221 | error ("Error in syntax_table logic for to-the-end intervals"); |
| 222 | else if (charpos < i->position) /* Move left. */ | 222 | else if (charpos < i->position) /* Move left. */ |
| 223 | { | 223 | { |
| @@ -287,7 +287,7 @@ update_syntax_table (ptrdiff_t charpos, EMACS_INT count, int init, | |||
| 287 | } | 287 | } |
| 288 | } | 288 | } |
| 289 | 289 | ||
| 290 | while (!NULL_INTERVAL_P (i)) | 290 | while (i) |
| 291 | { | 291 | { |
| 292 | if (cnt && !EQ (tmp_table, textget (i->plist, Qsyntax_table))) | 292 | if (cnt && !EQ (tmp_table, textget (i->plist, Qsyntax_table))) |
| 293 | { | 293 | { |
| @@ -313,7 +313,7 @@ update_syntax_table (ptrdiff_t charpos, EMACS_INT count, int init, | |||
| 313 | /* e_property at EOB is not set to ZV but to ZV+1, so that | 313 | /* e_property at EOB is not set to ZV but to ZV+1, so that |
| 314 | we can do INC(from);UPDATE_SYNTAX_TABLE_FORWARD without | 314 | we can do INC(from);UPDATE_SYNTAX_TABLE_FORWARD without |
| 315 | having to check eob between the two. */ | 315 | having to check eob between the two. */ |
| 316 | + (NULL_INTERVAL_P (next_interval (i)) ? 1 : 0); | 316 | + (next_interval (i) ? 0 : 1); |
| 317 | gl_state.forward_i = i; | 317 | gl_state.forward_i = i; |
| 318 | } | 318 | } |
| 319 | else | 319 | else |
| @@ -326,7 +326,7 @@ update_syntax_table (ptrdiff_t charpos, EMACS_INT count, int init, | |||
| 326 | cnt++; | 326 | cnt++; |
| 327 | i = count > 0 ? next_interval (i) : previous_interval (i); | 327 | i = count > 0 ? next_interval (i) : previous_interval (i); |
| 328 | } | 328 | } |
| 329 | eassert (NULL_INTERVAL_P (i)); /* This property goes to the end. */ | 329 | eassert (i == NULL); /* This property goes to the end. */ |
| 330 | if (count > 0) | 330 | if (count > 0) |
| 331 | gl_state.e_property = gl_state.stop; | 331 | gl_state.e_property = gl_state.stop; |
| 332 | else | 332 | else |
| @@ -819,7 +819,7 @@ It is a copy of the TABLE, which defaults to the standard syntax table. */) | |||
| 819 | 819 | ||
| 820 | /* Only the standard syntax table should have a default element. | 820 | /* Only the standard syntax table should have a default element. |
| 821 | Other syntax tables should inherit from parents instead. */ | 821 | Other syntax tables should inherit from parents instead. */ |
| 822 | XCHAR_TABLE (copy)->defalt = Qnil; | 822 | CSET (XCHAR_TABLE (copy), defalt, Qnil); |
| 823 | 823 | ||
| 824 | /* Copied syntax tables should all have parents. | 824 | /* Copied syntax tables should all have parents. |
| 825 | If we copied one with no parent, such as the standard syntax table, | 825 | If we copied one with no parent, such as the standard syntax table, |
| @@ -836,7 +836,7 @@ One argument, a syntax table. */) | |||
| 836 | { | 836 | { |
| 837 | int idx; | 837 | int idx; |
| 838 | check_syntax_table (table); | 838 | check_syntax_table (table); |
| 839 | BVAR (current_buffer, syntax_table) = table; | 839 | BSET (current_buffer, syntax_table, table); |
| 840 | /* Indicate that this buffer now has a specified syntax table. */ | 840 | /* Indicate that this buffer now has a specified syntax table. */ |
| 841 | idx = PER_BUFFER_VAR_IDX (syntax_table); | 841 | idx = PER_BUFFER_VAR_IDX (syntax_table); |
| 842 | SET_PER_BUFFER_VALUE_P (current_buffer, idx, 1); | 842 | SET_PER_BUFFER_VALUE_P (current_buffer, idx, 1); |
| @@ -1009,7 +1009,7 @@ The first character of NEWENTRY should be one of the following: | |||
| 1009 | " string quote. \\ escape. | 1009 | " string quote. \\ escape. |
| 1010 | $ paired delimiter. ' expression quote or prefix operator. | 1010 | $ paired delimiter. ' expression quote or prefix operator. |
| 1011 | < comment starter. > comment ender. | 1011 | < comment starter. > comment ender. |
| 1012 | / character-quote. @ inherit from `standard-syntax-table'. | 1012 | / character-quote. @ inherit from parent table. |
| 1013 | | generic string fence. ! generic comment fence. | 1013 | | generic string fence. ! generic comment fence. |
| 1014 | 1014 | ||
| 1015 | Only single-character comment start and end sequences are represented thus. | 1015 | Only single-character comment start and end sequences are represented thus. |
| @@ -1152,7 +1152,7 @@ DEFUN ("internal-describe-syntax-value", Finternal_describe_syntax_value, | |||
| 1152 | 1152 | ||
| 1153 | insert_string ("\twhich means: "); | 1153 | insert_string ("\twhich means: "); |
| 1154 | 1154 | ||
| 1155 | switch (SWITCH_ENUM_CAST (code)) | 1155 | switch (code) |
| 1156 | { | 1156 | { |
| 1157 | case Swhitespace: | 1157 | case Swhitespace: |
| 1158 | insert_string ("whitespace"); break; | 1158 | insert_string ("whitespace"); break; |
| @@ -2525,7 +2525,7 @@ scan_lists (register EMACS_INT from, EMACS_INT count, EMACS_INT depth, int sexpf | |||
| 2525 | if (prefix) | 2525 | if (prefix) |
| 2526 | continue; | 2526 | continue; |
| 2527 | 2527 | ||
| 2528 | switch (SWITCH_ENUM_CAST (code)) | 2528 | switch (code) |
| 2529 | { | 2529 | { |
| 2530 | case Sescape: | 2530 | case Sescape: |
| 2531 | case Scharquote: | 2531 | case Scharquote: |
| @@ -2702,7 +2702,7 @@ scan_lists (register EMACS_INT from, EMACS_INT count, EMACS_INT depth, int sexpf | |||
| 2702 | else if (SYNTAX_FLAGS_PREFIX (syntax)) | 2702 | else if (SYNTAX_FLAGS_PREFIX (syntax)) |
| 2703 | continue; | 2703 | continue; |
| 2704 | 2704 | ||
| 2705 | switch (SWITCH_ENUM_CAST (code)) | 2705 | switch (code) |
| 2706 | { | 2706 | { |
| 2707 | case Sword: | 2707 | case Sword: |
| 2708 | case Ssymbol: | 2708 | case Ssymbol: |
| @@ -3123,7 +3123,7 @@ do { prev_from = from; \ | |||
| 3123 | 3123 | ||
| 3124 | if (SYNTAX_FLAGS_PREFIX (prev_from_syntax)) | 3124 | if (SYNTAX_FLAGS_PREFIX (prev_from_syntax)) |
| 3125 | continue; | 3125 | continue; |
| 3126 | switch (SWITCH_ENUM_CAST (code)) | 3126 | switch (code) |
| 3127 | { | 3127 | { |
| 3128 | case Sescape: | 3128 | case Sescape: |
| 3129 | case Scharquote: | 3129 | case Scharquote: |
| @@ -3473,7 +3473,7 @@ syms_of_syntax (void) | |||
| 3473 | 3473 | ||
| 3474 | DEFSYM (Qscan_error, "scan-error"); | 3474 | DEFSYM (Qscan_error, "scan-error"); |
| 3475 | Fput (Qscan_error, Qerror_conditions, | 3475 | Fput (Qscan_error, Qerror_conditions, |
| 3476 | pure_cons (Qscan_error, pure_cons (Qerror, Qnil))); | 3476 | listn (CONSTYPE_PURE, 2, Qscan_error, Qerror)); |
| 3477 | Fput (Qscan_error, Qerror_message, | 3477 | Fput (Qscan_error, Qerror_message, |
| 3478 | build_pure_c_string ("Scan error")); | 3478 | build_pure_c_string ("Scan error")); |
| 3479 | 3479 | ||