git@vger.kernel.org mailing list mirror (one of many)
 help / Atom feed
* [PATCH v1] adding word_regex for go language
@ 2017-03-20 19:35 sourav mondal
  2017-03-20 20:39 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: sourav mondal @ 2017-03-20 19:35 UTC (permalink / raw)
  To: git; +Cc: sourav mondal

Go programming language is one of the promissing language now. Adding built-in driver for the same. This patch contains word_regex for go. As the language specification this has alpha-numeric and under-score for identifiers. It covers all types of number system decimal, octal, hexadecimal. Also can specify signed or usigned number by using "u or U", long number by using "l or L" and exponent term by using "e or E". The following lines cover all types of operator ex. arithmatic, logical, bitwise, assignment etc.. 

Signed-off-by: sourav mondal <souravcristiano502@gmail.com>
---

I'm working on go language patterns and will send it soon.
thanks & regards 
sourav

 userdiff.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/userdiff.c b/userdiff.c
index 2f8e078..99f5539 100644
--- a/userdiff.c
+++ b/userdiff.c
@@ -148,6 +148,13 @@ PATTERNS("csharp",
 	 "[a-zA-Z_][a-zA-Z0-9_]*"
 	 "|[-+0-9.e]+[fFlL]?|0[xXbB]?[0-9a-fA-F]+[lL]?"
 	 "|[-+*/<>%&^|=!]=|--|\\+\\+|<<=?|>>=?|&&|\\|\\||::|->"),
+PATTERNS("go",
+	  /* word_regex */
+	 "[a-zA-Z_][a-zA-Z0-9]*"/* identifiers */
+	 "|[0-9eE]+[lL]?[uU]?|0[xX]?[0-9a-fA-F]+[uU]?[lL]?" /* numbers */
+	 "|[-+*/%<>&|!^=]="/* operators */
+	 "|--|\\+\\+|&&|<<=|>>=|\\|\\|"
+),
 IPATTERN("css",
 	 "![:;][[:space:]]*$\n"
 	 "^[_a-z0-9].*$",
-- 
2.9.3


^ permalink raw reply	[flat|threaded] 2+ messages in thread

* Re: [PATCH v1] adding word_regex for go language
  2017-03-20 19:35 [PATCH v1] adding word_regex for go language sourav mondal
@ 2017-03-20 20:39 ` Junio C Hamano
  0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2017-03-20 20:39 UTC (permalink / raw)
  To: sourav mondal; +Cc: git

sourav mondal <souravcristiano502@gmail.com> writes:

> Subject: Re: [PATCH v1] adding word_regex for go language

Perhaps clarify the title with what area this change affects, e.g.

	Subject: userdiff.c: patterns for "go" language

cf. Documentation/SubmittingPatches.

> Go programming language is one of the promissing language now. Adding built-in driver for the same. This patch contains word_regex for go. As the language specification this has alpha-numeric and under-score for identifiers. It covers all types of number system decimal, octal, hexadecimal. Also can specify signed or usigned number by using "u or U", long number by using "l or L" and exponent term by using "e or E". The following lines cover all types of operator ex. arithmatic, logical, bitwise, assignment etc.. 

Wrap long lines.  Also unless there is a good reason not to, we tend
to write our log messsage in imperative mood, as if you are giving
orders to the codebase to "be like so", or giving orders to a patch
monkey to "make the code like so".

>
> Signed-off-by: sourav mondal <souravcristiano502@gmail.com>
> ---
>
> I'm working on go language patterns and will send it soon.
> thanks & regards 
> sourav
>
>  userdiff.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/userdiff.c b/userdiff.c
> index 2f8e078..99f5539 100644
> --- a/userdiff.c
> +++ b/userdiff.c
> @@ -148,6 +148,13 @@ PATTERNS("csharp",
>  	 "[a-zA-Z_][a-zA-Z0-9_]*"
>  	 "|[-+0-9.e]+[fFlL]?|0[xXbB]?[0-9a-fA-F]+[lL]?"
>  	 "|[-+*/<>%&^|=!]=|--|\\+\\+|<<=?|>>=?|&&|\\|\\||::|->"),
> +PATTERNS("go",
> +	  /* word_regex */
> +	 "[a-zA-Z_][a-zA-Z0-9]*"/* identifiers */
> +	 "|[0-9eE]+[lL]?[uU]?|0[xX]?[0-9a-fA-F]+[uU]?[lL]?" /* numbers */
> +	 "|[-+*/%<>&|!^=]="/* operators */
> +	 "|--|\\+\\+|&&|<<=|>>=|\\|\\|"
> +),

PATTERNS() takes three arguments, the name of the pattern, pattern
and word_regex.

Please do not send an incomplete patch that does not even compile
without marking as such (i.e. request for help or early comments
from those who are willing to help even on an incomplete work).

Thanks.


^ permalink raw reply	[flat|threaded] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-20 19:35 [PATCH v1] adding word_regex for go language sourav mondal
2017-03-20 20:39 ` Junio C Hamano

git@vger.kernel.org mailing list mirror (one of many)

Archives are clonable:
	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.org/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/
       or Tor2web: https://www.tor2web.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox