[ < ] | [ > ] | [ << ] | [Plus haut] | [ >> ] | [Top] | [Table des matières] | [Index] | [ ? ] |
In addition to the classes, entries for characters in a syntax table can specify flags. There are seven possible flags, represented by the characters ‘1’, ‘2’, ‘3’, ‘4’, ‘b’, ‘n’, and ‘p’.
All the flags except ‘n’ and ‘p’ are used to describe multi-character comment delimiters. The digit flags indicate that a character can also be part of a comment sequence, in addition to the syntactic properties associated with its character class. The flags are independent of the class and each other for the sake of characters such as ‘*’ in C mode, which is a punctuation character, and the second character of a start-of-comment sequence (‘/*’), and the first character of an end-of-comment sequence (‘*/’).
Here is a table of the possible flags for a character c, and what they mean:
Emacs supports two comment styles simultaneously in any one syntax table. This is for the sake of C++. Each style of comment syntax has its own comment-start sequence and its own comment-end sequence. Each comment must stick to one style or the other; thus, if it starts with the comment-start sequence of style “b,” it must also end with the comment-end sequence of style “b.”
The two comment-start sequences must begin with the same character; only the second character may differ. Mark the second character of the “b”-style comment-start sequence with the ‘b’ flag.
A comment-end sequence (one or two characters) applies to the “b” style if its first character has the ‘b’ flag set; otherwise, it applies to the “a” style.
The appropriate comment syntax settings for C++ are as follows:
‘124b’
‘23’
‘>b’
This defines four comment-delimiting sequences:
This is a comment-start sequence for “a” style because the second character, ‘*’, does not have the ‘b’ flag.
This is a comment-start sequence for “b” style because the second character, ‘/’, does have the ‘b’ flag.
This is a comment-end sequence for “a” style because the first character, ‘*’, does not have the ‘b’ flag.
This is a comment-end sequence for “b” style, because the newline character has the ‘b’ flag.
The function backward-prefix-chars
moves back over these characters,
as well as over characters whose primary syntax class is prefix (‘'’).
Voir la section Motion and Syntax.
[ < ] | [ > ] | [ << ] | [Plus haut] | [ >> ] | [Top] | [Table des matières] | [Index] | [ ? ] |
Ce document a été généré par Eric Reinbold le 13 Octobre 2007 en utilisant texi2html 1.78.