The extension 'v' is already assigned to Verilog in SciTE which makes it difficult to include V seamlessly. The V mode will have to be disabled by default and enabled by editing a properties file.
A warning is issued for an unused parameter which can be avoided by not naming the parameter.
I was actually thinking about V support in Scintilla a week ago. I looked at some V code from their repository and it seems that it is heavily influenced by Go.
V and Go are both are both brace-based languages. Wouldn't it be more viable to extend the CPP lexer to meet the requirements of these language rather than write a new one?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
From a maintenance point-of-view it can be simpler for languages to be isolated so changes to one language don't disturb others.
The CPP lexer is overly complicated by the preprocessor and most of the bracey languages don't use a preprocessor or have a very tame one.
If there is strong commonality, it may be worth writing a brace language lexer that omits the CPP preprocessor code. However, brace languages are becoming more divergent. The major areas of divergence are
Comment delimiters
String quoting
String escapes
String interpolation
String interpolation can be quite messy and its becoming increasingly common and complex as expressions are included. Like this Swift code
The stringInterpolationParenthesisLevel and previousStringStyle variables do not appear to reset at line end when the string state is dropped which could lead to problems with unbalanced interpolations. These may be invalid but temporarily invalid code occurs while editing.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This code lexes poorly:
The extension 'v' is already assigned to Verilog in SciTE which makes it difficult to include V seamlessly. The V mode will have to be disabled by default and enabled by editing a properties file.
A warning is issued for an unused parameter which can be avoided by not naming the parameter.
I was actually thinking about V support in Scintilla a week ago. I looked at some V code from their repository and it seems that it is heavily influenced by Go.
V and Go are both are both brace-based languages. Wouldn't it be more viable to extend the CPP lexer to meet the requirements of these language rather than write a new one?
From a maintenance point-of-view it can be simpler for languages to be isolated so changes to one language don't disturb others.
The CPP lexer is overly complicated by the preprocessor and most of the bracey languages don't use a preprocessor or have a very tame one.
If there is strong commonality, it may be worth writing a brace language lexer that omits the CPP preprocessor code. However, brace languages are becoming more divergent. The major areas of divergence are
String interpolation can be quite messy and its becoming increasingly common and complex as expressions are included. Like this Swift code
Thanks,
I believe I made the Lexer more robust about literals/strings/raw strings handling and fixed the warning.
Kind regards,
From Visual C++:
The stringInterpolationParenthesisLevel and previousStringStyle variables do not appear to reset at line end when the string state is dropped which could lead to problems with unbalanced interpolations. These may be invalid but temporarily invalid code occurs while editing.