You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@skywalking.apache.org by ke...@apache.org on 2021/07/08 09:18:59 UTC

[skywalking-eyes] branch main updated: Add support for MatLab files (#37)

This is an automated email from the ASF dual-hosted git repository.

kezhenxu94 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-eyes.git


The following commit(s) were added to refs/heads/main by this push:
     new 9b209ed  Add support for MatLab files (#37)
9b209ed is described below

commit 9b209eda1b732ad0be675ec82a01eef1c9399097
Author: kezhenxu94 <ke...@apache.org>
AuthorDate: Thu Jul 8 17:18:52 2021 +0800

    Add support for MatLab files (#37)
---
 assets/languages.yaml | 1 +
 assets/styles.yaml    | 5 +++++
 pkg/license/norm.go   | 1 +
 3 files changed, 7 insertions(+)

diff --git a/assets/languages.yaml b/assets/languages.yaml
index 89e84d0..315d9b3 100644
--- a/assets/languages.yaml
+++ b/assets/languages.yaml
@@ -3120,6 +3120,7 @@ MATLAB:
   codemirror_mode: octave
   codemirror_mime_type: text/x-octave
   language_id: 225
+  comment_style_id: Percent
 MAXScript:
   type: programming
   color: "#00a6a6"
diff --git a/assets/styles.yaml b/assets/styles.yaml
index 2115dfa..3e6c28a 100644
--- a/assets/styles.yaml
+++ b/assets/styles.yaml
@@ -74,3 +74,8 @@
   start: 'rem'
   middle: 'rem'
   end: 'rem'
+
+- id: Percent
+  start: '%'
+  middle: '%'
+  end: '%'
diff --git a/pkg/license/norm.go b/pkg/license/norm.go
index 1b1bd74..cf69b96 100644
--- a/pkg/license/norm.go
+++ b/pkg/license/norm.go
@@ -66,6 +66,7 @@ var (
 		regexp.MustCompile(`(?m)^\s*::`),     // ::
 		regexp.MustCompile(`(?m)^\s*\.\.`),   // ..
 		regexp.MustCompile(`(?mi)^\s*@?REM`), // @REM
+		regexp.MustCompile(`(?mi)^\s*%+`),    // % e.g. matlab
 	}
 
 	flattenSpace = regexp.MustCompile(`\s+`)