aboutsummaryrefslogtreecommitdiffstats
path: root/src/syntax.c
diff options
context:
space:
mode:
authorJoakim Verona2013-02-09 00:03:39 +0100
committerJoakim Verona2013-02-09 00:03:39 +0100
commit4df065db6acba3975884b435422773ab97f32a00 (patch)
tree37a7fd1db38463d6de1acd0269588bf5a5ba9ded /src/syntax.c
parente38ad9acca0c806654313993728f9fabd1090f4f (diff)
parent75a65c7eb471bb7c6a5b7dc14a762ff997a5d354 (diff)
downloademacs-4df065db6acba3975884b435422773ab97f32a00.tar.gz
emacs-4df065db6acba3975884b435422773ab97f32a00.zip
auto upstream
Diffstat (limited to 'src/syntax.c')
-rw-r--r--src/syntax.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/syntax.c b/src/syntax.c
index 72d904914ec..42500b0cb76 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -121,6 +121,7 @@ struct lisp_parse_state
121 /* Char number of start of containing expression */ 121 /* Char number of start of containing expression */
122 ptrdiff_t prevlevelstart; 122 ptrdiff_t prevlevelstart;
123 ptrdiff_t location; /* Char number at which parsing stopped. */ 123 ptrdiff_t location; /* Char number at which parsing stopped. */
124 ptrdiff_t location_byte; /* Corresponding byte position. */
124 ptrdiff_t comstr_start; /* Position of last comment/string starter. */ 125 ptrdiff_t comstr_start; /* Position of last comment/string starter. */
125 Lisp_Object levelstarts; /* Char numbers of starts-of-expression 126 Lisp_Object levelstarts; /* Char numbers of starts-of-expression
126 of levels (starting from outermost). */ 127 of levels (starting from outermost). */
@@ -3288,6 +3289,7 @@ do { prev_from = from; \
3288 state.prevlevelstart 3289 state.prevlevelstart
3289 = (curlevel == levelstart) ? -1 : (curlevel - 1)->last; 3290 = (curlevel == levelstart) ? -1 : (curlevel - 1)->last;
3290 state.location = from; 3291 state.location = from;
3292 state.location_byte = from_byte;
3291 state.levelstarts = Qnil; 3293 state.levelstarts = Qnil;
3292 while (curlevel > levelstart) 3294 while (curlevel > levelstart)
3293 state.levelstarts = Fcons (make_number ((--curlevel)->last), 3295 state.levelstarts = Fcons (make_number ((--curlevel)->last),
@@ -3327,7 +3329,8 @@ Fifth arg OLDSTATE is a list like what this function returns.
3327Sixth arg COMMENTSTOP non-nil means stop at the start of a comment. 3329Sixth arg COMMENTSTOP non-nil means stop at the start of a comment.
3328 If it is symbol `syntax-table', stop after the start of a comment or a 3330 If it is symbol `syntax-table', stop after the start of a comment or a
3329 string, or after end of a comment or a string. */) 3331 string, or after end of a comment or a string. */)
3330 (Lisp_Object from, Lisp_Object to, Lisp_Object targetdepth, Lisp_Object stopbefore, Lisp_Object oldstate, Lisp_Object commentstop) 3332 (Lisp_Object from, Lisp_Object to, Lisp_Object targetdepth,
3333 Lisp_Object stopbefore, Lisp_Object oldstate, Lisp_Object commentstop)
3331{ 3334{
3332 struct lisp_parse_state state; 3335 struct lisp_parse_state state;
3333 EMACS_INT target; 3336 EMACS_INT target;
@@ -3347,7 +3350,7 @@ Sixth arg COMMENTSTOP non-nil means stop at the start of a comment.
3347 (NILP (commentstop) 3350 (NILP (commentstop)
3348 ? 0 : (EQ (commentstop, Qsyntax_table) ? -1 : 1))); 3351 ? 0 : (EQ (commentstop, Qsyntax_table) ? -1 : 1)));
3349 3352
3350 SET_PT (state.location); 3353 SET_PT_BOTH (state.location, state.location_byte);
3351 3354
3352 return Fcons (make_number (state.depth), 3355 return Fcons (make_number (state.depth),
3353 Fcons (state.prevlevelstart < 0 3356 Fcons (state.prevlevelstart < 0
@@ -3389,8 +3392,8 @@ init_syntax_once (void)
3389 Qchar_table_extra_slots = intern_c_string ("char-table-extra-slots"); 3392 Qchar_table_extra_slots = intern_c_string ("char-table-extra-slots");
3390 3393
3391 /* Create objects which can be shared among syntax tables. */ 3394 /* Create objects which can be shared among syntax tables. */
3392 Vsyntax_code_object = Fmake_vector (make_number (Smax), Qnil); 3395 Vsyntax_code_object = make_uninit_vector (Smax);
3393 for (i = 0; i < ASIZE (Vsyntax_code_object); i++) 3396 for (i = 0; i < Smax; i++)
3394 ASET (Vsyntax_code_object, i, Fcons (make_number (i), Qnil)); 3397 ASET (Vsyntax_code_object, i, Fcons (make_number (i), Qnil));
3395 3398
3396 /* Now we are ready to set up this property, so we can 3399 /* Now we are ready to set up this property, so we can