Re: [GSoC][PATCH 1/2] userdiff: add built-in patterns for CSS
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Mar 8, 2015, 23:08 UTC
- Message-ID
- <CAPig+cTEbX+cD39-_5EC8o7uciBw7uL58C31ePMXCJ3SLzYJtg@mail.gmail.com>
- In-Reply-To
- <1425812624-6671-1-git-send-email-sh19910711@gmail.com>
On Sun, Mar 8, 2015 at 7:03 AM, Hiroyuki Sano <sh19910711@gmail.com> wrote:
Show 14 quoted lines
> Add regex patterns for CSS. The word regex maches selectors, properties,
> and values. On the other hand, the funcname regex matches lines contains
> the curly brace character.
>
> Signed-off-by: Hiroyuki Sano <sh19910711@gmail.com>
> ---
> diff --git a/t/t4034/css/post b/t/t4034/css/post
> new file mode 100644
> index 0000000..7e64463
> --- /dev/null
> +++ b/t/t4034/css/post
> @@ -0,0 +1,32 @@
> [...]
> +.class, elm:hover, elm:first-child, elm:lang(en), #id, elm#id, .num123{Mental note: colon and parentheses are present
Show 11 quoted lines
> diff --git a/userdiff.c b/userdiff.c
> index 2ccbee5..8374a2a 100644
> --- a/userdiff.c
> +++ b/userdiff.c
> @@ -37,6 +37,9 @@ IPATTERN("fortran",
> "|//|\\*\\*|::|[/<>=]="),
> PATTERNS("html", "^[ \t]*(<[Hh][1-6][ \t].*>.*)$",
> "[^<>= \t]+"),
> +PATTERNS("css",
> + "^.*[{].*$",
> + "[-_\\.,#a-zA-Z0-9]+"),Is the intention that this should match "elm:lang(en)" as an atom, or separately match "elm", "lang", and "en"?
> PATTERNS("java",
> "!^[ \t]*(catch|do|for|if|instanceof|new|return|switch|throw|while)\n"
> "^[ \t]*(([A-Za-z_][A-Za-z_0-9]*[ \t]+)+[A-Za-z_][A-Za-z_0-9]*[ \t]*\\([^;]*)$",
> --