From 8a52f39d0e26f88c462489152480ccce6aaa6b66 Mon Sep 17 00:00:00 2001 From: Ivan Korolev Date: Sun, 5 Feb 2017 23:35:53 +0300 Subject: [PATCH 1/2] fix explicit argument indexes syntax Fixed explicit argument indexes according to current spec https://golang.org/pkg/fmt/ Format is now highlighted when using indexes [n] for different cases. --- syntax/GoSublime-Go.tmLanguage | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/syntax/GoSublime-Go.tmLanguage b/syntax/GoSublime-Go.tmLanguage index 8ccf2def..e3bae1da 100755 --- a/syntax/GoSublime-Go.tmLanguage +++ b/syntax/GoSublime-Go.tmLanguage @@ -303,11 +303,12 @@ match (?x)% - (\d+\$)? # field (argument #) [#0\- +']* # flags + (\[\d+\])? # field (argument #) [,;:_]? # separator character (AltiVec) - ((-?\d+)|\*(-?\d+\$)?)? # minimum field width - (\.((-?\d+)|\*(-?\d+\$)?)?)? # precision + ((-?\d+)|(\[\d+\])?\*)? # minimum field width + (\.((-?\d+)|(\[\d+\])?\*)?)? # precision + (\[\d+\])? # field (argument #), second optional placement [diouxXDOUeEfFgGaAcCsSqpnvtTbyYhHmMzZ%] # conversion type name From efe1ad4eb6841f33c5dc45a14199b923d9c5d071 Mon Sep 17 00:00:00 2001 From: Ivan Korolev Date: Mon, 6 Feb 2017 01:27:43 +0300 Subject: [PATCH 2/2] fix explicit argument indexes syntax Width and precision always come first. --- syntax/GoSublime-Go.tmLanguage | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/syntax/GoSublime-Go.tmLanguage b/syntax/GoSublime-Go.tmLanguage index e3bae1da..fb66f16c 100755 --- a/syntax/GoSublime-Go.tmLanguage +++ b/syntax/GoSublime-Go.tmLanguage @@ -304,11 +304,10 @@ match (?x)% [#0\- +']* # flags - (\[\d+\])? # field (argument #) [,;:_]? # separator character (AltiVec) ((-?\d+)|(\[\d+\])?\*)? # minimum field width (\.((-?\d+)|(\[\d+\])?\*)?)? # precision - (\[\d+\])? # field (argument #), second optional placement + (\[\d+\])? # field (argument #) [diouxXDOUeEfFgGaAcCsSqpnvtTbyYhHmMzZ%] # conversion type name