rubypeg 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,4 @@
1
+ # encoding: utf-8
1
2
  require 'rubypeg'
2
3
 
3
4
  class TextPeg < RubyPeg
@@ -89,6 +89,7 @@ class TextPeg2RubyPeg
89
89
 
90
90
  def define_class(name) #:nodoc:
91
91
  self.class_name = name.to_class_name
92
+ line "# encoding: utf-8"
92
93
  line "require 'rubypeg'"
93
94
  line ""
94
95
  line "class #{class_name} < RubyPeg"
@@ -1,3 +1,4 @@
1
+ # encoding: utf-8
1
2
  $:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
2
3
  require 'rubypeg'
3
4
 
@@ -18,5 +19,9 @@ describe AnyCharacter do
18
19
  it "doesn't match no character" do
19
20
  AnyCharacter.parse("").should == nil
20
21
  end
22
+
23
+ it "should work with Chinese characters" do
24
+ AnyCharacter.parse("结果").to_ast.should == [:root,'结']
25
+ end
21
26
 
22
27
  end
@@ -18,6 +18,7 @@ input = <<END
18
18
  one = .
19
19
  END
20
20
  output = <<END
21
+ # encoding: utf-8
21
22
  require 'rubypeg'
22
23
 
23
24
  class One < RubyPeg
@@ -40,6 +41,7 @@ input = <<END
40
41
  one = . . .
41
42
  END
42
43
  output = <<END
44
+ # encoding: utf-8
43
45
  require 'rubypeg'
44
46
 
45
47
  class One < RubyPeg
@@ -62,6 +64,7 @@ input = <<END
62
64
  one = . | . | .
63
65
  END
64
66
  output = <<END
67
+ # encoding: utf-8
65
68
  require 'rubypeg'
66
69
 
67
70
  class One < RubyPeg
@@ -84,6 +87,7 @@ input = <<END
84
87
  one = (. .) | .
85
88
  END
86
89
  output = <<END
90
+ # encoding: utf-8
87
91
  require 'rubypeg'
88
92
 
89
93
  class One < RubyPeg
@@ -106,6 +110,7 @@ input = <<END
106
110
  one := . . .
107
111
  END
108
112
  output = <<END
113
+ # encoding: utf-8
109
114
  require 'rubypeg'
110
115
 
111
116
  class One < RubyPeg
@@ -130,6 +135,7 @@ input = <<END
130
135
  one = !. &. `.
131
136
  END
132
137
  output = <<END
138
+ # encoding: utf-8
133
139
  require 'rubypeg'
134
140
 
135
141
  class One < RubyPeg
@@ -152,6 +158,7 @@ input = <<END
152
158
  one = .? .+ .*
153
159
  END
154
160
  output = <<END
161
+ # encoding: utf-8
155
162
  require 'rubypeg'
156
163
 
157
164
  class One < RubyPeg
@@ -174,6 +181,7 @@ input = <<END
174
181
  one = "one"
175
182
  END
176
183
  output = <<END
184
+ # encoding: utf-8
177
185
  require 'rubypeg'
178
186
 
179
187
  class One < RubyPeg
@@ -196,6 +204,7 @@ input = <<END
196
204
  one = '"'
197
205
  END
198
206
  output = <<END
207
+ # encoding: utf-8
199
208
  require 'rubypeg'
200
209
 
201
210
  class One < RubyPeg
@@ -218,6 +227,7 @@ input = <<END
218
227
  one = [a-z]
219
228
  END
220
229
  output = <<END
230
+ # encoding: utf-8
221
231
  require 'rubypeg'
222
232
 
223
233
  class One < RubyPeg
@@ -240,6 +250,7 @@ input = <<END
240
250
  one = /one/
241
251
  END
242
252
  output = <<END
253
+ # encoding: utf-8
243
254
  require 'rubypeg'
244
255
 
245
256
  class One < RubyPeg
@@ -262,6 +273,7 @@ input = <<END
262
273
  one = /one/
263
274
  END
264
275
  output = <<END
276
+ # encoding: utf-8
265
277
  require 'rubypeg'
266
278
 
267
279
  class One < RubyPeg
metadata CHANGED
@@ -1,43 +1,34 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: rubypeg
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 0
8
- - 3
9
- version: 0.0.3
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.4
5
+ prerelease:
10
6
  platform: ruby
11
- authors:
7
+ authors:
12
8
  - Thomas Counsell, Green on Black Ltd
13
9
  autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
-
17
- date: 2010-04-27 00:00:00 +01:00
18
- default_executable:
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2012-02-16 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: rubyscriptwriter
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- requirements:
25
- - - ">="
26
- - !ruby/object:Gem::Version
27
- segments:
28
- - 0
29
- version: "0"
16
+ requirement: &70121008002680 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
30
22
  type: :runtime
31
- version_requirements: *id001
23
+ prerelease: false
24
+ version_requirements: *70121008002680
32
25
  description:
33
26
  email: ruby-peg@greenonblack.com
34
- executables:
27
+ executables:
35
28
  - text-peg2ruby-peg
36
29
  extensions: []
37
-
38
30
  extra_rdoc_files: []
39
-
40
- files:
31
+ files:
41
32
  - README
42
33
  - spec/any_character_spec.rb
43
34
  - spec/lookahead_spec.rb
@@ -61,35 +52,30 @@ files:
61
52
  - examples/arithmetic/calculator_spec.rb
62
53
  - examples/excel/excel_peg.txt
63
54
  - examples/excel/excel_peg_spec.rb
64
- has_rdoc: true
65
55
  homepage: http://wiki.github.com/tamc/rubypeg/
66
56
  licenses: []
67
-
68
57
  post_install_message:
69
58
  rdoc_options: []
70
-
71
- require_paths:
59
+ require_paths:
72
60
  - lib
73
- required_ruby_version: !ruby/object:Gem::Requirement
74
- requirements:
75
- - - ">="
76
- - !ruby/object:Gem::Version
77
- segments:
78
- - 0
79
- version: "0"
80
- required_rubygems_version: !ruby/object:Gem::Requirement
81
- requirements:
82
- - - ">="
83
- - !ruby/object:Gem::Version
84
- segments:
85
- - 0
86
- version: "0"
61
+ required_ruby_version: !ruby/object:Gem::Requirement
62
+ none: false
63
+ requirements:
64
+ - - ! '>='
65
+ - !ruby/object:Gem::Version
66
+ version: '0'
67
+ required_rubygems_version: !ruby/object:Gem::Requirement
68
+ none: false
69
+ requirements:
70
+ - - ! '>='
71
+ - !ruby/object:Gem::Version
72
+ version: '0'
87
73
  requirements: []
88
-
89
74
  rubyforge_project:
90
- rubygems_version: 1.3.6
75
+ rubygems_version: 1.8.10
91
76
  signing_key:
92
77
  specification_version: 3
93
- summary: RubyPeg helps you to create readable Parsing Expression Grammars (PEG) in, err, ruby
78
+ summary: RubyPeg helps you to create readable Parsing Expression Grammars (PEG) in,
79
+ err, ruby
94
80
  test_files: []
95
-
81
+ has_rdoc: true