Little hint: gtksourceview knows what tokens the language uses for line and block comments, if the .lang file specifies this, ofc.
See: <metadata> on https://developer.gnome.org/gtksourceview/unstable/lang-reference.html and http://valadoc.org/#!api=gtksourceview-3.0/Gtk.SourceLanguage.get_metadata
Haven't tried this, but it should work somewhat like this:
var line_comment_start = source_language.get_metadata ("line-comment-start"); // block-comment-start, block-comment-end
for C this would return "//", "/*", "*/" respectively.
Little hint: gtksourceview knows what tokens the language uses for line and block comments, if the .lang file specifies this, ofc.
See: <metadata> on https:/ /developer. gnome.org/ gtksourceview/ unstable/ lang-reference. html valadoc. org/#!api= gtksourceview- 3.0/Gtk. SourceLanguage. get_metadata
and http://
Haven't tried this, but it should work somewhat like this:
var line_comment_start = source_ language. get_metadata ("line- comment- start") ; // block-comment- start, block-comment-end
for C this would return "//", "/*", "*/" respectively.