Mercurial > emacs
comparison src/syntax.c @ 20475:efbebc38e077
Comment and whitespace changes.
| author | Richard M. Stallman <rms@gnu.org> |
|---|---|
| date | Sun, 21 Dec 1997 01:34:37 +0000 |
| parents | f76b9c0ebc4b |
| children | 26d12c66acc1 |
comparison
equal
deleted
inserted
replaced
| 20474:2ff24b456bb7 | 20475:efbebc38e077 |
|---|---|
| 2306 | 2306 |
| 2307 /* Parse forward from FROM to END, | 2307 /* Parse forward from FROM to END, |
| 2308 assuming that FROM has state OLDSTATE (nil means FROM is start of function), | 2308 assuming that FROM has state OLDSTATE (nil means FROM is start of function), |
| 2309 and return a description of the state of the parse at END. | 2309 and return a description of the state of the parse at END. |
| 2310 If STOPBEFORE is nonzero, stop at the start of an atom. | 2310 If STOPBEFORE is nonzero, stop at the start of an atom. |
| 2311 If COMMENTSTOP is nonzero, stop at the start of a comment. */ | 2311 If COMMENTSTOP is 1, stop at the start of a comment. |
| 2312 If COMMENTSTOP is -1, stop at the start or end of a comment, | |
| 2313 after the beginning of a string, or after the end of a string. */ | |
| 2312 | 2314 |
| 2313 static void | 2315 static void |
| 2314 scan_sexps_forward (stateptr, from, end, targetdepth, | 2316 scan_sexps_forward (stateptr, from, end, targetdepth, |
| 2315 stopbefore, oldstate, commentstop) | 2317 stopbefore, oldstate, commentstop) |
| 2316 struct lisp_parse_state *stateptr; | 2318 struct lisp_parse_state *stateptr; |
| 2567 ? (FETCH_CHAR (prev_from)) | 2569 ? (FETCH_CHAR (prev_from)) |
| 2568 : ST_STRING_STYLE); | 2570 : ST_STRING_STYLE); |
| 2569 if (boundary_stop) goto done; | 2571 if (boundary_stop) goto done; |
| 2570 startinstring: | 2572 startinstring: |
| 2571 { | 2573 { |
| 2572 nofence = state.instring != ST_STRING_STYLE; | 2574 nofence = state.instring != ST_STRING_STYLE; |
| 2573 | 2575 |
| 2574 while (1) | 2576 while (1) |
| 2577 { | |
| 2578 int c; | |
| 2579 | |
| 2580 if (from >= end) goto done; | |
| 2581 c = FETCH_CHAR (from); | |
| 2582 if (nofence && c == state.instring) break; | |
| 2583 UPDATE_SYNTAX_TABLE_FORWARD (from); | |
| 2584 switch (SWITCH_ENUM_CAST (SYNTAX (c))) | |
| 2575 { | 2585 { |
| 2576 int c; | 2586 case Sstring_fence: |
| 2577 | 2587 if (!nofence) goto string_end; |
| 2578 if (from >= end) goto done; | 2588 break; |
| 2579 c = FETCH_CHAR (from); | 2589 case Scharquote: |
| 2580 if (nofence && c == state.instring) break; | 2590 case Sescape: |
| 2581 UPDATE_SYNTAX_TABLE_FORWARD (from); | 2591 INC_FROM; |
| 2582 switch (SWITCH_ENUM_CAST (SYNTAX (c))) | 2592 startquotedinstring: |
| 2583 { | 2593 if (from >= end) goto endquoted; |
| 2584 case Sstring_fence: | |
| 2585 if (!nofence) goto string_end; | |
| 2586 break; | |
| 2587 case Scharquote: | |
| 2588 case Sescape: | |
| 2589 INC_FROM; | |
| 2590 startquotedinstring: | |
| 2591 if (from >= end) goto endquoted; | |
| 2592 } | |
| 2593 INC_FROM; | |
| 2594 } | 2594 } |
| 2595 INC_FROM; | |
| 2596 } | |
| 2595 } | 2597 } |
| 2596 string_end: | 2598 string_end: |
| 2597 state.instring = -1; | 2599 state.instring = -1; |
| 2598 curlevel->prev = curlevel->last; | 2600 curlevel->prev = curlevel->last; |
| 2599 INC_FROM; | 2601 INC_FROM; |
