Mercurial > hg > xemacs-beta
comparison src/syntax.c @ 398:74fd4e045ea6 r21-2-29
Import from CVS: tag r21-2-29
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:13:30 +0200 |
parents | 8626e4521993 |
children | 2f8bb876ab1d |
comparison
equal
deleted
inserted
replaced
397:f4aeb21a5bad | 398:74fd4e045ea6 |
---|---|
51 So, we introduced Sextword for Japanese letters. A character of | 51 So, we introduced Sextword for Japanese letters. A character of |
52 Sextword is a word-constituent but a word boundary may exist between | 52 Sextword is a word-constituent but a word boundary may exist between |
53 two such characters. */ | 53 two such characters. */ |
54 | 54 |
55 /* Mule 2.4 doesn't seem to have Sextword - I'm removing it -- mrb */ | 55 /* Mule 2.4 doesn't seem to have Sextword - I'm removing it -- mrb */ |
56 /* Recovered by tomo */ | |
56 | 57 |
57 Lisp_Object Qsyntax_table_p; | 58 Lisp_Object Qsyntax_table_p; |
58 | 59 |
59 int words_include_escapes; | 60 int words_include_escapes; |
60 | 61 |
114 | 115 |
115 static Bufpos | 116 static Bufpos |
116 find_defun_start (struct buffer *buf, Bufpos pos) | 117 find_defun_start (struct buffer *buf, Bufpos pos) |
117 { | 118 { |
118 Bufpos tem; | 119 Bufpos tem; |
119 struct Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); | 120 Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); |
120 | 121 |
121 /* Use previous finding, if it's valid and applies to this inquiry. */ | 122 /* Use previous finding, if it's valid and applies to this inquiry. */ |
122 if (buf == find_start_buffer | 123 if (buf == find_start_buffer |
123 /* Reuse the defun-start even if POS is a little farther on. | 124 /* Reuse the defun-start even if POS is a little farther on. |
124 POS might be in the next defun, but that's ok. | 125 POS might be in the next defun, but that's ok. |
221 | 222 |
222 /* Convert a letter which signifies a syntax code | 223 /* Convert a letter which signifies a syntax code |
223 into the code it signifies. | 224 into the code it signifies. |
224 This is used by modify-syntax-entry, and other things. */ | 225 This is used by modify-syntax-entry, and other things. */ |
225 | 226 |
226 CONST unsigned char syntax_spec_code[0400] = | 227 const unsigned char syntax_spec_code[0400] = |
227 { 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, | 228 { 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, |
228 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, | 229 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, |
229 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, | 230 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, |
230 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, | 231 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, |
231 (char) Swhitespace, 0377, (char) Sstring, 0377, | 232 (char) Swhitespace, 0377, (char) Sstring, 0377, |
243 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, | 244 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, |
244 0377, 0377, 0377, 0377, 0377, 0377, 0377, (char) Sword, | 245 0377, 0377, 0377, 0377, 0377, 0377, 0377, (char) Sword, |
245 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377 | 246 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377 |
246 }; | 247 }; |
247 | 248 |
248 CONST unsigned char syntax_code_spec[] = " .w_()'\"$\\/<>@"; | 249 const unsigned char syntax_code_spec[] = " .w_()'\"$\\/<>@"; |
249 | 250 |
250 DEFUN ("syntax-designator-chars", Fsyntax_designator_chars, 0, 0, 0, /* | 251 DEFUN ("syntax-designator-chars", Fsyntax_designator_chars, 0, 0, 0, /* |
251 Return a string of the recognized syntax designator chars. | 252 Return a string of the recognized syntax designator chars. |
252 The chars are ordered by their internal syntax codes, which are | 253 The chars are ordered by their internal syntax codes, which are |
253 numbered starting at 0. | 254 numbered starting at 0. |
265 Optional second argument TABLE defaults to the current buffer's | 266 Optional second argument TABLE defaults to the current buffer's |
266 syntax table. | 267 syntax table. |
267 */ | 268 */ |
268 (ch, table)) | 269 (ch, table)) |
269 { | 270 { |
270 struct Lisp_Char_Table *mirrortab; | 271 Lisp_Char_Table *mirrortab; |
271 | 272 |
272 if (NILP(ch)) | 273 if (NILP(ch)) |
273 { | 274 { |
274 ch = make_char('\000'); | 275 ch = make_char('\000'); |
275 } | 276 } |
311 Optional second argument TABLE defaults to the current buffer's | 312 Optional second argument TABLE defaults to the current buffer's |
312 syntax table. | 313 syntax table. |
313 */ | 314 */ |
314 (ch, table)) | 315 (ch, table)) |
315 { | 316 { |
316 struct Lisp_Char_Table *mirrortab; | 317 Lisp_Char_Table *mirrortab; |
317 int code; | 318 int code; |
318 | 319 |
319 CHECK_CHAR_COERCE_INT (ch); | 320 CHECK_CHAR_COERCE_INT (ch); |
320 table = check_syntax_table (table, current_buffer->syntax_table); | 321 table = check_syntax_table (table, current_buffer->syntax_table); |
321 mirrortab = XCHAR_TABLE (XCHAR_TABLE (table)->mirror_table); | 322 mirrortab = XCHAR_TABLE (XCHAR_TABLE (table)->mirror_table); |
325 return Qnil; | 326 return Qnil; |
326 } | 327 } |
327 | 328 |
328 | 329 |
329 | 330 |
330 static int | 331 #ifdef MULE |
331 word_constituent_p (struct buffer *buf, Bufpos pos, | 332 /* Return 1 if there is a word boundary between two word-constituent |
332 struct Lisp_Char_Table *tab) | 333 characters C1 and C2 if they appear in this order, else return 0. |
333 { | 334 There is no word boundary between two word-constituent ASCII |
334 enum syntaxcode code = SYNTAX_UNSAFE (tab, BUF_FETCH_CHAR (buf, pos)); | 335 characters. */ |
335 return ((words_include_escapes && | 336 #define WORD_BOUNDARY_P(c1, c2) \ |
336 (code == Sescape || code == Scharquote)) | 337 (!(CHAR_ASCII_P (c1) && CHAR_ASCII_P (c2)) \ |
337 || (code == Sword)); | 338 && word_boundary_p (c1, c2)) |
338 } | 339 |
340 extern int word_boundary_p (Emchar c1, Emchar c2); | |
341 #endif | |
339 | 342 |
340 /* Return the position across COUNT words from FROM. | 343 /* Return the position across COUNT words from FROM. |
341 If that many words cannot be found before the end of the buffer, return 0. | 344 If that many words cannot be found before the end of the buffer, return 0. |
342 COUNT negative means scan backward and stop at word beginning. */ | 345 COUNT negative means scan backward and stop at word beginning. */ |
343 | 346 |
344 Bufpos | 347 Bufpos |
345 scan_words (struct buffer *buf, Bufpos from, int count) | 348 scan_words (struct buffer *buf, Bufpos from, int count) |
346 { | 349 { |
347 Bufpos limit = count > 0 ? BUF_ZV (buf) : BUF_BEGV (buf); | 350 Bufpos limit = count > 0 ? BUF_ZV (buf) : BUF_BEGV (buf); |
348 struct Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); | 351 Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); |
352 Emchar ch0, ch1; | |
353 enum syntaxcode code; | |
354 | |
355 /* #### is it really worth it to hand expand both cases? JV */ | |
349 while (count > 0) | 356 while (count > 0) |
350 { | 357 { |
351 QUIT; | 358 QUIT; |
352 | 359 |
353 while (1) | 360 while (1) |
354 { | 361 { |
355 if (from == limit) | 362 if (from == limit) |
356 return 0; | 363 return 0; |
357 if (word_constituent_p (buf, from, mirrortab)) | 364 |
365 ch0 = BUF_FETCH_CHAR (buf, from); | |
366 code = SYNTAX_UNSAFE (mirrortab, ch0); | |
367 | |
368 from++; | |
369 if (words_include_escapes | |
370 && (code == Sescape || code == Scharquote)) | |
358 break; | 371 break; |
359 from++; | 372 if (code == Sword) |
373 break; | |
360 } | 374 } |
361 | 375 |
362 QUIT; | 376 QUIT; |
363 | 377 |
364 while ((from != limit) && word_constituent_p (buf, from, mirrortab)) | 378 while (from != limit) |
365 { | 379 { |
380 ch1 = BUF_FETCH_CHAR (buf, from); | |
381 code = SYNTAX_UNSAFE (mirrortab, ch1); | |
382 if (!(words_include_escapes | |
383 && (code == Sescape || code == Scharquote))) | |
384 if (code != Sword | |
385 #ifdef MULE | |
386 || WORD_BOUNDARY_P (ch0, ch1) | |
387 #endif | |
388 ) | |
389 break; | |
390 #ifdef MULE | |
391 ch0 = ch1; | |
392 #endif | |
366 from++; | 393 from++; |
367 } | 394 } |
368 count--; | 395 count--; |
369 } | 396 } |
370 | 397 |
374 | 401 |
375 while (1) | 402 while (1) |
376 { | 403 { |
377 if (from == limit) | 404 if (from == limit) |
378 return 0; | 405 return 0; |
379 if (word_constituent_p (buf, from - 1, mirrortab)) | 406 |
407 ch1 = BUF_FETCH_CHAR (buf, from - 1); | |
408 code = SYNTAX_UNSAFE (mirrortab, ch1); | |
409 | |
410 from--; | |
411 if (words_include_escapes | |
412 && (code == Sescape || code == Scharquote)) | |
380 break; | 413 break; |
381 from--; | 414 if (code == Sword) |
415 break; | |
382 } | 416 } |
383 | 417 |
384 QUIT; | 418 QUIT; |
385 | 419 |
386 while ((from != limit) && word_constituent_p (buf, from - 1, mirrortab)) | 420 while (from != limit) |
387 { | 421 { |
422 ch0 = BUF_FETCH_CHAR (buf, from - 1); | |
423 code = SYNTAX_UNSAFE (mirrortab, ch0); | |
424 if (!(words_include_escapes | |
425 && (code == Sescape || code == Scharquote))) | |
426 if (code != Sword | |
427 #ifdef MULE | |
428 || WORD_BOUNDARY_P (ch0, ch1) | |
429 #endif | |
430 ) | |
431 break; | |
432 #ifdef MULE | |
433 ch1 = ch0; | |
434 #endif | |
388 from--; | 435 from--; |
389 } | 436 } |
390 count++; | 437 count++; |
391 } | 438 } |
392 | 439 |
426 static int | 473 static int |
427 find_start_of_comment (struct buffer *buf, Bufpos from, Bufpos stop, int mask) | 474 find_start_of_comment (struct buffer *buf, Bufpos from, Bufpos stop, int mask) |
428 { | 475 { |
429 Emchar c; | 476 Emchar c; |
430 enum syntaxcode code; | 477 enum syntaxcode code; |
431 struct Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); | 478 Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); |
432 | 479 |
433 /* Look back, counting the parity of string-quotes, | 480 /* Look back, counting the parity of string-quotes, |
434 and recording the comment-starters seen. | 481 and recording the comment-starters seen. |
435 When we reach a safe place, assume that's not in a string; | 482 When we reach a safe place, assume that's not in a string; |
436 then step the main scan to the earliest comment-starter seen | 483 then step the main scan to the earliest comment-starter seen |
560 | 607 |
561 static Bufpos | 608 static Bufpos |
562 find_end_of_comment (struct buffer *buf, Bufpos from, Bufpos stop, int mask) | 609 find_end_of_comment (struct buffer *buf, Bufpos from, Bufpos stop, int mask) |
563 { | 610 { |
564 int c; | 611 int c; |
565 struct Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); | 612 Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); |
566 | 613 |
567 while (1) | 614 while (1) |
568 { | 615 { |
569 if (from == stop) | 616 if (from == stop) |
570 { | 617 { |
611 { | 658 { |
612 Bufpos from; | 659 Bufpos from; |
613 Bufpos stop; | 660 Bufpos stop; |
614 Emchar c; | 661 Emchar c; |
615 enum syntaxcode code; | 662 enum syntaxcode code; |
616 int count; | 663 EMACS_INT count; |
617 struct buffer *buf = decode_buffer (buffer, 0); | 664 struct buffer *buf = decode_buffer (buffer, 0); |
618 struct Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); | 665 Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); |
619 | 666 |
620 CHECK_INT (n); | 667 CHECK_INT (n); |
621 count = XINT (n); | 668 count = XINT (n); |
622 | 669 |
623 from = BUF_PT (buf); | 670 from = BUF_PT (buf); |
767 int quoted; | 814 int quoted; |
768 int mathexit = 0; | 815 int mathexit = 0; |
769 enum syntaxcode code; | 816 enum syntaxcode code; |
770 int min_depth = depth; /* Err out if depth gets less than this. */ | 817 int min_depth = depth; /* Err out if depth gets less than this. */ |
771 Lisp_Object syntaxtab = buf->syntax_table; | 818 Lisp_Object syntaxtab = buf->syntax_table; |
772 struct Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); | 819 Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); |
773 | 820 |
774 if (depth > 0) min_depth = 0; | 821 if (depth > 0) min_depth = 0; |
775 | 822 |
776 while (count > 0) | 823 while (count > 0) |
777 { | 824 { |
977 } | 1024 } |
978 | 1025 |
979 if (SYNTAX_PREFIX_UNSAFE (mirrortab, c)) | 1026 if (SYNTAX_PREFIX_UNSAFE (mirrortab, c)) |
980 continue; | 1027 continue; |
981 | 1028 |
982 switch (((quoted) ? Sword : code)) | 1029 switch (quoted ? Sword : code) |
983 { | 1030 { |
984 case Sword: | 1031 case Sword: |
985 case Ssymbol: | 1032 case Ssymbol: |
986 if (depth || !sexpflag) break; | 1033 if (depth || !sexpflag) break; |
987 /* This word counts as a sexp; count object finished after | 1034 /* This word counts as a sexp; count object finished after |
1086 char_quoted (struct buffer *buf, Bufpos pos) | 1133 char_quoted (struct buffer *buf, Bufpos pos) |
1087 { | 1134 { |
1088 enum syntaxcode code; | 1135 enum syntaxcode code; |
1089 Bufpos beg = BUF_BEGV (buf); | 1136 Bufpos beg = BUF_BEGV (buf); |
1090 int quoted = 0; | 1137 int quoted = 0; |
1091 struct Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); | 1138 Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); |
1092 | 1139 |
1093 while (pos > beg | 1140 while (pos > beg |
1094 && ((code = SYNTAX (mirrortab, BUF_FETCH_CHAR (buf, pos - 1))) | 1141 && ((code = SYNTAX (mirrortab, BUF_FETCH_CHAR (buf, pos - 1))) |
1095 == Scharquote | 1142 == Scharquote |
1096 || code == Sescape)) | 1143 || code == Sescape)) |
1168 (buffer)) | 1215 (buffer)) |
1169 { | 1216 { |
1170 struct buffer *buf = decode_buffer (buffer, 0); | 1217 struct buffer *buf = decode_buffer (buffer, 0); |
1171 Bufpos beg = BUF_BEGV (buf); | 1218 Bufpos beg = BUF_BEGV (buf); |
1172 Bufpos pos = BUF_PT (buf); | 1219 Bufpos pos = BUF_PT (buf); |
1173 struct Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); | 1220 Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); |
1174 | 1221 |
1175 while (pos > beg && !char_quoted (buf, pos - 1) | 1222 while (pos > beg && !char_quoted (buf, pos - 1) |
1176 && (SYNTAX (mirrortab, BUF_FETCH_CHAR (buf, pos - 1)) == Squote | 1223 && (SYNTAX (mirrortab, BUF_FETCH_CHAR (buf, pos - 1)) == Squote |
1177 || SYNTAX_PREFIX (mirrortab, BUF_FETCH_CHAR (buf, pos - 1)))) | 1224 || SYNTAX_PREFIX (mirrortab, BUF_FETCH_CHAR (buf, pos - 1)))) |
1178 pos--; | 1225 pos--; |
1208 int mindepth; /* Lowest DEPTH value seen. */ | 1255 int mindepth; /* Lowest DEPTH value seen. */ |
1209 int start_quoted = 0; /* Nonzero means starting after a char quote */ | 1256 int start_quoted = 0; /* Nonzero means starting after a char quote */ |
1210 Lisp_Object tem; | 1257 Lisp_Object tem; |
1211 int mask; /* comment mask */ | 1258 int mask; /* comment mask */ |
1212 Lisp_Object syntaxtab = buf->syntax_table; | 1259 Lisp_Object syntaxtab = buf->syntax_table; |
1213 struct Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); | 1260 Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); |
1214 | 1261 |
1215 if (NILP (oldstate)) | 1262 if (NILP (oldstate)) |
1216 { | 1263 { |
1217 depth = 0; | 1264 depth = 0; |
1218 state.instring = -1; | 1265 state.instring = -1; |
1561 put_char_table (XCHAR_TABLE (closure->mirrortab), range, val); | 1608 put_char_table (XCHAR_TABLE (closure->mirrortab), range, val); |
1562 return 0; | 1609 return 0; |
1563 } | 1610 } |
1564 | 1611 |
1565 static void | 1612 static void |
1566 update_just_this_syntax_table (struct Lisp_Char_Table *ct) | 1613 update_just_this_syntax_table (Lisp_Char_Table *ct) |
1567 { | 1614 { |
1568 struct chartab_range range; | 1615 struct chartab_range range; |
1569 struct cmst_arg arg; | 1616 struct cmst_arg arg; |
1570 | 1617 |
1571 arg.mirrortab = ct->mirror_table; | 1618 arg.mirrortab = ct->mirror_table; |
1579 If this is the standard syntax table, we need to recompute | 1626 If this is the standard syntax table, we need to recompute |
1580 *all* syntax tables (yuck). Otherwise we just recompute this | 1627 *all* syntax tables (yuck). Otherwise we just recompute this |
1581 one. */ | 1628 one. */ |
1582 | 1629 |
1583 void | 1630 void |
1584 update_syntax_table (struct Lisp_Char_Table *ct) | 1631 update_syntax_table (Lisp_Char_Table *ct) |
1585 { | 1632 { |
1586 /* Don't be stymied at startup. */ | 1633 /* Don't be stymied at startup. */ |
1587 if (CHAR_TABLEP (Vstandard_syntax_table) | 1634 if (CHAR_TABLEP (Vstandard_syntax_table) |
1588 && ct == XCHAR_TABLE (Vstandard_syntax_table)) | 1635 && ct == XCHAR_TABLE (Vstandard_syntax_table)) |
1589 { | 1636 { |
1631 vars_of_syntax (void) | 1678 vars_of_syntax (void) |
1632 { | 1679 { |
1633 DEFVAR_BOOL ("parse-sexp-ignore-comments", &parse_sexp_ignore_comments /* | 1680 DEFVAR_BOOL ("parse-sexp-ignore-comments", &parse_sexp_ignore_comments /* |
1634 Non-nil means `forward-sexp', etc., should treat comments as whitespace. | 1681 Non-nil means `forward-sexp', etc., should treat comments as whitespace. |
1635 */ ); | 1682 */ ); |
1636 | 1683 parse_sexp_ignore_comments = 0; |
1637 words_include_escapes = 0; | 1684 |
1638 DEFVAR_BOOL ("words-include-escapes", &words_include_escapes /* | 1685 DEFVAR_BOOL ("words-include-escapes", &words_include_escapes /* |
1639 Non-nil means `forward-word', etc., should treat escape chars part of words. | 1686 Non-nil means `forward-word', etc., should treat escape chars part of words. |
1640 */ ); | 1687 */ ); |
1688 words_include_escapes = 0; | |
1641 | 1689 |
1642 no_quit_in_re_search = 0; | 1690 no_quit_in_re_search = 0; |
1691 } | |
1692 | |
1693 static void | |
1694 define_standard_syntax (const char *p, enum syntaxcode syn) | |
1695 { | |
1696 for (; *p; p++) | |
1697 Fput_char_table (make_char (*p), make_int (syn), Vstandard_syntax_table); | |
1643 } | 1698 } |
1644 | 1699 |
1645 void | 1700 void |
1646 complex_vars_of_syntax (void) | 1701 complex_vars_of_syntax (void) |
1647 { | 1702 { |
1703 Emchar i; | |
1704 const char *p; | |
1648 /* Set this now, so first buffer creation can refer to it. */ | 1705 /* Set this now, so first buffer creation can refer to it. */ |
1649 /* Make it nil before calling copy-syntax-table | 1706 /* Make it nil before calling copy-syntax-table |
1650 so that copy-syntax-table will know not to try to copy from garbage */ | 1707 so that copy-syntax-table will know not to try to copy from garbage */ |
1651 Vstandard_syntax_table = Qnil; | 1708 Vstandard_syntax_table = Qnil; |
1652 Vstandard_syntax_table = Fcopy_syntax_table (Qnil); | 1709 Vstandard_syntax_table = Fcopy_syntax_table (Qnil); |
1653 staticpro (&Vstandard_syntax_table); | 1710 staticpro (&Vstandard_syntax_table); |
1654 | 1711 |
1655 Vsyntax_designator_chars_string = make_pure_string (syntax_code_spec, | 1712 Vsyntax_designator_chars_string = make_string_nocopy (syntax_code_spec, |
1656 Smax, Qnil, 1); | 1713 Smax); |
1657 staticpro (&Vsyntax_designator_chars_string); | 1714 staticpro (&Vsyntax_designator_chars_string); |
1658 | 1715 |
1659 fill_char_table (XCHAR_TABLE (Vstandard_syntax_table), | 1716 fill_char_table (XCHAR_TABLE (Vstandard_syntax_table), make_int (Spunct)); |
1660 make_int (Spunct)); | 1717 |
1661 | 1718 for (i = 0; i <= 32; i++) /* Control 0 plus SPACE */ |
1662 { | 1719 Fput_char_table (make_char (i), make_int (Swhitespace), |
1663 Emchar i; | 1720 Vstandard_syntax_table); |
1664 | 1721 for (i = 127; i <= 159; i++) /* DEL plus Control 1 */ |
1665 for (i = 0; i <= 32; i++) | 1722 Fput_char_table (make_char (i), make_int (Swhitespace), |
1666 Fput_char_table (make_char (i), make_int ((int) Swhitespace), | 1723 Vstandard_syntax_table); |
1724 | |
1725 define_standard_syntax ("abcdefghijklmnopqrstuvwxyz" | |
1726 "ABCDEFGHIJKLMNOPQRSTUVWXYZ" | |
1727 "0123456789" | |
1728 "$%", Sword); | |
1729 define_standard_syntax ("\"", Sstring); | |
1730 define_standard_syntax ("\\", Sescape); | |
1731 define_standard_syntax ("_-+*/&|<>=", Ssymbol); | |
1732 define_standard_syntax (".,;:?!#@~^'`", Spunct); | |
1733 | |
1734 for (p = "()[]{}"; *p; p+=2) | |
1735 { | |
1736 Fput_char_table (make_char (p[0]), | |
1737 Fcons (make_int (Sopen), make_char (p[1])), | |
1667 Vstandard_syntax_table); | 1738 Vstandard_syntax_table); |
1668 for (i = 127; i <= 159; i++) | 1739 Fput_char_table (make_char (p[1]), |
1669 Fput_char_table (make_char (i), make_int ((int) Swhitespace), | 1740 Fcons (make_int (Sclose), make_char (p[0])), |
1670 Vstandard_syntax_table); | 1741 Vstandard_syntax_table); |
1671 | 1742 } |
1672 for (i = 'a'; i <= 'z'; i++) | 1743 } |
1673 Fput_char_table (make_char (i), make_int ((int) Sword), | |
1674 Vstandard_syntax_table); | |
1675 for (i = 'A'; i <= 'Z'; i++) | |
1676 Fput_char_table (make_char (i), make_int ((int) Sword), | |
1677 Vstandard_syntax_table); | |
1678 for (i = '0'; i <= '9'; i++) | |
1679 Fput_char_table (make_char (i), make_int ((int) Sword), | |
1680 Vstandard_syntax_table); | |
1681 Fput_char_table (make_char ('$'), make_int ((int) Sword), | |
1682 Vstandard_syntax_table); | |
1683 Fput_char_table (make_char ('%'), make_int ((int) Sword), | |
1684 Vstandard_syntax_table); | |
1685 | |
1686 { | |
1687 Fput_char_table (make_char ('('), Fcons (make_int ((int) Sopen), | |
1688 make_char (')')), | |
1689 Vstandard_syntax_table); | |
1690 Fput_char_table (make_char (')'), Fcons (make_int ((int) Sclose), | |
1691 make_char ('(')), | |
1692 Vstandard_syntax_table); | |
1693 Fput_char_table (make_char ('['), Fcons (make_int ((int) Sopen), | |
1694 make_char (']')), | |
1695 Vstandard_syntax_table); | |
1696 Fput_char_table (make_char (']'), Fcons (make_int ((int) Sclose), | |
1697 make_char ('[')), | |
1698 Vstandard_syntax_table); | |
1699 Fput_char_table (make_char ('{'), Fcons (make_int ((int) Sopen), | |
1700 make_char ('}')), | |
1701 Vstandard_syntax_table); | |
1702 Fput_char_table (make_char ('}'), Fcons (make_int ((int) Sclose), | |
1703 make_char ('{')), | |
1704 Vstandard_syntax_table); | |
1705 } | |
1706 | |
1707 Fput_char_table (make_char ('"'), make_int ((int) Sstring), | |
1708 Vstandard_syntax_table); | |
1709 Fput_char_table (make_char ('\\'), make_int ((int) Sescape), | |
1710 Vstandard_syntax_table); | |
1711 | |
1712 { | |
1713 CONST char *p; | |
1714 for (p = "_-+*/&|<>="; *p; p++) | |
1715 Fput_char_table (make_char (*p), make_int ((int) Ssymbol), | |
1716 Vstandard_syntax_table); | |
1717 | |
1718 for (p = ".,;:?!#@~^'`"; *p; p++) | |
1719 Fput_char_table (make_char (*p), make_int ((int) Spunct), | |
1720 Vstandard_syntax_table); | |
1721 } | |
1722 } | |
1723 } |