# [Gsoc] adding built-in driver for javascript

2 messages from 2017-03-11 to 2017-03-11. Participants: sourav mondal, Christian Couder.
Thread: https://gitlist.dev/t/45352

## sourav mondal, 2017-03-11 09:23

Subject: [Gsoc] adding built-in driver for javascript
Message-ID: <20170311092338.9809-1-souravcristiano502@gmail.com>
URL: https://gitlist.dev/e/20170311092338.9809-1-souravcristiano502%40gmail.com

```
I'm working on "Add more builtin pattern for userdiff" as my microproject for Gsoc17.As I noticed javascript's builtin driver was not present in userdiff of git/git tree. Hopefully this pattern will cover all cases. I'm really eager to know about my work and wiiling to add more pattern for well known lanaguage.

thanks & regards,
sourav   

Signed-off-by: sourav mondal <souravcristiano502@gmail.com>
---
 userdiff.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/userdiff.c b/userdiff.c
index 8b732e4..2f8e078 100644
--- a/userdiff.c
+++ b/userdiff.c
@@ -160,6 +160,16 @@ IPATTERN("css",
 	 "-?[_a-zA-Z][-_a-zA-Z0-9]*" /* identifiers */
 	 "|-?[0-9]+|\\#[0-9a-fA-F]+" /* numbers */
 ),
+PATTERNS("javascript",
+	 /* keywords/patterns*/
+	 "^[ \t]*(var|if|else|for|do|while|switch|case|function|break|continue|new|return|class|super|instanceof)"
+	 "^[ \t]*(([a-zA-Z_][a-zA-Z0-9])*[ \t]*\\.?[a-zA-Z_]*\\(\\)[ \t]*);$",
+	 /* word_regex */
+	 "[a-zA-Z_][a-zA-Z0-9]*"
+	 "|[-+0-9.eE]+|0[bB]?|[xX]?|o?[0-9a-fA-F]+"
+	 "|[==-+*/%<>&|!**=^]="
+	 "|--|\\+\\+|<<=?|>>>?=?|&&|\|\|"
+),
 { "default", NULL, -1, { NULL, 0 } },
 };
 #undef PATTERNS
-- 
2.9.3


```

## Christian Couder, 2017-03-11 11:04

Subject: Re: [Gsoc] adding built-in driver for javascript
Message-ID: <CAP8UFD2ViVY+S6jie6Mu-EgD5rvaF802UD4GhHGjLwWkVdChdg@mail.gmail.com>
URL: https://gitlist.dev/e/CAP8UFD2ViVY%2BS6jie6Mu-EgD5rvaF802UD4GhHGjLwWkVdChdg%40mail.gmail.com
In-Reply-To: <20170311092338.9809-1-souravcristiano502@gmail.com>

```
On Sat, Mar 11, 2017 at 10:23 AM, sourav mondal
<souravcristiano502@gmail.com> wrote:
> I'm working on "Add more builtin pattern for userdiff" as my microproject for Gsoc17.As I noticed javascript's builtin driver was not present in userdiff of git/git tree. Hopefully this pattern will cover all cases. I'm really eager to know about my work and wiiling to add more pattern for well known lanaguage.

If this is a patch that you are submitting, please:

- add "[PATCH]" to the subject of your email, and if it's not the
first time it is sent, add v2, v3 or so after "PATCH"
- move the information related to your GSoC (and the "thanks &
regards" part) just after your "Signed-off-by" and the "---" line
below it, as it should not appear in the commit message after your
patch is applied (you can check that using `git format-patch` and `git
am`)
- write a better description of your patch above after the GSoC
related information has been moved (`git log userdiff.c` can help you
see how others have done it)

Thanks.

> thanks & regards,
> sourav
>
> Signed-off-by: sourav mondal <souravcristiano502@gmail.com>
> ---
>  userdiff.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)

```
