Re: [PATCH 2/2] userdiff: support Java try keyword
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 2, 2014, 19:25 UTC
- Message-ID
- <xmqqr4373yhr.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <1401682405-3319-2-git-send-email-ch3cooli@gmail.com>
Sup Yut Sum <ch3cooli@gmail.com> writes:
> try keyword is enhanced in Java 7, see try-with-resources Statement
> try (XX yy = new XX()) {
> } catch (Exception e){
> }Sorry, but I do not see the connection between the proposed log message and what the patch does.
The patch seems to tell me this:
We did not know 'try' was a keyword to begin a block for java,
whether that 'try' is a traditional 'try' or 'try' in
'try-with-resources'. With this patch we start recognising
'try' as a keyword.and nothing else, but the log message makes it sound as if the more prevalent use of try-with-resources in Java 7 makes it for some reason more important to recognise it as a keyword than it used to be---or is that what you meant to say?
Puzzled...
Show 18 quoted lines
> Signed-off-by: Sup Yut Sum <ch3cooli@gmail.com>
> ---
> userdiff.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/userdiff.c b/userdiff.c
> index 96eda6c..49e898b 100644
> --- a/userdiff.c
> +++ b/userdiff.c
> @@ -39,7 +39,7 @@ IPATTERN("fortran",
> PATTERNS("html", "^[ \t]*(<[Hh][1-6][ \t].*>.*)$",
> "[^<>= \t]+"),
> PATTERNS("java",
> - "!^[ \t]*(catch|do|for|if|instanceof|new|return|switch|throw|while)\n"
> + "!^[ \t]*(try|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]*\\([^;]*)$",
> /* -- */
> "[a-zA-Z_][a-zA-Z0-9_]*"