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

Re: [PATCH v2] userdiff: update Ada patterns

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 3, 2014, 20:00 UTC
Message-ID
<xmqqppn4dl0k.fsf@gitster.dls.corp.google.com>
In-Reply-To
<52EF7E7C.3070504@redneon.com>
Adrian Johnson <ajohnson@redneon.com> writes:
Show 39 quoted lines
> - Allow extra space in "is new" and "is separate"
> - Fix bug in word regex for numbers
>
> Signed-off-by: Adrian Johnson <ajohnson@redneon.com>
> ---
>  t/t4034/ada/expect | 2 +-
>  userdiff.c         | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/t/t4034/ada/expect b/t/t4034/ada/expect
> index be2376e..a682d28 100644
> --- a/t/t4034/ada/expect
> +++ b/t/t4034/ada/expect
> @@ -4,7 +4,7 @@
>  <BOLD>+++ b/post<RESET>
>  <CYAN>@@ -1,13 +1,13 @@<RESET>
>  Ada.Text_IO.Put_Line("Hello World<RED>!<RESET><GREEN>?<RESET>");
> -1 1e<RED>-<RESET>10 16#FE12#E2 3.141_592 '<RED>x<RESET><GREEN>y<RESET>'
> +1 <RED>1e-10<RESET><GREEN>1e10<RESET> 16#FE12#E2 3.141_592 '<RED>x<RESET><GREEN>y<RESET>'
>  <RED>a<RESET><GREEN>x<RESET>+<RED>b a<RESET><GREEN>y x<RESET>-<RED>b<RESET>
>  <RED>a<RESET><GREEN>y<RESET>
>  <GREEN>x<RESET>*<RED>b a<RESET><GREEN>y x<RESET>/<RED>b<RESET>
> diff --git a/userdiff.c b/userdiff.c
> index ea43a03..10b61ec 100644
> --- a/userdiff.c
> +++ b/userdiff.c
> @@ -15,13 +15,13 @@ static int drivers_alloc;
>  	  word_regex "|[^[:space:]]|[\xc0-\xff][\x80-\xbf]+" }
>  static struct userdiff_driver builtin_drivers[] = {
>  IPATTERN("ada",
> -	 "!^(.*[ \t])?(is new|renames|is separate)([ \t].*)?$\n"
> +	 "!^(.*[ \t])?(is[ \t]+new|renames|is[ \t]+separate)([ \t].*)?$\n"
>  	 "!^[ \t]*with[ \t].*$\n"
>  	 "^[ \t]*((procedure|function)[ \t]+.*)$\n"
>  	 "^[ \t]*((package|protected|task)[ \t]+.*)$",
>  	 /* -- */
>  	 "[a-zA-Z][a-zA-Z0-9_]*"
> -	 "|[0-9][-+0-9#_.eE]"
> +	 "|[-+]?[0-9][0-9#_.aAbBcCdDeEfF]*([eE][+-]?[0-9_]+)?"

This would match a lot wider than what I read you said you wanted to match in your previous message. Does "-04##4_3_2Ee-9" count as a number, for example, or can we just ignore such syntactically incorrect sequence?

>  	 "|=>|\\.\\.|\\*\\*|:=|/=|>=|<=|<<|>>|<>"),
>  IPATTERN("fortran",
>  	 "!^([C*]|[ \t]*!)\n"
Previous: Adrian JohnsonNext: Adrian Johnson
Message 5 of 8 in “userdiff: update Ada patterns”
  1. userdiff: update Ada patternsAdrian Johnson, Feb 2, 2014
  2. Jeff KingFeb 2, 2014
  3. Adrian JohnsonFeb 3, 2014
  4. userdiff: update Ada patternsAdrian Johnson, Feb 3, 2014
  5. Junio C HamanoFeb 3, 2014
  6. Adrian JohnsonFeb 5, 2014
  7. Junio C HamanoFeb 5, 2014
  8. Jeff KingFeb 5, 2014

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.