diff options
Diffstat (limited to 'src/syntax.h')
| -rw-r--r-- | src/syntax.h | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/src/syntax.h b/src/syntax.h index 1350d87162b..73fbb153338 100644 --- a/src/syntax.h +++ b/src/syntax.h | |||
| @@ -83,35 +83,49 @@ struct gl_state_s | |||
| 83 | extern struct gl_state_s gl_state; | 83 | extern struct gl_state_s gl_state; |
| 84 | 84 | ||
| 85 | /* Fetch the information from the entry for character C | 85 | /* Fetch the information from the entry for character C |
| 86 | in syntax table TABLE, or from globally kept data (gl_state). | 86 | in the current buffer's syntax table, |
| 87 | or (if VIA_PROPERTY) from globally kept data (gl_state). | ||
| 87 | Does inheritance. */ | 88 | Does inheritance. */ |
| 88 | 89 | ||
| 89 | INLINE Lisp_Object | 90 | INLINE Lisp_Object |
| 90 | SYNTAX_ENTRY (int c) | 91 | syntax_property_entry (int c, bool via_property) |
| 91 | { | 92 | { |
| 92 | #ifdef SYNTAX_ENTRY_VIA_PROPERTY | 93 | if (via_property) |
| 93 | return (gl_state.use_global | 94 | return (gl_state.use_global |
| 94 | ? gl_state.global_code | 95 | ? gl_state.global_code |
| 95 | : CHAR_TABLE_REF (gl_state.current_syntax_table, c)); | 96 | : CHAR_TABLE_REF (gl_state.current_syntax_table, c)); |
| 96 | #else | ||
| 97 | return CHAR_TABLE_REF (BVAR (current_buffer, syntax_table), c); | 97 | return CHAR_TABLE_REF (BVAR (current_buffer, syntax_table), c); |
| 98 | #endif | 98 | } |
| 99 | INLINE Lisp_Object | ||
| 100 | SYNTAX_ENTRY (int c) | ||
| 101 | { | ||
| 102 | return syntax_property_entry (c, 0); | ||
| 99 | } | 103 | } |
| 100 | 104 | ||
| 101 | /* Extract the information from the entry for character C | 105 | /* Extract the information from the entry for character C |
| 102 | in the current syntax table. */ | 106 | in the current syntax table. */ |
| 103 | 107 | ||
| 104 | INLINE int | 108 | INLINE int |
| 105 | SYNTAX_WITH_FLAGS (int c) | 109 | syntax_property_with_flags (int c, bool via_property) |
| 106 | { | 110 | { |
| 107 | Lisp_Object ent = SYNTAX_ENTRY (c); | 111 | Lisp_Object ent = syntax_property_entry (c, via_property); |
| 108 | return CONSP (ent) ? XINT (XCAR (ent)) : Swhitespace; | 112 | return CONSP (ent) ? XINT (XCAR (ent)) : Swhitespace; |
| 109 | } | 113 | } |
| 114 | INLINE int | ||
| 115 | SYNTAX_WITH_FLAGS (int c) | ||
| 116 | { | ||
| 117 | return syntax_property_with_flags (c, 0); | ||
| 118 | } | ||
| 110 | 119 | ||
| 111 | INLINE enum syntaxcode | 120 | INLINE enum syntaxcode |
| 121 | syntax_property (int c, bool via_property) | ||
| 122 | { | ||
| 123 | return syntax_property_with_flags (c, via_property) & 0xff; | ||
| 124 | } | ||
| 125 | INLINE enum syntaxcode | ||
| 112 | SYNTAX (int c) | 126 | SYNTAX (int c) |
| 113 | { | 127 | { |
| 114 | return SYNTAX_WITH_FLAGS (c) & 0xff; | 128 | return syntax_property (c, 0); |
| 115 | } | 129 | } |
| 116 | 130 | ||
| 117 | 131 | ||