aboutsummaryrefslogtreecommitdiffstats
path: root/src/syntax.c
diff options
context:
space:
mode:
authorMiles Bader2006-07-19 00:42:56 +0000
committerMiles Bader2006-07-19 00:42:56 +0000
commit63db3c1b3ffa669435b10aa362115ef664990ab2 (patch)
treea62f68b147d4265ce993136af897d4f348570594 /src/syntax.c
parent2988d6b36d310ba98ea1fed570142f436804fc18 (diff)
parent83676aa2e399363120942ef5ea19f8af6b75e8e8 (diff)
downloademacs-63db3c1b3ffa669435b10aa362115ef664990ab2.tar.gz
emacs-63db3c1b3ffa669435b10aa362115ef664990ab2.zip
Merge from emacs--devo--0
Patches applied: * emacs--devo--0 (patch 343-356) - Update from CVS - Update for ERC 5.1.3. - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 113-115) - Merge from emacs--devo--0 - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-90
Diffstat (limited to 'src/syntax.c')
-rw-r--r--src/syntax.c69
1 files changed, 33 insertions, 36 deletions
diff --git a/src/syntax.c b/src/syntax.c
index 4f5481ca111..b0b4bdc0032 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -97,11 +97,12 @@ static int find_start_modiff;
97 97
98 98
99static int find_defun_start P_ ((int, int)); 99static int find_defun_start P_ ((int, int));
100static int back_comment P_ ((int, int, int, int, int, int *, int *)); 100static int back_comment P_ ((EMACS_INT, EMACS_INT, EMACS_INT, int, int,
101 EMACS_INT *, EMACS_INT *));
101static int char_quoted P_ ((int, int)); 102static int char_quoted P_ ((int, int));
102static Lisp_Object skip_chars P_ ((int, Lisp_Object, Lisp_Object, int)); 103static Lisp_Object skip_chars P_ ((int, Lisp_Object, Lisp_Object, int));
103static Lisp_Object skip_syntaxes P_ ((int, Lisp_Object, Lisp_Object)); 104static Lisp_Object skip_syntaxes P_ ((int, Lisp_Object, Lisp_Object));
104static Lisp_Object scan_lists P_ ((int, int, int, int)); 105static Lisp_Object scan_lists P_ ((EMACS_INT, EMACS_INT, EMACS_INT, int));
105static void scan_sexps_forward P_ ((struct lisp_parse_state *, 106static void scan_sexps_forward P_ ((struct lisp_parse_state *,
106 int, int, int, int, 107 int, int, int, int,
107 int, Lisp_Object, int)); 108 int, Lisp_Object, int));
@@ -472,9 +473,9 @@ prev_char_comend_first (pos, pos_byte)
472 473
473static int 474static int
474back_comment (from, from_byte, stop, comnested, comstyle, charpos_ptr, bytepos_ptr) 475back_comment (from, from_byte, stop, comnested, comstyle, charpos_ptr, bytepos_ptr)
475 int from, from_byte, stop; 476 EMACS_INT from, from_byte, stop;
476 int comnested, comstyle; 477 int comnested, comstyle;
477 int *charpos_ptr, *bytepos_ptr; 478 EMACS_INT *charpos_ptr, *bytepos_ptr;
478{ 479{
479 /* Look back, counting the parity of string-quotes, 480 /* Look back, counting the parity of string-quotes,
480 and recording the comment-starters seen. 481 and recording the comment-starters seen.
@@ -749,9 +750,8 @@ static void
749check_syntax_table (obj) 750check_syntax_table (obj)
750 Lisp_Object obj; 751 Lisp_Object obj;
751{ 752{
752 if (!(CHAR_TABLE_P (obj) 753 CHECK_TYPE (CHAR_TABLE_P (obj) && EQ (XCHAR_TABLE (obj)->purpose, Qsyntax_table),
753 && EQ (XCHAR_TABLE (obj)->purpose, Qsyntax_table))) 754 Qsyntax_table_p, obj);
754 wrong_type_argument (Qsyntax_table_p, obj);
755} 755}
756 756
757DEFUN ("syntax-table", Fsyntax_table, Ssyntax_table, 0, 0, 0, 757DEFUN ("syntax-table", Fsyntax_table, Ssyntax_table, 0, 0, 0,
@@ -2111,9 +2111,10 @@ in_classes (c, iso_classes)
2111static int 2111static int
2112forw_comment (from, from_byte, stop, nesting, style, prev_syntax, 2112forw_comment (from, from_byte, stop, nesting, style, prev_syntax,
2113 charpos_ptr, bytepos_ptr, incomment_ptr) 2113 charpos_ptr, bytepos_ptr, incomment_ptr)
2114 int from, from_byte, stop; 2114 EMACS_INT from, from_byte, stop;
2115 int nesting, style, prev_syntax; 2115 int nesting, style, prev_syntax;
2116 int *charpos_ptr, *bytepos_ptr, *incomment_ptr; 2116 EMACS_INT *charpos_ptr, *bytepos_ptr;
2117 int *incomment_ptr;
2117{ 2118{
2118 register int c, c1; 2119 register int c, c1;
2119 register enum syntaxcode code; 2120 register enum syntaxcode code;
@@ -2213,16 +2214,16 @@ between them, return t; otherwise return nil. */)
2213 (count) 2214 (count)
2214 Lisp_Object count; 2215 Lisp_Object count;
2215{ 2216{
2216 register int from; 2217 register EMACS_INT from;
2217 int from_byte; 2218 EMACS_INT from_byte;
2218 register int stop; 2219 register EMACS_INT stop;
2219 register int c, c1; 2220 register int c, c1;
2220 register enum syntaxcode code; 2221 register enum syntaxcode code;
2221 int comstyle = 0; /* style of comment encountered */ 2222 int comstyle = 0; /* style of comment encountered */
2222 int comnested = 0; /* whether the comment is nestable or not */ 2223 int comnested = 0; /* whether the comment is nestable or not */
2223 int found; 2224 int found;
2224 int count1; 2225 EMACS_INT count1;
2225 int out_charpos, out_bytepos; 2226 EMACS_INT out_charpos, out_bytepos;
2226 int dummy; 2227 int dummy;
2227 2228
2228 CHECK_NUMBER (count); 2229 CHECK_NUMBER (count);
@@ -2420,11 +2421,12 @@ between them, return t; otherwise return nil. */)
2420 2421
2421static Lisp_Object 2422static Lisp_Object
2422scan_lists (from, count, depth, sexpflag) 2423scan_lists (from, count, depth, sexpflag)
2423 register int from; 2424 register EMACS_INT from;
2424 int count, depth, sexpflag; 2425 EMACS_INT count, depth;
2426 int sexpflag;
2425{ 2427{
2426 Lisp_Object val; 2428 Lisp_Object val;
2427 register int stop = count > 0 ? ZV : BEGV; 2429 register EMACS_INT stop = count > 0 ? ZV : BEGV;
2428 register int c, c1; 2430 register int c, c1;
2429 int stringterm; 2431 int stringterm;
2430 int quoted; 2432 int quoted;
@@ -2433,11 +2435,11 @@ scan_lists (from, count, depth, sexpflag)
2433 int min_depth = depth; /* Err out if depth gets less than this. */ 2435 int min_depth = depth; /* Err out if depth gets less than this. */
2434 int comstyle = 0; /* style of comment encountered */ 2436 int comstyle = 0; /* style of comment encountered */
2435 int comnested = 0; /* whether the comment is nestable or not */ 2437 int comnested = 0; /* whether the comment is nestable or not */
2436 int temp_pos; 2438 EMACS_INT temp_pos;
2437 int last_good = from; 2439 EMACS_INT last_good = from;
2438 int found; 2440 int found;
2439 int from_byte; 2441 EMACS_INT from_byte;
2440 int out_bytepos, out_charpos; 2442 EMACS_INT out_bytepos, out_charpos;
2441 int temp, dummy; 2443 int temp, dummy;
2442 int multibyte_symbol_p = sexpflag && multibyte_syntax_as_symbol; 2444 int multibyte_symbol_p = sexpflag && multibyte_syntax_as_symbol;
2443 2445
@@ -2567,10 +2569,9 @@ scan_lists (from, count, depth, sexpflag)
2567 close1: 2569 close1:
2568 if (!--depth) goto done; 2570 if (!--depth) goto done;
2569 if (depth < min_depth) 2571 if (depth < min_depth)
2570 Fsignal (Qscan_error, 2572 xsignal3 (Qscan_error,
2571 Fcons (build_string ("Containing expression ends prematurely"), 2573 build_string ("Containing expression ends prematurely"),
2572 Fcons (make_number (last_good), 2574 make_number (last_good), make_number (from));
2573 Fcons (make_number (from), Qnil))));
2574 break; 2575 break;
2575 2576
2576 case Sstring: 2577 case Sstring:
@@ -2719,10 +2720,9 @@ scan_lists (from, count, depth, sexpflag)
2719 open2: 2720 open2:
2720 if (!--depth) goto done2; 2721 if (!--depth) goto done2;
2721 if (depth < min_depth) 2722 if (depth < min_depth)
2722 Fsignal (Qscan_error, 2723 xsignal3 (Qscan_error,
2723 Fcons (build_string ("Containing expression ends prematurely"), 2724 build_string ("Containing expression ends prematurely"),
2724 Fcons (make_number (last_good), 2725 make_number (last_good), make_number (from));
2725 Fcons (make_number (from), Qnil))));
2726 break; 2726 break;
2727 2727
2728 case Sendcomment: 2728 case Sendcomment:
@@ -2792,12 +2792,9 @@ scan_lists (from, count, depth, sexpflag)
2792 return val; 2792 return val;
2793 2793
2794 lose: 2794 lose:
2795 Fsignal (Qscan_error, 2795 xsignal3 (Qscan_error,
2796 Fcons (build_string ("Unbalanced parentheses"), 2796 build_string ("Unbalanced parentheses"),
2797 Fcons (make_number (last_good), 2797 make_number (last_good), make_number (from));
2798 Fcons (make_number (from), Qnil))));
2799 abort ();
2800 /* NOTREACHED */
2801} 2798}
2802 2799
2803DEFUN ("scan-lists", Fscan_lists, Sscan_lists, 3, 3, 0, 2800DEFUN ("scan-lists", Fscan_lists, Sscan_lists, 3, 3, 0,
@@ -2924,7 +2921,7 @@ scan_sexps_forward (stateptr, from, from_byte, end, targetdepth,
2924 int boundary_stop = commentstop == -1; 2921 int boundary_stop = commentstop == -1;
2925 int nofence; 2922 int nofence;
2926 int found; 2923 int found;
2927 int out_bytepos, out_charpos; 2924 EMACS_INT out_bytepos, out_charpos;
2928 int temp; 2925 int temp;
2929 2926
2930 prev_from = from; 2927 prev_from = from;