summaryrefslogtreecommitdiff
path: root/syntax.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-04-16 15:54:35 -0400
committerLeo Tenenbaum <pommicket@gmail.com>2021-04-16 15:54:35 -0400
commit51ac447d409bb565178ab9d78d4b5200e89f2cf4 (patch)
tree0a45c9ba2215d00dd04afe75803ad103bc4236fb /syntax.c
parent2a3bbb6674fe3b0e4ff996cae750a6e2880315ef (diff)
comment/uncomment selection
Diffstat (limited to 'syntax.c')
-rw-r--r--syntax.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/syntax.c b/syntax.c
index 26ce234..b8efa93 100644
--- a/syntax.c
+++ b/syntax.c
@@ -13,6 +13,30 @@ Language language_from_str(char const *str) {
return LANG_NONE;
}
+// start of single line comment for language l
+char const *language_comment_start(Language l) {
+ switch (l) {
+ case LANG_C: return "/* ";
+ case LANG_RUST:
+ case LANG_CPP: return "// ";
+ case LANG_PYTHON: return "# ";
+ case LANG_NONE:
+ case LANG_COUNT:
+ break;
+ }
+ return "";
+}
+
+// end of single line comment for language l
+char const *language_comment_end(Language l) {
+ switch (l) {
+ case LANG_C:
+ return " */";
+ default:
+ return "";
+ }
+}
+
// NOTE: returns the color setting, not the color
ColorSetting syntax_char_type_to_color(SyntaxCharType t) {
switch (t) {