aboutsummaryrefslogtreecommitdiffstats
path: root/src/syntax.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/syntax.h')
-rw-r--r--src/syntax.h51
1 files changed, 2 insertions, 49 deletions
diff --git a/src/syntax.h b/src/syntax.h
index 9eaf553f2e5..48146572d19 100644
--- a/src/syntax.h
+++ b/src/syntax.h
@@ -128,56 +128,9 @@ extern Lisp_Object syntax_temp;
128 : Qnil)) 128 : Qnil))
129#endif 129#endif
130 130
131/* Then there are seven single-bit flags that have the following meanings:
132 1. This character is the first of a two-character comment-start sequence.
133 2. This character is the second of a two-character comment-start sequence.
134 3. This character is the first of a two-character comment-end sequence.
135 4. This character is the second of a two-character comment-end sequence.
136 5. This character is a prefix, for backward-prefix-chars.
137 6. see below
138 7. This character is part of a nestable comment sequence.
139 Note that any two-character sequence whose first character has flag 1
140 and whose second character has flag 2 will be interpreted as a comment start.
141 131
142 bit 6 is used to discriminate between two different comment styles. 132/* Whether the syntax of the character C has the prefix flag set. */
143 Languages such as C++ allow two orthogonal syntax start/end pairs 133extern int syntax_prefix_flag_p (int c);
144 and bit 6 is used to determine whether a comment-end or Scommentend
145 ends style a or b. Comment start sequences can start style a or b.
146 Style a is always the default.
147 */
148
149/* These macros extract a particular flag for a given character. */
150
151#define SYNTAX_COMSTART_FIRST(c) ((SYNTAX_WITH_FLAGS (c) >> 16) & 1)
152
153#define SYNTAX_COMSTART_SECOND(c) ((SYNTAX_WITH_FLAGS (c) >> 17) & 1)
154
155#define SYNTAX_COMEND_FIRST(c) ((SYNTAX_WITH_FLAGS (c) >> 18) & 1)
156
157#define SYNTAX_COMEND_SECOND(c) ((SYNTAX_WITH_FLAGS (c) >> 19) & 1)
158
159#define SYNTAX_PREFIX(c) ((SYNTAX_WITH_FLAGS (c) >> 20) & 1)
160
161#define SYNTAX_COMMENT_STYLE(c) ((SYNTAX_WITH_FLAGS (c) >> 21) & 1)
162
163#define SYNTAX_COMMENT_NESTED(c) ((SYNTAX_WITH_FLAGS (c) >> 22) & 1)
164
165/* These macros extract specific flags from an integer
166 that holds the syntax code and the flags. */
167
168#define SYNTAX_FLAGS_COMSTART_FIRST(flags) (((flags) >> 16) & 1)
169
170#define SYNTAX_FLAGS_COMSTART_SECOND(flags) (((flags) >> 17) & 1)
171
172#define SYNTAX_FLAGS_COMEND_FIRST(flags) (((flags) >> 18) & 1)
173
174#define SYNTAX_FLAGS_COMEND_SECOND(flags) (((flags) >> 19) & 1)
175
176#define SYNTAX_FLAGS_PREFIX(flags) (((flags) >> 20) & 1)
177
178#define SYNTAX_FLAGS_COMMENT_STYLE(flags) (((flags) >> 21) & 1)
179
180#define SYNTAX_FLAGS_COMMENT_NESTED(flags) (((flags) >> 22) & 1)
181 134
182/* This array, indexed by a character, contains the syntax code which that 135/* This array, indexed by a character, contains the syntax code which that
183 character signifies (as a char). For example, 136 character signifies (as a char). For example,