aboutsummaryrefslogtreecommitdiffstats
path: root/src/syntax.c
diff options
context:
space:
mode:
authorBill Wohler2013-02-18 10:11:43 -0800
committerBill Wohler2013-02-18 10:11:43 -0800
commit21733e4f154f8830fa568a347a0d6dbd59793c2b (patch)
tree3170dbbcdfafeb42f6c381d6b80b251e9f31b788 /src/syntax.c
parent6d14beddb06b5ae86f9dd770a1661ebd24846f28 (diff)
parent587feed443522f738b65b57b22a31cc8a25525c5 (diff)
downloademacs-21733e4f154f8830fa568a347a0d6dbd59793c2b.tar.gz
emacs-21733e4f154f8830fa568a347a0d6dbd59793c2b.zip
Merge from trunk; up to 2013-02-18T01:30:27Z!monnier@iro.umontreal.ca.
Diffstat (limited to 'src/syntax.c')
-rw-r--r--src/syntax.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/syntax.c b/src/syntax.c
index d3cafcc472e..390d732944d 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -1,6 +1,6 @@
1/* GNU Emacs routines to deal with syntax tables; also word and list parsing. 1/* GNU Emacs routines to deal with syntax tables; also word and list parsing.
2 Copyright (C) 1985, 1987, 1993-1995, 1997-1999, 2001-2012 2 Copyright (C) 1985, 1987, 1993-1995, 1997-1999, 2001-2013 Free
3 Free Software Foundation, Inc. 3 Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -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). */
@@ -3277,6 +3278,7 @@ do { prev_from = from; \
3277 3278
3278 stop: /* Here if stopping before start of sexp. */ 3279 stop: /* Here if stopping before start of sexp. */
3279 from = prev_from; /* We have just fetched the char that starts it; */ 3280 from = prev_from; /* We have just fetched the char that starts it; */
3281 from_byte = prev_from_byte;
3280 goto done; /* but return the position before it. */ 3282 goto done; /* but return the position before it. */
3281 3283
3282 endquoted: 3284 endquoted:
@@ -3288,6 +3290,7 @@ do { prev_from = from; \
3288 state.prevlevelstart 3290 state.prevlevelstart
3289 = (curlevel == levelstart) ? -1 : (curlevel - 1)->last; 3291 = (curlevel == levelstart) ? -1 : (curlevel - 1)->last;
3290 state.location = from; 3292 state.location = from;
3293 state.location_byte = from_byte;
3291 state.levelstarts = Qnil; 3294 state.levelstarts = Qnil;
3292 while (curlevel > levelstart) 3295 while (curlevel > levelstart)
3293 state.levelstarts = Fcons (make_number ((--curlevel)->last), 3296 state.levelstarts = Fcons (make_number ((--curlevel)->last),
@@ -3327,7 +3330,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. 3330Sixth 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 3331 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. */) 3332 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) 3333 (Lisp_Object from, Lisp_Object to, Lisp_Object targetdepth,
3334 Lisp_Object stopbefore, Lisp_Object oldstate, Lisp_Object commentstop)
3331{ 3335{
3332 struct lisp_parse_state state; 3336 struct lisp_parse_state state;
3333 EMACS_INT target; 3337 EMACS_INT target;
@@ -3347,7 +3351,7 @@ Sixth arg COMMENTSTOP non-nil means stop at the start of a comment.
3347 (NILP (commentstop) 3351 (NILP (commentstop)
3348 ? 0 : (EQ (commentstop, Qsyntax_table) ? -1 : 1))); 3352 ? 0 : (EQ (commentstop, Qsyntax_table) ? -1 : 1)));
3349 3353
3350 SET_PT (state.location); 3354 SET_PT_BOTH (state.location, state.location_byte);
3351 3355
3352 return Fcons (make_number (state.depth), 3356 return Fcons (make_number (state.depth),
3353 Fcons (state.prevlevelstart < 0 3357 Fcons (state.prevlevelstart < 0
@@ -3389,8 +3393,8 @@ init_syntax_once (void)
3389 Qchar_table_extra_slots = intern_c_string ("char-table-extra-slots"); 3393 Qchar_table_extra_slots = intern_c_string ("char-table-extra-slots");
3390 3394
3391 /* Create objects which can be shared among syntax tables. */ 3395 /* Create objects which can be shared among syntax tables. */
3392 Vsyntax_code_object = Fmake_vector (make_number (Smax), Qnil); 3396 Vsyntax_code_object = make_uninit_vector (Smax);
3393 for (i = 0; i < ASIZE (Vsyntax_code_object); i++) 3397 for (i = 0; i < Smax; i++)
3394 ASET (Vsyntax_code_object, i, Fcons (make_number (i), Qnil)); 3398 ASET (Vsyntax_code_object, i, Fcons (make_number (i), Qnil));
3395 3399
3396 /* Now we are ready to set up this property, so we can 3400 /* Now we are ready to set up this property, so we can