csspool 0.2.5 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.txt +4 -0
- data/Rakefile +1 -1
- data/lib/css/sac/generated_parser.rb +2 -2
- data/lib/css/sac/parser.rb +1 -1
- data/lib/css/sac/tokenizer.rb +3 -2
- data/test/test_tokenizer.rb +7 -0
- metadata +3 -3
data/CHANGELOG.txt
CHANGED
data/Rakefile
CHANGED
@@ -7,7 +7,7 @@ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), "lib")
|
|
7
7
|
GENERATED_PARSER = "lib/css/sac/generated_parser.rb"
|
8
8
|
GENERATED_PROPERTY_PARSER = "lib/css/sac/generated_property_parser.rb"
|
9
9
|
|
10
|
-
Hoe.new('csspool', "0.2.
|
10
|
+
Hoe.new('csspool', "0.2.6") do |p|
|
11
11
|
p.rubyforge_name = 'csspool'
|
12
12
|
p.author = 'Aaron Patterson'
|
13
13
|
p.email = 'aaronp@rubyforge.org'
|
@@ -17,10 +17,10 @@ module CSS
|
|
17
17
|
|
18
18
|
class GeneratedParser < Racc::Parser
|
19
19
|
|
20
|
-
module_eval <<'..end lib/parser.y modeval..
|
20
|
+
module_eval <<'..end lib/parser.y modeval..id1128ccb808', 'lib/parser.y', 307
|
21
21
|
include CSS::SAC::Conditions
|
22
22
|
include CSS::SAC::Selectors
|
23
|
-
..end lib/parser.y modeval..
|
23
|
+
..end lib/parser.y modeval..id1128ccb808
|
24
24
|
|
25
25
|
##### racc 1.4.5 generates ###
|
26
26
|
|
data/lib/css/sac/parser.rb
CHANGED
data/lib/css/sac/tokenizer.rb
CHANGED
@@ -119,8 +119,9 @@ module CSS
|
|
119
119
|
tokens = []
|
120
120
|
pos = 0
|
121
121
|
|
122
|
-
|
123
|
-
|
122
|
+
comment_pattern = /\/\*.*?\*\//m
|
123
|
+
comments = input_data.scan(comment_pattern)
|
124
|
+
non_comments = input_data.split(comment_pattern)
|
124
125
|
|
125
126
|
# Handle a small edge case, if our CSS is *only* comments,
|
126
127
|
# the split, zip, scan trick won't work
|
data/test/test_tokenizer.rb
CHANGED
@@ -117,4 +117,11 @@ class TokenizerTest < Test::Unit::TestCase
|
|
117
117
|
count += 1
|
118
118
|
end
|
119
119
|
end
|
120
|
+
|
121
|
+
def test_comments_pattern_is_lazy
|
122
|
+
text = "/* * HAI * */ a {display:block} /* * BAI * */ em {font-style:normal}"
|
123
|
+
assert_tokens text,
|
124
|
+
:COMMENT, :IDENT, :LBRACE, :IDENT, :delim, [:IDENT, "block"], :delim,
|
125
|
+
:COMMENT, :IDENT, :LBRACE, :IDENT, :delim, [:IDENT, "normal"], :delim
|
126
|
+
end
|
120
127
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: csspool
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Patterson
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-04-
|
12
|
+
date: 2008-04-10 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -133,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
133
133
|
requirements: []
|
134
134
|
|
135
135
|
rubyforge_project: csspool
|
136
|
-
rubygems_version: 1.1
|
136
|
+
rubygems_version: 1.0.1
|
137
137
|
signing_key:
|
138
138
|
specification_version: 2
|
139
139
|
summary: Parses CSS
|