Mercurial > emacs
comparison src/syntax.c @ 71740:df55df8eb062
(back_comment, scan_lists): Also use EMACS_INT for buffer positions.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Sun, 09 Jul 2006 14:36:07 +0000 |
parents | a5eb5d8b1eca |
children | 7e302766894f |
comparison
equal
deleted
inserted
replaced
71739:a5eb5d8b1eca | 71740:df55df8eb062 |
---|---|
95 static int find_start_begv; | 95 static int find_start_begv; |
96 static int find_start_modiff; | 96 static int find_start_modiff; |
97 | 97 |
98 | 98 |
99 static int find_defun_start P_ ((int, int)); | 99 static int find_defun_start P_ ((int, int)); |
100 static int back_comment P_ ((int, int, int, int, int, int *, int *)); | 100 static int back_comment P_ ((EMACS_INT, EMACS_INT, EMACS_INT, int, int, |
101 EMACS_INT *, EMACS_INT *)); | |
101 static int char_quoted P_ ((int, int)); | 102 static int char_quoted P_ ((int, int)); |
102 static Lisp_Object skip_chars P_ ((int, int, Lisp_Object, Lisp_Object, int)); | 103 static Lisp_Object skip_chars P_ ((int, int, Lisp_Object, Lisp_Object, int)); |
103 static Lisp_Object scan_lists P_ ((int, int, int, int)); | 104 static Lisp_Object scan_lists P_ ((EMACS_INT, EMACS_INT, EMACS_INT, int)); |
104 static void scan_sexps_forward P_ ((struct lisp_parse_state *, | 105 static void scan_sexps_forward P_ ((struct lisp_parse_state *, |
105 int, int, int, int, | 106 int, int, int, int, |
106 int, Lisp_Object, int)); | 107 int, Lisp_Object, int)); |
107 static int in_classes P_ ((int, Lisp_Object)); | 108 static int in_classes P_ ((int, Lisp_Object)); |
108 | 109 |
469 Global syntax data remains valid for backward search starting at | 470 Global syntax data remains valid for backward search starting at |
470 the returned value (or at FROM, if the search was not successful). */ | 471 the returned value (or at FROM, if the search was not successful). */ |
471 | 472 |
472 static int | 473 static int |
473 back_comment (from, from_byte, stop, comnested, comstyle, charpos_ptr, bytepos_ptr) | 474 back_comment (from, from_byte, stop, comnested, comstyle, charpos_ptr, bytepos_ptr) |
474 int from, from_byte, stop; | 475 EMACS_INT from, from_byte, stop; |
475 int comnested, comstyle; | 476 int comnested, comstyle; |
476 int *charpos_ptr, *bytepos_ptr; | 477 EMACS_INT *charpos_ptr, *bytepos_ptr; |
477 { | 478 { |
478 /* Look back, counting the parity of string-quotes, | 479 /* Look back, counting the parity of string-quotes, |
479 and recording the comment-starters seen. | 480 and recording the comment-starters seen. |
480 When we reach a safe place, assume that's not in a string; | 481 When we reach a safe place, assume that's not in a string; |
481 then step the main scan to the earliest comment-starter seen | 482 then step the main scan to the earliest comment-starter seen |
2197 ((SINGLE_BYTE_CHAR_P (c) || !multibyte_symbol_p) \ | 2198 ((SINGLE_BYTE_CHAR_P (c) || !multibyte_symbol_p) \ |
2198 ? SYNTAX (c) : Ssymbol) | 2199 ? SYNTAX (c) : Ssymbol) |
2199 | 2200 |
2200 static Lisp_Object | 2201 static Lisp_Object |
2201 scan_lists (from, count, depth, sexpflag) | 2202 scan_lists (from, count, depth, sexpflag) |
2202 register int from; | 2203 register EMACS_INT from; |
2203 int count, depth, sexpflag; | 2204 EMACS_INT count, depth; |
2205 int sexpflag; | |
2204 { | 2206 { |
2205 Lisp_Object val; | 2207 Lisp_Object val; |
2206 register int stop = count > 0 ? ZV : BEGV; | 2208 register EMACS_INT stop = count > 0 ? ZV : BEGV; |
2207 register int c, c1; | 2209 register int c, c1; |
2208 int stringterm; | 2210 int stringterm; |
2209 int quoted; | 2211 int quoted; |
2210 int mathexit = 0; | 2212 int mathexit = 0; |
2211 register enum syntaxcode code, temp_code; | 2213 register enum syntaxcode code, temp_code; |
2212 int min_depth = depth; /* Err out if depth gets less than this. */ | 2214 int min_depth = depth; /* Err out if depth gets less than this. */ |
2213 int comstyle = 0; /* style of comment encountered */ | 2215 int comstyle = 0; /* style of comment encountered */ |
2214 int comnested = 0; /* whether the comment is nestable or not */ | 2216 int comnested = 0; /* whether the comment is nestable or not */ |
2215 int temp_pos; | 2217 EMACS_INT temp_pos; |
2216 int last_good = from; | 2218 EMACS_INT last_good = from; |
2217 int found; | 2219 int found; |
2218 int from_byte; | 2220 EMACS_INT from_byte; |
2219 int out_bytepos, out_charpos; | 2221 EMACS_INT out_bytepos, out_charpos; |
2220 int temp, dummy; | 2222 int temp, dummy; |
2221 int multibyte_symbol_p = sexpflag && multibyte_syntax_as_symbol; | 2223 int multibyte_symbol_p = sexpflag && multibyte_syntax_as_symbol; |
2222 | 2224 |
2223 if (depth > 0) min_depth = 0; | 2225 if (depth > 0) min_depth = 0; |
2224 | 2226 |