nokogiri 1.4.4 → 1.4.5
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of nokogiri might be problematic. Click here for more details.
- data/.gemtest +0 -0
- data/CHANGELOG.ja.rdoc +16 -0
- data/CHANGELOG.rdoc +23 -1
- data/Manifest.txt +4 -3
- data/Rakefile +41 -37
- data/ext/nokogiri/xml_document.c +9 -0
- data/ext/nokogiri/xml_io.c +32 -7
- data/ext/nokogiri/xml_node.c +14 -13
- data/ext/nokogiri/xml_sax_parser.c +4 -2
- data/ext/nokogiri/xslt_stylesheet.c +9 -3
- data/lib/nokogiri/css.rb +6 -3
- data/lib/nokogiri/css/parser.rb +665 -70
- data/lib/nokogiri/css/parser.y +3 -1
- data/lib/nokogiri/css/parser_extras.rb +91 -0
- data/lib/nokogiri/css/tokenizer.rb +148 -3
- data/lib/nokogiri/css/tokenizer.rex +1 -1
- data/lib/nokogiri/ffi/structs/xml_attr.rb +2 -1
- data/lib/nokogiri/ffi/structs/xml_node_set.rb +1 -1
- data/lib/nokogiri/ffi/weak_bucket.rb +10 -10
- data/lib/nokogiri/ffi/xml/document.rb +8 -0
- data/lib/nokogiri/ffi/xml/node_set.rb +1 -0
- data/lib/nokogiri/ffi/xml/sax/parser.rb +9 -1
- data/lib/nokogiri/ffi/xslt/stylesheet.rb +4 -0
- data/lib/nokogiri/html/document.rb +134 -15
- data/lib/nokogiri/html/sax/parser.rb +6 -2
- data/lib/nokogiri/version.rb +6 -1
- data/lib/nokogiri/xml/node.rb +8 -23
- data/lib/nokogiri/xml/node/save_options.rb +10 -0
- data/lib/nokogiri/xml/node_set.rb +1 -1
- data/lib/nokogiri/xml/parse_options.rb +8 -0
- data/lib/nokogiri/xml/reader.rb +6 -6
- data/lib/nokogiri/xml/sax/document.rb +2 -2
- data/lib/nokogiri/xml/schema.rb +7 -1
- data/tasks/cross_compile.rb +8 -15
- data/test/css/test_tokenizer.rb +8 -0
- data/test/files/encoding.html +82 -0
- data/test/files/encoding.xhtml +84 -0
- data/test/helper.rb +2 -0
- data/test/html/sax/test_parser.rb +45 -0
- data/test/html/test_document.rb +55 -0
- data/test/html/test_document_encoding.rb +46 -0
- data/test/html/test_element_description.rb +1 -1
- data/test/test_memory_leak.rb +20 -0
- data/test/test_reader.rb +13 -0
- data/test/test_xslt_transforms.rb +6 -2
- data/test/xml/sax/test_parser.rb +16 -0
- data/test/xml/test_document.rb +3 -1
- data/test/xml/test_node.rb +13 -1
- data/test/xml/test_node_set.rb +10 -0
- data/test/xml/test_schema.rb +5 -0
- metadata +94 -109
- data/deps.rip +0 -5
- data/lib/nokogiri/css/generated_parser.rb +0 -676
- data/lib/nokogiri/css/generated_tokenizer.rb +0 -145
@@ -1,145 +0,0 @@
|
|
1
|
-
#--
|
2
|
-
# DO NOT MODIFY!!!!
|
3
|
-
# This file is automatically generated by rex 1.0.4
|
4
|
-
# from lexical definition file "lib/nokogiri/css/tokenizer.rex".
|
5
|
-
#++
|
6
|
-
|
7
|
-
module Nokogiri
|
8
|
-
module CSS
|
9
|
-
class GeneratedTokenizer < GeneratedParser
|
10
|
-
require 'strscan'
|
11
|
-
|
12
|
-
class ScanError < StandardError ; end
|
13
|
-
|
14
|
-
attr_reader :lineno
|
15
|
-
attr_reader :filename
|
16
|
-
attr_accessor :state
|
17
|
-
|
18
|
-
def scan_setup(str)
|
19
|
-
@ss = StringScanner.new(str)
|
20
|
-
@lineno = 1
|
21
|
-
@state = nil
|
22
|
-
end
|
23
|
-
|
24
|
-
def action(&block)
|
25
|
-
yield
|
26
|
-
end
|
27
|
-
|
28
|
-
def scan_str(str)
|
29
|
-
scan_setup(str)
|
30
|
-
do_parse
|
31
|
-
end
|
32
|
-
|
33
|
-
def load_file( filename )
|
34
|
-
@filename = filename
|
35
|
-
open(filename, "r") do |f|
|
36
|
-
scan_setup(f.read)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
def scan_file( filename )
|
41
|
-
load_file(filename)
|
42
|
-
do_parse
|
43
|
-
end
|
44
|
-
|
45
|
-
|
46
|
-
def next_token
|
47
|
-
return if @ss.eos?
|
48
|
-
|
49
|
-
text = @ss.peek(1)
|
50
|
-
@lineno += 1 if text == "\n"
|
51
|
-
token = case @state
|
52
|
-
when nil
|
53
|
-
case
|
54
|
-
when (text = @ss.scan(/has\([\s]*/))
|
55
|
-
action { [:HAS, text] }
|
56
|
-
|
57
|
-
when (text = @ss.scan(/[-@]?([_A-Za-z]|[^\0-\177]|\\[0-9A-Fa-f]{1,6}(\r\n|[\s])?|\\[^\n\r\f0-9A-Fa-f])([_A-Za-z0-9-]|[^\0-\177]|\\[0-9A-Fa-f]{1,6}(\r\n|[\s])?|\\[^\n\r\f0-9A-Fa-f])*\([\s]*/))
|
58
|
-
action { [:FUNCTION, text] }
|
59
|
-
|
60
|
-
when (text = @ss.scan(/[-@]?([_A-Za-z]|[^\0-\177]|\\[0-9A-Fa-f]{1,6}(\r\n|[\s])?|\\[^\n\r\f0-9A-Fa-f])([_A-Za-z0-9-]|[^\0-\177]|\\[0-9A-Fa-f]{1,6}(\r\n|[\s])?|\\[^\n\r\f0-9A-Fa-f])*/))
|
61
|
-
action { [:IDENT, text] }
|
62
|
-
|
63
|
-
when (text = @ss.scan(/\#([_A-Za-z0-9-]|[^\0-\177]|\\[0-9A-Fa-f]{1,6}(\r\n|[\s])?|\\[^\n\r\f0-9A-Fa-f])+/))
|
64
|
-
action { [:HASH, text] }
|
65
|
-
|
66
|
-
when (text = @ss.scan(/[\s]*~=[\s]*/))
|
67
|
-
action { [:INCLUDES, text] }
|
68
|
-
|
69
|
-
when (text = @ss.scan(/[\s]*\|=[\s]*/))
|
70
|
-
action { [:DASHMATCH, text] }
|
71
|
-
|
72
|
-
when (text = @ss.scan(/[\s]*\^=[\s]*/))
|
73
|
-
action { [:PREFIXMATCH, text] }
|
74
|
-
|
75
|
-
when (text = @ss.scan(/[\s]*\$=[\s]*/))
|
76
|
-
action { [:SUFFIXMATCH, text] }
|
77
|
-
|
78
|
-
when (text = @ss.scan(/[\s]*\*=[\s]*/))
|
79
|
-
action { [:SUBSTRINGMATCH, text] }
|
80
|
-
|
81
|
-
when (text = @ss.scan(/[\s]*!=[\s]*/))
|
82
|
-
action { [:NOT_EQUAL, text] }
|
83
|
-
|
84
|
-
when (text = @ss.scan(/[\s]*=[\s]*/))
|
85
|
-
action { [:EQUAL, text] }
|
86
|
-
|
87
|
-
when (text = @ss.scan(/[\s]*\)/))
|
88
|
-
action { [:RPAREN, text] }
|
89
|
-
|
90
|
-
when (text = @ss.scan(/[\s]*\[[\s]*/))
|
91
|
-
action { [:LSQUARE, text] }
|
92
|
-
|
93
|
-
when (text = @ss.scan(/[\s]*\]/))
|
94
|
-
action { [:RSQUARE, text] }
|
95
|
-
|
96
|
-
when (text = @ss.scan(/[\s]*\+[\s]*/))
|
97
|
-
action { [:PLUS, text] }
|
98
|
-
|
99
|
-
when (text = @ss.scan(/[\s]*>[\s]*/))
|
100
|
-
action { [:GREATER, text] }
|
101
|
-
|
102
|
-
when (text = @ss.scan(/[\s]*,[\s]*/))
|
103
|
-
action { [:COMMA, text] }
|
104
|
-
|
105
|
-
when (text = @ss.scan(/[\s]*~[\s]*/))
|
106
|
-
action { [:TILDE, text] }
|
107
|
-
|
108
|
-
when (text = @ss.scan(/\:not\([\s]*/))
|
109
|
-
action { [:NOT, text] }
|
110
|
-
|
111
|
-
when (text = @ss.scan(/-?([0-9]+|[0-9]*\.[0-9]+)/))
|
112
|
-
action { [:NUMBER, text] }
|
113
|
-
|
114
|
-
when (text = @ss.scan(/[\s]*\/\/[\s]*/))
|
115
|
-
action { [:DOUBLESLASH, text] }
|
116
|
-
|
117
|
-
when (text = @ss.scan(/[\s]*\/[\s]*/))
|
118
|
-
action { [:SLASH, text] }
|
119
|
-
|
120
|
-
when (text = @ss.scan(/U\+[0-9a-f?]{1,6}(-[0-9a-f]{1,6})?/))
|
121
|
-
action {[:UNICODE_RANGE, text] }
|
122
|
-
|
123
|
-
when (text = @ss.scan(/[\s]+/))
|
124
|
-
action { [:S, text] }
|
125
|
-
|
126
|
-
when (text = @ss.scan(/"([^\n\r\f"]|\n|\r\n|\r|\f|[^\0-\177]|\\[0-9A-Fa-f]{1,6}(\r\n|[\s])?|\\[^\n\r\f0-9A-Fa-f])*"|'([^\n\r\f']|\n|\r\n|\r|\f|[^\0-\177]|\\[0-9A-Fa-f]{1,6}(\r\n|[\s])?|\\[^\n\r\f0-9A-Fa-f])*'/))
|
127
|
-
action { [:STRING, text] }
|
128
|
-
|
129
|
-
when (text = @ss.scan(/./))
|
130
|
-
action { [text, text] }
|
131
|
-
|
132
|
-
else
|
133
|
-
text = @ss.string[@ss.pos .. -1]
|
134
|
-
raise ScanError, "can not match: '" + text + "'"
|
135
|
-
end # if
|
136
|
-
|
137
|
-
else
|
138
|
-
raise ScanError, "undefined state: '" + state.to_s + "'"
|
139
|
-
end # case state
|
140
|
-
token
|
141
|
-
end # def next_token
|
142
|
-
|
143
|
-
end # class
|
144
|
-
end
|
145
|
-
end
|