The problematic single-line comment #90
Closed
nsgnkhibdk2cls0f
started this conversation in
General
Replies: 1 comment 20 replies
-
Thanks, I will look into this. Will you file this as an issue of type enhancement? |
Beta Was this translation helpful? Give feedback.
20 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to create Objeck syntax highlighting rules for KDE's Kate editor. I'm stuck with the comments currently. If I make multi-line comments work, then single-line comments break. If I make single-line comments work, then multi-line comments break. It's all because Objeck's design of comments. Objeck is not special in using a single
#
char for single-line comments, Ruby does too. But Ruby has a very different multi-line comment syntax that very rarely used when Objeck take inspiration from C language family's/*
and*/
to be#~
and~#
. That caused problems as the text editor doesn't know when it's multi-line comment and when it's single-line comment. If it's only single-line comment that uses#
char then it's easy. C language family's single-line comment started with two/
char (//
) so it's easy to tell when it's single-line comment when it's multi-line comment. But this design is part of the language from the beginning so it's not easy to change it. It could be Ruby encountered this problem too so they decided to use a very weird syntax for multi-line comment, so weird that it's very rarely used:=begin
and=end
.p/s: I used the CSharp syntax file as the foundation to build my Objeck syntax file:
https://github.com/KDE/syntax-highlighting/blob/master/data/syntax/cs.xml
Beta Was this translation helpful? Give feedback.
All reactions