From f06e6c004bfd5eb65d1853bd3021543af0102076 Mon Sep 17 00:00:00 2001 From: Jacques Distler Date: Fri, 25 Dec 2009 03:17:06 -0600 Subject: [PATCH] Ruby 1.9 Compatibility of Vendored Syntax Library The CSS language support of the syntax colourer was broken under Ruby 1.9 --- vendor/plugins/syntax/lib/syntax/lang/css21.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vendor/plugins/syntax/lib/syntax/lang/css21.rb b/vendor/plugins/syntax/lib/syntax/lang/css21.rb index cda6cb99..354d8322 100644 --- a/vendor/plugins/syntax/lib/syntax/lang/css21.rb +++ b/vendor/plugins/syntax/lib/syntax/lang/css21.rb @@ -1,4 +1,5 @@ require 'syntax' +require 'stringsupport' module Syntax @@ -77,7 +78,7 @@ module Syntax # http://www.w3.org/TR/CSS21/syndata.html macro(:h, /([0-9a-fA-F])/ ) # uppercase A-Z added? - macro(:nonascii, /([\200-\377])/ ) + macro(:nonascii, /([^\000-\177])/ ) macro(:nl, /(\n|\r\n|\r|\f)/ ) macro(:unicode, /(\\#{m(:h)}{1,6}(\r\n|[ \t\r\n\f])?)/ ) macro(:escape, /(#{m(:unicode)}|\\[^\r\n\f0-9a-f])/ ) @@ -208,7 +209,8 @@ module Syntax end # scanning declarations only - when !@selector && scan(@tokens[:RBRACE]): @selector = true + when !@selector && scan(@tokens[:RBRACE]) + @selector = true start_group :normal, matched when !@selector && scan(@tokens[:FUNCTION]) start_group :function, matched