GNOME Bugzilla – Bug 680450
Stale Gedit syntax file for golang
Last modified: 2012-07-27 17:01:05 UTC
Created attachment 219497 [details] Correct GtkSourceView syntax file for golang. This is a cross-posted report from https://bugs.launchpad.net/ubuntu/+source/gtksourceview3/+bug/1027618 by their request. The Golang syntax file that comes with Gedit 3.4.1 is meant for a pre-release version of Go. Go has reached version 1.0 in the meantime. This brought some language changes along with it. These changes are reflected in the latest syntax file, but this one is not included in the standard Gedit package. The correct version of this file has been attached to this report. $ uname -a Linux ubuntu 3.2.0-26-generic-pae #41-Ubuntu SMP Thu Jun 14 16:45:14 UTC 2012 i686 i686 i386 GNU/Linux $ gedit --version gedit - Version 3.4.1 $ ls -l /usr/share/gtksourceview-3.0/language-specs | grep go.lang -rw-r--r-- 1 root root 7261 May 16 23:06 go.lang
The lang file should be have done on top of the current file in the repository. Feel free to update it.
For the record the go language was already update by garret, see: http://git.gnome.org/browse/gtksourceview/commit/?id=2eeb9c01ce04dd02305012faf3e46abb7d01083c please double check that nothing is missing there.
Created attachment 219634 [details] [review] 0001-Fixes-Golang-s-language-specs-file.patch
The patch I just submitted fixes a mistake in the patch listed by Ignacio. It removes the keyword for the 'float' type which no longer exists in Go.
Created attachment 219637 [details] [review] Remove the 'float' keyword and the 'error' keyword. This patch removes the 'float' keyword and adds the 'error' keyword. The latter was missing from the patch Ignacio linked. This patch overrides my previous attachments.
Created attachment 219655 [details] [review] Removes 'float' keyword, adds 'error' keyword and fixes the regex for decimal numbers. Once more, a new bug fix. Let's hope three times is the charm. Removes 'float' keyword, adds 'error' keyword and fixes the regex for decimal numbers. - The float keyword is removed because the float type no longer exists in Go. - The error keyword is for a builtin type which was added a while ago. - The regex pattern used to match decimal numbers is incorrect. `[1-9][0-9]*` does not match a stadalone '0'. There is no other numeric recognition pattern which catches this either. The fix I employed also matches octal numbers, but it will have to do.
Created attachment 219701 [details] [review] Fix matching 0 as a decimal in C and Go
Created attachment 219702 [details] [review] Remove complex and float from Go
Created attachment 219703 [details] [review] Add additional types to Go
Created attachment 219704 [details] [review] Add link to Go language spec for which it is based off of