Add struct to allow flexible string handling rules
@@ -13,6 +13,14 @@ const (
TComplexity
)
+// Quote is a struct which holds rules and start/end values for string quotes
+type Quote struct {
+ Start string `json:"start"`
+ End string `json:"end"`
+ IgnoreEscape bool `json:"ignoreEscape"` // To enable turning off the \ check for C# @"\" string examples https://github.com/boyter/scc/issues/71
+ DocString bool `json:"docString"` // To enable docstring check for Python where "If the triple quote string starts following a newline with only white-space characters in front and ends followed by only a newline or white-space characters it is a comment" https://github.com/boyter/scc/issues/62
+}
+
// Language is a struct which contains the values for each language stored in languages.json
type Language struct {
LineComment []string `json:"line_comment"`
@@ -20,7 +28,7 @@ type Language struct {
Extensions []string `json:"extensions"`
ExtensionFile bool `json:"extensionFile"`
MultiLine [][]string `json:"multi_line"`
- Quotes [][]string `json:"quotes"`
+ Quotes []Quote `json:"quotes"`
NestedMultiLine bool `json:"nestedmultiline"`
Keywords []string `json:"keywords"`
}
