summaryrefslogtreecommitdiff
path: root/ted.h
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-02-03 14:47:34 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-02-03 14:47:34 -0500
commitad9559da432f1ea84f1f350f0edf42b94fe79d4c (patch)
tree1b0720afcd3c5032aed56c109fcc4cfa65fcce9f /ted.h
parent986040bc48a271b693ac81814b3c4607da6db1a3 (diff)
python syntax highlighting
Diffstat (limited to 'ted.h')
-rw-r--r--ted.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/ted.h b/ted.h
index 6664e78..646da6d 100644
--- a/ted.h
+++ b/ted.h
@@ -14,13 +14,18 @@ enum {
};
enum {
- SYNTAX_STATE_RUST_COMMENT_DEPTH_MASK = 0x7u, // in rust, /* */ comments can nest.
+ SYNTAX_STATE_RUST_COMMENT_DEPTH_MASK = 0xfu, // in rust, /* */ comments can nest.
SYNTAX_STATE_RUST_COMMENT_DEPTH_MUL = 0x1u,
SYNTAX_STATE_RUST_COMMENT_DEPTH_BITS = 4, // number of bits we allocate for the comment depth.
SYNTAX_STATE_RUST_STRING = 0x10u,
SYNTAX_STATE_RUST_STRING_IS_RAW = 0x20u,
};
+enum {
+ SYNTAX_STATE_PYTHON_STRING = 0x01u, // multiline strings (''' and """)
+ SYNTAX_STATE_PYTHON_STRING_DBL_QUOTED = 0x02u, // is this a """ string, as opposed to a ''' string?
+};
+
typedef u8 SyntaxState;
ENUM_U16 {
@@ -28,6 +33,7 @@ ENUM_U16 {
LANG_C,
LANG_CPP,
LANG_RUST,
+ LANG_PYTHON,
LANG_COUNT
} ENUM_U16_END(Language);
@@ -41,6 +47,7 @@ static LanguageName const language_names[] = {
{LANG_C, "C"},
{LANG_CPP, "C++"},
{LANG_RUST, "Rust"},
+ {LANG_PYTHON, "Python"},
};
ENUM_U8 {