• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/src/

Lines Matching +refs:syntax +refs:table

1 /* GNU Emacs routines to deal with syntax tables; also word and list parsing.
33 /* Make syntax table lookup grant data in gl_state. */
36 #include "syntax.h"
55 /* Used as a temporary in SYNTAX_ENTRY and other macros in syntax.h,
114 struct gl_state_s gl_state; /* Global state of syntax parser. */
127 current syntax-table basing on the property of this interval, and
211 { /* with the same table => */
293 Global syntax-table data should be set up already to be good at CHARPOS
294 or after. On return global syntax data is good for lookup at CHARPOS. */
364 There is no promise at which position the global syntax data is
394 /* We optimize syntax-table lookup for rare updates. Thus we accept
396 syntax-tables. */
476 Global syntax data remains valid for backward search starting at
513 int syntax = 0;
530 prev_syntax = syntax;
532 syntax = SYNTAX_WITH_FLAGS (c);
536 com2start = (SYNTAX_FLAGS_COMSTART_FIRST (syntax)
540 || SYNTAX_FLAGS_COMMENT_NESTED (syntax)) == comnested);
541 com2end = (SYNTAX_FLAGS_COMEND_FIRST (syntax)
563 && SYNTAX_FLAGS_COMEND_SECOND (syntax)
566 && SYNTAX_FLAGS_COMSTART_SECOND (syntax)
567 && comstyle == SYNTAX_FLAGS_COMMENT_STYLE (syntax)
580 /* Turn a 2-char comment sequences into the appropriate syntax. */
587 && (comstyle != SYNTAX_FLAGS_COMMENT_STYLE (syntax)
588 || SYNTAX_FLAGS_COMMENT_NESTED (syntax) != comnested))
637 if (SYNTAX_FLAGS_COMMENT_STYLE (syntax) == comstyle
639 || SYNTAX_FLAGS_COMMENT_NESTED (syntax)) == comnested)
743 DEFUN ("syntax-table-p", Fsyntax_table_p, Ssyntax_table_p, 1, 1, 0,
744 doc: /* Return t if OBJECT is a syntax table.
745 Currently, any char-table counts as a syntax table. */)
763 DEFUN ("syntax-table", Fsyntax_table, Ssyntax_table, 0, 0, 0,
764 doc: /* Return the current syntax table.
771 DEFUN ("standard-syntax-table", Fstandard_syntax_table,
773 doc: /* Return the standard syntax table.
780 DEFUN ("copy-syntax-table", Fcopy_syntax_table, Scopy_syntax_table, 0, 1, 0,
781 doc: /* Construct a new syntax table and return it.
782 It is a copy of the TABLE, which defaults to the standard syntax table. */)
783 (table)
784 Lisp_Object table;
788 if (!NILP (table))
789 check_syntax_table (table);
791 table = Vstandard_syntax_table;
793 copy = Fcopy_sequence (table);
795 /* Only the standard syntax table should have a default element.
796 Other syntax tables should inherit from parents instead. */
799 /* Copied syntax tables should all have parents.
800 If we copied one with no parent, such as the standard syntax table,
801 use the standard syntax table as the copy's parent. */
807 DEFUN ("set-syntax-table", Fset_syntax_table, Sset_syntax_table, 1, 1, 0,
808 doc: /* Select a new syntax table for the current buffer.
809 One argument, a syntax table. */)
810 (table)
811 Lisp_Object table;
814 check_syntax_table (table);
815 current_buffer->syntax_table = table;
816 /* Indicate that this buffer now has a specified syntax table. */
819 return table;
823 /* Convert a letter which signifies a syntax code
825 This is used by modify-syntax-entry, and other things. */
849 /* Indexed by syntax code, give the letter that describes it. */
857 /* Indexed by syntax code, give the object (cons of syntax code and
858 nil) to be stored in syntax table. Since these objects can be
859 shared among syntax tables, we generate them in advance. By
860 sharing objects, the function `describe-syntax' can give a more
866 /* Look up the value for CHARACTER in syntax table TABLE's parent
871 syntax_parent_lookup (table, character)
872 Lisp_Object table;
879 table = XCHAR_TABLE (table)->parent;
880 if (NILP (table))
883 value = XCHAR_TABLE (table)->contents[character];
889 DEFUN ("char-syntax", Fchar_syntax, Schar_syntax, 1, 1, 0,
890 doc: /* Return the syntax code of CHARACTER, described by a character.
893 The characters that correspond to various syntax codes
894 are listed in the documentation of `modify-syntax-entry'. */)
923 DEFUN ("string-to-syntax", Fstring_to_syntax, Sstring_to_syntax, 1, 1, 0,
924 doc: /* Convert a syntax specification STRING into syntax cell form.
926 `modify-syntax-entry'. Value is the equivalent cons cell
927 \(CODE . MATCHING-CHAR) that can be used as value of a `syntax-table'
942 error ("Invalid syntax description letter: %c", p[-1]);
1002 DEFUN ("modify-syntax-entry", Fmodify_syntax_entry, Smodify_syntax_entry, 2, 3,
1003 "cSet syntax for character: \nsSet syntax for %s to: ",
1004 doc: /* Set syntax for character CHAR according to string NEWENTRY.
1005 The syntax is changed only for table SYNTAX-TABLE, which defaults to
1006 the current buffer's syntax table.
1008 Space or - whitespace syntax. w word constituent.
1014 / character-quote. @ inherit from `standard-syntax-table'.
1039 usage: (modify-syntax-entry CHAR NEWENTRY &optional SYNTAX-TABLE) */)
1060 /* Dump syntax table to buffer in human-readable format */
1062 DEFUN ("internal-describe-syntax-value", Finternal_describe_syntax_value,
1064 doc: /* Insert a description of the internal syntax description SYNTAX at point. */)
1065 (syntax)
1066 Lisp_Object syntax;
1071 Lisp_Object first, match_lisp, value = syntax;
1076 return syntax;
1081 insert_string ("deeper char-table ...");
1082 return syntax;
1088 return syntax;
1097 return syntax;
1112 return syntax;
1179 return syntax;
1205 return syntax;
1371 DEFUN ("skip-syntax-forward", Fskip_syntax_forward, Sskip_syntax_forward, 1, 2, 0,
1372 doc: /* Move point forward across chars in specified syntax classes.
1373 SYNTAX is a string of syntax code characters.
1374 Stop before a char whose syntax is not in SYNTAX, or at position LIM.
1375 If SYNTAX starts with ^, skip characters whose syntax is NOT in SYNTAX.
1377 (syntax, lim)
1378 Lisp_Object syntax, lim;
1380 return skip_chars (1, 1, syntax, lim, 0);
1383 DEFUN ("skip-syntax-backward", Fskip_syntax_backward, Sskip_syntax_backward, 1, 2, 0,
1384 doc: /* Move point backward across chars in specified syntax classes.
1385 SYNTAX is a string of syntax code characters.
1386 Stop on reaching a char whose syntax is not in SYNTAX, or at position LIM.
1387 If SYNTAX starts with ^, skip characters whose syntax is NOT in SYNTAX.
1389 (syntax, lim)
1390 Lisp_Object syntax, lim;
1392 return skip_chars (0, 1, syntax, lim, 0);
1724 we must look up the character in the table
1726 table, that character is not what we want to
1905 Global syntax data is assumed to initially be valid for FROM and
1918 register int syntax;
1924 syntax = prev_syntax;
1925 if (syntax != 0) goto forw_incomment;
1937 syntax = SYNTAX_WITH_FLAGS (c);
1938 code = syntax & 0xff;
1940 && SYNTAX_FLAGS_COMMENT_STYLE (syntax) == style
1941 && (SYNTAX_FLAGS_COMMENT_NESTED (syntax) ?
1955 && SYNTAX_FLAGS_COMMENT_NESTED (syntax)
1956 && SYNTAX_FLAGS_COMMENT_STYLE (syntax) == style)
1964 if (from < stop && SYNTAX_FLAGS_COMEND_FIRST (syntax)
1965 && SYNTAX_FLAGS_COMMENT_STYLE (syntax) == style
1968 && ((SYNTAX_FLAGS_COMMENT_NESTED (syntax) ||
1984 && SYNTAX_FLAGS_COMSTART_FIRST (syntax)
1988 && (SYNTAX_FLAGS_COMMENT_NESTED (syntax) ||
2130 /* Calling char_quoted, above, set up global syntax position
2213 /* Return syntax code of character C if C is a single byte character
2642 doc: /* Move point backward over any number of chars with prefix syntax.
2643 This includes chars with "quote" or "prefix" syntax (' or p). */)
2665 /* Previous statement updates syntax table. */
2979 a syntax-table property which says it is NOT
3038 doc: /* Parse Lisp syntax starting at FROM until TO; return status of parse at TO.
3054 7. t if in a comment of style b; symbol `syntax-table' if the comment
3066 If it is symbol `syntax-table', stop after the start of a comment or a
3121 Qsyntax_table = intern ("syntax-table");
3127 Qchar_table_extra_slots = intern ("char-table-extra-slots");
3129 /* Create objects which can be shared among syntax tables. */
3136 create syntax tables. */
3199 /* All multibyte characters have syntax `word' by default. */
3208 Qsyntax_table_p = intern ("syntax-table-p");
3232 doc: /* Non-nil means `forward-sexp', etc., obey `syntax-table' property.
3235 `syntax-table' property. */);
3241 DEFVAR_BOOL ("multibyte-syntax-as-symbol", &multibyte_syntax_as_symbol,