git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v1] adding word_regex for go language

From
SMsourav mondal <souravcristiano502@gmail.com>
Date
Mar 20, 2017, 19:35 UTC
Message-ID
<20170320193555.6656-1-souravcristiano502@gmail.com>
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
Next: Junio C Hamano
Message 1 of 2 in “adding word_regex for go language”
  1. adding word_regex for go languagesourav mondal, Mar 20, 2017
  2. Junio C HamanoMar 20, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.