Mercurial > hg > xemacs-beta
comparison src/font-lock.c @ 185:3d6bfa290dbd r20-3b19
Import from CVS: tag r20-3b19
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:55:28 +0200 |
parents | 131b0175ea99 |
children | c5d627a313b1 |
comparison
equal
deleted
inserted
replaced
184:bcd2674570bf | 185:3d6bfa290dbd |
---|---|
26 this by picking a point "known" to be outside of any syntactic constructs | 26 this by picking a point "known" to be outside of any syntactic constructs |
27 and moving forward, examining the syntax of each character. | 27 and moving forward, examining the syntax of each character. |
28 | 28 |
29 Two caches are used: one caches the last point computed, and the other | 29 Two caches are used: one caches the last point computed, and the other |
30 caches the last point at the beginning of a line. This makes there | 30 caches the last point at the beginning of a line. This makes there |
31 be little penalty for moving left-to-right on a line a character at a | 31 be little penalty for moving left-to-right on a line a character at a |
32 time; makes starting over on a line be cheap; and makes random-accessing | 32 time; makes starting over on a line be cheap; and makes random-accessing |
33 within a line relatively cheap. | 33 within a line relatively cheap. |
34 | 34 |
35 When we move to a different line farther down in the file (but within the | 35 When we move to a different line farther down in the file (but within the |
36 current top-level form) we simply continue computing forward. If we move | 36 current top-level form) we simply continue computing forward. If we move |
37 backward more than a line, or move beyond the end of the current tlf, or | 37 backward more than a line, or move beyond the end of the current tlf, or |
38 switch buffers, then we call `beginning-of-defun' and start over from | 38 switch buffers, then we call `beginning-of-defun' and start over from |
39 there. | 39 there. |
40 | 40 |
41 #### We should really rewrite this to keep extents over the buffer | 41 #### We should really rewrite this to keep extents over the buffer |
42 that hold the current syntactic information. This would be a big win. | 42 that hold the current syntactic information. This would be a big win. |
43 This way there would be no guessing or incorrect results. | 43 This way there would be no guessing or incorrect results. |
398 (SYNTAX_STYLES_MATCH_END_P (table, c1, c2, SYNTAX_COMMENT_STYLE_A) ? \ | 398 (SYNTAX_STYLES_MATCH_END_P (table, c1, c2, SYNTAX_COMMENT_STYLE_A) ? \ |
399 comment_style_a : \ | 399 comment_style_a : \ |
400 SYNTAX_STYLES_MATCH_END_P (table, c1, c2, SYNTAX_COMMENT_STYLE_B) ? \ | 400 SYNTAX_STYLES_MATCH_END_P (table, c1, c2, SYNTAX_COMMENT_STYLE_B) ? \ |
401 comment_style_b : \ | 401 comment_style_b : \ |
402 comment_style_none) | 402 comment_style_none) |
403 | 403 |
404 #define SINGLE_SYNTAX_STYLE(table, c) \ | 404 #define SINGLE_SYNTAX_STYLE(table, c) \ |
405 (SYNTAX_STYLES_MATCH_1CHAR_P (table, c, SYNTAX_COMMENT_STYLE_A) ? \ | 405 (SYNTAX_STYLES_MATCH_1CHAR_P (table, c, SYNTAX_COMMENT_STYLE_A) ? \ |
406 comment_style_a : \ | 406 comment_style_a : \ |
407 SYNTAX_STYLES_MATCH_1CHAR_P (table, c, SYNTAX_COMMENT_STYLE_B) ? \ | 407 SYNTAX_STYLES_MATCH_1CHAR_P (table, c, SYNTAX_COMMENT_STYLE_B) ? \ |
408 comment_style_b : \ | 408 comment_style_b : \ |