rsec 0.3.6 → 0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/bench/bench.rb +0 -1
- data/bench/profile.rb +0 -1
- data/lib/rsec.rb +2 -22
- data/lib/rsec/helpers.rb +2 -2
- data/readme.rdoc +0 -6
- data/test/helpers.rb +0 -1
- data/test/test_prim.rb +1 -0
- metadata +4 -6
data/bench/bench.rb
CHANGED
data/bench/profile.rb
CHANGED
data/lib/rsec.rb
CHANGED
@@ -4,37 +4,17 @@
|
|
4
4
|
# All code is under this module
|
5
5
|
module Rsec
|
6
6
|
# preload configs
|
7
|
-
|
7
|
+
|
8
8
|
# config method name
|
9
9
|
# default is :r
|
10
10
|
unless Rsec.const_defined?(:TO_PARSER_METHOD)
|
11
11
|
TO_PARSER_METHOD = :r
|
12
12
|
end
|
13
13
|
|
14
|
-
|
15
|
-
# options:
|
16
|
-
# :try - default
|
17
|
-
# :no - don't use
|
18
|
-
# :yes - use
|
19
|
-
unless Rsec.const_defined?(:USE_CEXT)
|
20
|
-
USE_CEXT = :try
|
21
|
-
end
|
22
|
-
|
23
|
-
VERSION = '0.3'
|
14
|
+
VERSION = '0.4'
|
24
15
|
end
|
25
16
|
|
26
17
|
require "strscan"
|
27
18
|
require "rsec/utils"
|
28
19
|
require "rsec/parser"
|
29
20
|
require "rsec/helpers"
|
30
|
-
|
31
|
-
case Rsec::USE_CEXT
|
32
|
-
when :try
|
33
|
-
require "rsec/ext" rescue nil
|
34
|
-
when :yes
|
35
|
-
require "rsec/ext"
|
36
|
-
when :no
|
37
|
-
else
|
38
|
-
warn "Rsec::USE_CEXT should be one of :try, :yes, :no"
|
39
|
-
end
|
40
|
-
|
data/lib/rsec/helpers.rb
CHANGED
@@ -9,7 +9,7 @@ module Rsec #:nodoc:
|
|
9
9
|
module Helpers
|
10
10
|
|
11
11
|
# @ desc.helper
|
12
|
-
# Lazy parser
|
12
|
+
# Lazy parser is constructed when parsing starts. It is useful to reference a parser not defined yet
|
13
13
|
# @ example
|
14
14
|
# parser = lazy{future}
|
15
15
|
# future = 'jim'.r
|
@@ -104,7 +104,7 @@ module Rsec #:nodoc:
|
|
104
104
|
parser = \
|
105
105
|
case type
|
106
106
|
when :double; PDouble.new sign_strategy, false # decimal
|
107
|
-
when :hex_double; PDouble.new sign_strategy, true # hex
|
107
|
+
when :hex_double; raise "Removed because Ruby 1.9.3 removed float from hex" # PDouble.new sign_strategy, true # hex
|
108
108
|
when :int32; PInt32.new sign_strategy, base
|
109
109
|
when :int64; PInt64.new sign_strategy, base
|
110
110
|
when :unsigned_int32;
|
data/readme.rdoc
CHANGED
@@ -14,12 +14,6 @@ The pure Ruby gem is fast enough (about 10+x faster than treetop generated code)
|
|
14
14
|
|
15
15
|
gem in rsec
|
16
16
|
|
17
|
-
For extreme performance under C Ruby:
|
18
|
-
|
19
|
-
gem in rsec-ext
|
20
|
-
|
21
|
-
It is about 30% faster than Haskell Parsec in the benchmark.
|
22
|
-
|
23
17
|
== Doc
|
24
18
|
|
25
19
|
http://rsec.heroku.com
|
data/test/helpers.rb
CHANGED
data/test/test_prim.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: rsec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.
|
5
|
+
version: "0.4"
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- NS
|
@@ -10,8 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
14
|
-
default_executable:
|
13
|
+
date: 2011-12-28 00:00:00 Z
|
15
14
|
dependencies: []
|
16
15
|
|
17
16
|
description: Easy and extreme fast dynamic PEG parser combinator.
|
@@ -39,9 +38,9 @@ files:
|
|
39
38
|
- examples/c_minus.rb
|
40
39
|
- examples/little_markdown.rb
|
41
40
|
- examples/nasm_manual.rb
|
41
|
+
- examples/s_exp.rb
|
42
42
|
- examples/scheme.rb
|
43
43
|
- examples/slow_json.rb
|
44
|
-
- examples/s_exp.rb
|
45
44
|
- examples/hello.scm
|
46
45
|
- test/helpers.rb
|
47
46
|
- test/test_branch.rb
|
@@ -58,7 +57,6 @@ files:
|
|
58
57
|
- bench/bench.rb
|
59
58
|
- bench/little.rb
|
60
59
|
- bench/profile.rb
|
61
|
-
has_rdoc: true
|
62
60
|
homepage: http://rsec.heroku.com
|
63
61
|
licenses: []
|
64
62
|
|
@@ -82,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
82
80
|
requirements: []
|
83
81
|
|
84
82
|
rubyforge_project:
|
85
|
-
rubygems_version: 1.
|
83
|
+
rubygems_version: 1.8.11
|
86
84
|
signing_key:
|
87
85
|
specification_version: 3
|
88
86
|
summary: Extreme Fast Parser Combinator for Ruby
|