userdiff: add Octave
[gitweb.git] / userdiff.c
index 3a78fbf5044fbc5d5624ce94e54eb4ab325e2cf1..bcae006abe70641fa732590eef0638c10de2b237 100644 (file)
@@ -58,7 +58,10 @@ PATTERNS("java",
         "|[-+*/<>%&^|=!]="
         "|--|\\+\\+|<<=?|>>>?=?|&&|\\|\\|"),
 PATTERNS("matlab",
-        "^[[:space:]]*((classdef|function)[[:space:]].*)$|^%%[[:space:]].*$",
+        /* Octave pattern is mostly the same as matlab, except that '%%%' and
+         * '##' can also be used to begin code sections, in addition to '%%'
+         * that is understood by both. */
+        "^[[:space:]]*((classdef|function)[[:space:]].*)$|^(%%%?|##)[[:space:]].*$",
         "[a-zA-Z_][a-zA-Z0-9_]*|[-+0-9.e]+|[=~<>]=|\\.[*/\\^']|\\|\\||&&"),
 PATTERNS("objc",
         /* Negate C statements that can look like functions */