Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Switched to hoe. This includes the bundler and gemspec plugins to mai…

…ntain compatibility.

Removed lib/kpeg/version.rb and Gemfile.lock.
  • Loading branch information...
commit 5bb3a77cc1b60de768d7ac6c7b1cd7f800b7d9e4 1 parent bae00c3
Eric Hodel authored
2  .autotest
@@ -5,6 +5,6 @@ Autotest.add_hook :run_command do |at|
5 5
 end
6 6
 
7 7
 Autotest.add_hook :initialize do |at|
8  
-  at.testlib = 'minitest/unit'
  8
+  at.testlib = 'minitest/autorun'
9 9
 end
10 10
 
2  .gitignore
... ...
@@ -1,3 +1,5 @@
1 1
 *.rbc
2 2
 *.swp
  3
+/TAGS
  4
+/doc
3 5
 /pkg
13  .travis.yml
... ...
@@ -0,0 +1,13 @@
  1
+---
  2
+script: rake travis
  3
+before_script:
  4
+- gem install hoe-travis --no-rdoc --no-ri
  5
+- rake travis:before
  6
+language: ruby
  7
+notifications:
  8
+  email:
  9
+  - evan@fallingsnow.net
  10
+rvm:
  11
+- 1.8.7
  12
+- 1.9.2
  13
+- 1.9.3
14  Gemfile
... ...
@@ -1,4 +1,12 @@
1  
-source "http://rubygems.org"
  1
+# -*- ruby -*-
2 2
 
3  
-# Specify your gem's dependencies in callisto.gemspec
4  
-gemspec
  3
+# DO NOT EDIT THIS FILE. Instead, edit Rakefile, and run `rake bundler:gemfile`.
  4
+
  5
+source :gemcutter
  6
+
  7
+
  8
+gem "minitest", "~>2.11", :group => [:development, :test]
  9
+gem "rdoc", "~>3.10", :group => [:development, :test]
  10
+gem "hoe", "~>2.15", :group => [:development, :test]
  11
+
  12
+# vim: syntax=ruby
16  Gemfile.lock
... ...
@@ -1,16 +0,0 @@
1  
-PATH
2  
-  remote: .
3  
-  specs:
4  
-    kpeg (0.7.2)
5  
-
6  
-GEM
7  
-  remote: http://rubygems.org/
8  
-  specs:
9  
-    rake (0.8.7)
10  
-
11  
-PLATFORMS
12  
-  ruby
13  
-
14  
-DEPENDENCIES
15  
-  kpeg!
16  
-  rake
19  History.txt
... ...
@@ -0,0 +1,19 @@
  1
+=== 1.0 / 2012-04-06
  2
+
  3
+* Minor enhancements
  4
+  * Added arbitrary directives to the kpeg grammar
  5
+      %% directive_name { ... }
  6
+  * Added header and footer directives to the kpeg code formatter.  These
  7
+    appear above and below all other output, respectively:
  8
+
  9
+      %% header {
  10
+       # coding: UTF-8
  11
+      }
  12
+
  13
+      [... your grammar ...]
  14
+
  15
+      %% footer {
  16
+        require 'some/subclass'
  17
+      }
  18
+  * Switched to minitest
  19
+  * Switched to hoe
46  Manifest.txt
... ...
@@ -0,0 +1,46 @@
  1
+.autotest
  2
+Gemfile
  3
+History.txt
  4
+LICENSE
  5
+Manifest.txt
  6
+README.rdoc
  7
+Rakefile
  8
+bin/kpeg
  9
+examples/calculator/calculator.kpeg
  10
+examples/calculator/calculator.rb
  11
+examples/foreign_reference/literals.kpeg
  12
+examples/foreign_reference/matcher.kpeg
  13
+examples/foreign_reference/matcher.rb
  14
+examples/lua_string/driver.rb
  15
+examples/lua_string/lua_string.kpeg
  16
+examples/lua_string/lua_string.kpeg.rb
  17
+examples/phone_number/README.md
  18
+examples/phone_number/phone_number.kpeg
  19
+examples/phone_number/phone_number.rb
  20
+examples/upper/README.md
  21
+examples/upper/upper.kpeg
  22
+examples/upper/upper.rb
  23
+kpeg.gemspec
  24
+lib/kpeg.rb
  25
+lib/kpeg/code_generator.rb
  26
+lib/kpeg/compiled_parser.rb
  27
+lib/kpeg/format.kpeg
  28
+lib/kpeg/format_parser.rb
  29
+lib/kpeg/grammar.rb
  30
+lib/kpeg/grammar_renderer.rb
  31
+lib/kpeg/match.rb
  32
+lib/kpeg/parser.rb
  33
+lib/kpeg/position.rb
  34
+lib/kpeg/string_escape.kpeg
  35
+lib/kpeg/string_escape.rb
  36
+test/inputs/comments.kpeg
  37
+test/test_file_parser_roundtrip.rb
  38
+test/test_gen_calc.rb
  39
+test/test_kpeg.rb
  40
+test/test_kpeg_code_generator.rb
  41
+test/test_kpeg_compiled_parser.rb
  42
+test/test_kpeg_format.rb
  43
+test/test_kpeg_grammar_renderer.rb
  44
+test/test_left_recursion.rb
  45
+vim/syntax_kpeg/ftdetect/kpeg.vim
  46
+vim/syntax_kpeg/syntax/kpeg.vim
183  README.md
Source Rendered
... ...
@@ -1,183 +0,0 @@
1  
-KPeg
2  
-====
3  
-
4  
-KPeg is a simple PEG library for Ruby. It provides an API as well as native grammar to build the grammar.
5  
-
6  
-KPeg strives to provide a simple, powerful API without being too exotic.
7  
-
8  
-KPeg supports direct left recursion of rules via the [OMeta memoization](http://www.vpri.org/pdf/tr2008003_experimenting.pdf) trick.
9  
-
10  
-## Writing your first grammar
11  
-
12  
-### Setting up your grammar
13  
-
14  
-All grammars start with with the class/module name that will be your parser
15  
-
16  
-    %% name = Example::Parser
17  
-
18  
-After that a block of ruby code can be defined that will be added into the class body of your parser. Attributes that are defined in this block can be accessed within your parser as instance variables. Methods can also be defined in this block and used in action blocks as well.
19  
-
20  
-    %% {
21  
-      attr_accessor :something_cool
22  
-      
23  
-      def something_awesome
24  
-        # do something awesome
25  
-      end
26  
-    }
27  
-
28  
-### Defining literals
29  
-
30  
-Literals are static declarations of characters or regular expressions designed for reuse in the grammar. These can be constants or variables. Literals can take strings, regular expressions or character ranges
31  
-
32  
-    ALPHA = /[A-Za-z]/
33  
-    DIGIT = /[0-9]/
34  
-    period = "."
35  
-    string = "a string"
36  
-    regex = /(regexs?)+/
37  
-    char_range = [b-t]
38  
-
39  
-Literals can also accept multiple definitions
40  
-
41  
-    vowel = "a" | "e" | "i" | "o" | "u"
42  
-    alpha = /[A-Z]/ | /[a-z]/
43  
-
44  
-### Defining Rules for Values
45  
-
46  
-Before you can start parsing a string you will need to define rules that you will use to accept or reject that string. There are many different types of rules available in kpeg 
47  
-
48  
-The most basic of these rules is a string capture
49  
-
50  
-    alpha = < /[A-Za-z]/ > { text }
51  
-
52  
-
53  
-While this looks very much like the ALPHA literal defined above it differs in one important way, the text captured by the rule defined between the < and > symbols will be set as the text variable in block that follows. You can also explicitly define the variable that you would like but only with existing rules or literals.
54  
-
55  
-    letter = alpha:a { a }
56  
-
57  
-Additionally blocks can return true or false values based upon an expression within the block. To return true if a test passes do the following:
58  
-
59  
-    match_greater_than_10 = < num:n > &{ n > 10 }
60  
-
61  
-To test and return a false value if the test passes do the following:
62  
-
63  
-    do_not_match_greater_than_10 = < num:n > !{ n > 10 }
64  
-
65  
-Rules can also act like functions and take parameters. An example of this is lifted from the [Email List Validator](https://github.com/larb/email_address_validator), where an ascii value is passed in and the character is evaluated against it returning a true if it matches
66  
-
67  
-    d(num) = <.> &{ text[0] == num }
68  
-
69  
-Rules support some regular expression syntax for matching
70  
-
71  
-+ maybe ?
72  
-+ many +
73  
-+ kleene *
74  
-+ groupings ()
75  
-
76  
-Examples
77  
-
78  
-    letters = alpha+
79  
-    words = alpha+ space* period?
80  
-    sentence = (letters+ | space+)+
81  
-
82  
-Kpeg also allows a rule to define the acceptable number of matches in the form of a range. In regular expressions this is often denoted with syntax like {0,3}. Kpeg uses this syntax to accomplish match ranges [min, max].
83  
-
84  
-    matches_3_to_5_times = letter[3,5]
85  
-    matches_3_to_any_times = letter[3,*]
86  
-
87  
-### Defining Actions
88  
-
89  
-Illustrated above in some of the examples, kpeg allows you to perform actions based upon a match that are described in block provided or in the rule definition itself.
90  
-
91  
-    num = /[1-9][0-9]*/
92  
-    sum = < num:n1 "+" num:n2 > { n1 + n2 }
93  
-
94  
-As of version 0.8 an alternate syntax has been added for calling defined methods as actions.
95  
-
96  
-    %% {
97  
-      def add(n1, n2){
98  
-        n1 + n2
99  
-      }
100  
-    }
101  
-    num = /[1-9][0-9]*/
102  
-    sum = < num:n1 "+" num:n2 > ~add(n1, n2)
103  
-
104  
-### Referencing an external grammar
105  
-
106  
-Kpeg allows you to run a rule that is defined in an external grammar. This is useful if there is a defined set of rules that you would like to reuse in another parser. To do this, create your grammar and generate a parser using the kpeg command line tool.
107  
-
108  
-    kpeg literals.kpeg
109  
-
110  
-Once you have the generated parser, include that file into your new grammar
111  
-
112  
-    %{
113  
-      require "literals.kpeg.rb"
114  
-    }
115  
-
116  
-Then create a variable to hold to foreign interface and pass it the class name of your parser. In this case my parser class name is Literal 
117  
-
118  
-    %foreign_grammer = Literal
119  
-
120  
-You can then use rules defined in the foreign grammar in the local grammar file like so
121  
-
122  
-    sentence = (%foreign_grammer.alpha %foreign_grammer.space*)+ %foreign_grammer.period
123  
-
124  
-### Comments
125  
-
126  
-Kpeg allows comments to be added to the grammar file by using the # symbol
127  
-
128  
-    # This is a comment in my grammar
129  
-
130  
-## Generating and running your parser
131  
-
132  
-Before you can generate your parser you will need to define a root rule. This will be the first rule run against the string provided to the parser
133  
-
134  
-    root = sentence
135  
-
136  
-To generate the parser run the kpeg command with the kpeg file(s) as an argument. This will generate a ruby file with the same name as your grammar file.
137  
-
138  
-    kpeg example.kpeg
139  
-
140  
-Include your generated parser file into an application that you want to use the parser in and run it. Create a new instance of the parser and pass in the string you want to evaluate. When parse is called on the parser instance it will return a true if the sting is matched, or false if it doesn't. 
141  
-
142  
-    require "example.kpeg.rb"
143  
-
144  
-    parser = Example::Parser.new(string_to_evaluate)
145  
-    parser.parse
146  
-
147  
-## Shortcuts and other techniques
148  
-
149  
-Per vito, you can get the current line or current column in the following way 
150  
-
151  
-    line = { current_line }
152  
-    column = { current_column }
153  
-    foo = line:line ... { # use line here }
154  
-
155  
-## AST Generation
156  
-
157  
-As of Kpeg 0.8 a parser can now generate an AST. To define an AST node use the following syntax
158  
-
159  
-    %% assign = ast Assignment(name, value)
160  
-
161  
-Once you have a defined AST node, it can be used in your grammar like so
162  
-
163  
-    assignment = identifier:i space* = space* value:v ~assign(i,v)
164  
-
165  
-This will create a new Assign node that you can add into your AST.
166  
-
167  
-For a good example of usage check out [Talon](https://github.com/evanphx/talon)
168  
-
169  
-## Examples
170  
-
171  
-There are several examples available in the /examples directory. The upper parser has a readme with a step by step description of the grammar.
172  
-
173  
-## Projects using kpeg
174  
-
175  
-[Dang](https://github.com/veganstraightedge/dang)
176  
-
177  
-[Email Address Validator](https://github.com/larb/email_address_validator)
178  
-
179  
-[Callisto](https://github.com/dwaite/Callisto)
180  
-
181  
-[Doodle](https://github.com/vito/doodle)
182  
-
183  
-[Kanbanpad](https://kanbanpad.com) (uses kpeg for parsing of the 'enter something' bar)
222  README.rdoc
Source Rendered
... ...
@@ -0,0 +1,222 @@
  1
+= kpeg
  2
+
  3
+home :: https://github.com/evanphx/kpeg
  4
+bugs :: https://github.com/evanphx/kpeg/issues
  5
+
  6
+== Description
  7
+
  8
+KPeg is a simple PEG library for Ruby. It provides an API as well as native
  9
+grammar to build the grammar.
  10
+
  11
+KPeg strives to provide a simple, powerful API without being too exotic.
  12
+
  13
+KPeg supports direct left recursion of rules via the
  14
+{OMeta memoization}[http://www.vpri.org/pdf/tr2008003_experimenting.pdf] trick.
  15
+
  16
+== Writing your first grammar
  17
+
  18
+=== Setting up your grammar
  19
+
  20
+All grammars start with with the class/module name that will be your parser
  21
+
  22
+  %% name = Example::Parser
  23
+
  24
+After that a block of ruby code can be defined that will be added into the
  25
+class body of your parser. Attributes that are defined in this block can be
  26
+accessed within your parser as instance variables. Methods can also be defined
  27
+in this block and used in action blocks as well.
  28
+
  29
+  %% {
  30
+    attr_accessor :something_cool
  31
+    
  32
+    def something_awesome
  33
+      # do something awesome
  34
+    end
  35
+  }
  36
+
  37
+=== Defining literals
  38
+
  39
+Literals are static declarations of characters or regular expressions designed for reuse in the grammar. These can be constants or variables. Literals can take strings, regular expressions or character ranges
  40
+
  41
+  ALPHA = /[A-Za-z]/
  42
+  DIGIT = /[0-9]/
  43
+  period = "."
  44
+  string = "a string"
  45
+  regex = /(regexs?)+/
  46
+  char_range = [b-t]
  47
+
  48
+Literals can also accept multiple definitions
  49
+
  50
+  vowel = "a" | "e" | "i" | "o" | "u"
  51
+  alpha = /[A-Z]/ | /[a-z]/
  52
+
  53
+=== Defining Rules for Values
  54
+
  55
+Before you can start parsing a string you will need to define rules that you
  56
+will use to accept or reject that string. There are many different types of
  57
+rules available in kpeg 
  58
+
  59
+The most basic of these rules is a string capture
  60
+
  61
+  alpha = < /[A-Za-z]/ > { text }
  62
+
  63
+While this looks very much like the ALPHA literal defined above it differs in
  64
+one important way, the text captured by the rule defined between the < and >
  65
+symbols will be set as the text variable in block that follows. You can also
  66
+explicitly define the variable that you would like but only with existing
  67
+rules or literals.
  68
+
  69
+  letter = alpha:a { a }
  70
+
  71
+Additionally blocks can return true or false values based upon an expression
  72
+within the block. To return true if a test passes do the following:
  73
+
  74
+  match_greater_than_10 = < num:n > &{ n > 10 }
  75
+
  76
+To test and return a false value if the test passes do the following:
  77
+
  78
+  do_not_match_greater_than_10 = < num:n > !{ n > 10 }
  79
+
  80
+Rules can also act like functions and take parameters. An example of this is
  81
+lifted from the {Email List
  82
+Validator}[https://github.com/larb/email_address_validator], where an ascii
  83
+value is passed in and the character is evaluated against it returning a true
  84
+if it matches
  85
+
  86
+  d(num) = <.> &{ text[0] == num }
  87
+
  88
+Rules support some regular expression syntax for matching
  89
+
  90
+* maybe ?
  91
+* many +
  92
+* kleene *
  93
+* groupings ()
  94
+
  95
+Examples:
  96
+
  97
+  letters = alpha+
  98
+  words = alpha+ space* period?
  99
+  sentence = (letters+ | space+)+
  100
+
  101
+Kpeg also allows a rule to define the acceptable number of matches in the form
  102
+of a range. In regular expressions this is often denoted with syntax like
  103
+{0,3}. Kpeg uses this syntax to accomplish match ranges [min, max].
  104
+
  105
+  matches_3_to_5_times = letter[3,5]
  106
+  matches_3_to_any_times = letter[3,*]
  107
+
  108
+=== Defining Actions
  109
+
  110
+Illustrated above in some of the examples, kpeg allows you to perform actions
  111
+based upon a match that are described in block provided or in the rule
  112
+definition itself.
  113
+
  114
+  num = /[1-9][0-9]*/
  115
+  sum = < num:n1 "+" num:n2 > { n1 + n2 }
  116
+
  117
+As of version 0.8 an alternate syntax has been added for calling defined
  118
+methods as actions.
  119
+
  120
+  %% {
  121
+    def add(n1, n2){
  122
+      n1 + n2
  123
+    }
  124
+  }
  125
+  num = /[1-9][0-9]*/
  126
+  sum = < num:n1 "+" num:n2 > ~add(n1, n2)
  127
+
  128
+=== Referencing an external grammar
  129
+
  130
+Kpeg allows you to run a rule that is defined in an external grammar. This is
  131
+useful if there is a defined set of rules that you would like to reuse in
  132
+another parser. To do this, create your grammar and generate a parser using
  133
+the kpeg command line tool.
  134
+
  135
+  kpeg literals.kpeg
  136
+
  137
+Once you have the generated parser, include that file into your new grammar
  138
+
  139
+  %{
  140
+    require "literals.kpeg.rb"
  141
+  }
  142
+
  143
+Then create a variable to hold to foreign interface and pass it the class name
  144
+of your parser. In this case my parser class name is Literal 
  145
+
  146
+  %foreign_grammer = Literal
  147
+
  148
+You can then use rules defined in the foreign grammar in the local grammar
  149
+file like so
  150
+
  151
+  sentence = (%foreign_grammer.alpha %foreign_grammer.space*)+
  152
+             %foreign_grammer.period
  153
+
  154
+=== Comments
  155
+
  156
+Kpeg allows comments to be added to the grammar file by using the # symbol
  157
+
  158
+  # This is a comment in my grammar
  159
+
  160
+== Generating and running your parser
  161
+
  162
+Before you can generate your parser you will need to define a root rule. This
  163
+will be the first rule run against the string provided to the parser
  164
+
  165
+  root = sentence
  166
+
  167
+To generate the parser run the kpeg command with the kpeg file(s) as an
  168
+argument. This will generate a ruby file with the same name as your grammar
  169
+file.
  170
+
  171
+  kpeg example.kpeg
  172
+
  173
+Include your generated parser file into an application that you want to use
  174
+the parser in and run it. Create a new instance of the parser and pass in the
  175
+string you want to evaluate. When parse is called on the parser instance it
  176
+will return a true if the sting is matched, or false if it doesn't. 
  177
+
  178
+  require "example.kpeg.rb"
  179
+
  180
+  parser = Example::Parser.new(string_to_evaluate)
  181
+  parser.parse
  182
+
  183
+== Shortcuts and other techniques
  184
+
  185
+Per vito, you can get the current line or current column in the following way 
  186
+
  187
+  line = { current_line }
  188
+  column = { current_column }
  189
+  foo = line:line ... { # use line here }
  190
+
  191
+== AST Generation
  192
+
  193
+As of Kpeg 0.8 a parser can now generate an AST. To define an AST node use the
  194
+following syntax
  195
+
  196
+  %% assign = ast Assignment(name, value)
  197
+
  198
+Once you have a defined AST node, it can be used in your grammar like so
  199
+
  200
+  assignment = identifier:i space* = space* value:v ~assign(i,v)
  201
+
  202
+This will create a new Assign node that you can add into your AST.
  203
+
  204
+For a good example of usage check out Talon[https://github.com/evanphx/talon]
  205
+
  206
+== Examples
  207
+
  208
+There are several examples available in the /examples directory. The upper
  209
+parser has a readme with a step by step description of the grammar.
  210
+
  211
+== Projects using kpeg
  212
+
  213
+Dang[https://github.com/veganstraightedge/dang]
  214
+
  215
+{Email Address Validator}[https://github.com/larb/email_address_validator]
  216
+
  217
+Callisto[https://github.com/dwaite/Callisto]
  218
+
  219
+Doodle[https://github.com/vito/doodle]
  220
+
  221
+Kanbanpad[https://kanbanpad.com] (uses kpeg for parsing of the 'enter
  222
+something' bar)
34  Rakefile
... ...
@@ -1,20 +1,20 @@
1  
-require 'rake/testtask'
2  
-require 'rubygems/package_task'
  1
+# -*- ruby -*-
3 2
 
4  
-$:.unshift "lib"
  3
+require 'rubygems'
  4
+require 'hoe'
5 5
 
6  
-spec = Gem::Specification.load 'kpeg.gemspec'
7  
-Gem::PackageTask.new spec do |t|
8  
-  t.need_tar = false
9  
-  t.need_zip = false
10  
-end
  6
+Hoe.plugin :bundler
  7
+Hoe.plugin :gemspec
  8
+Hoe.plugin :git
  9
+Hoe.plugin :minitest
  10
+Hoe.plugin :travis
  11
+
  12
+Hoe.spec 'kpeg' do
  13
+  developer 'Eric Hodel', 'drbrain@segment7.net'
11 14
 
12  
-task :default => :test
  15
+  rdoc_locations << 'docs.seattlerb.org:/data/www/docs.seattlerb.org/kpeg/'
13 16
 
14  
-desc "Run tests"
15  
-Rake::TestTask.new do |t|
16  
-  t.test_files = FileList['test/test*.rb']
17  
-  t.verbose = true
  17
+  self.readme_file = 'README.rdoc'
18 18
 end
19 19
 
20 20
 task :grammar do
@@ -26,8 +26,10 @@ task :grammar do
26 26
   gr.render(STDOUT)
27 27
 end
28 28
 
29  
-desc "rebuild parser"
  29
+desc "build the parser"
30 30
 task :parser do
31  
-  sh "ruby -Ilib bin/kpeg -o lib/kpeg/string_escape.rb -f lib/kpeg/string_escape.kpeg"
32  
-  sh "ruby -Ilib bin/kpeg -o lib/kpeg/format_parser.rb -s -f lib/kpeg/format.kpeg"
  31
+  ruby "-Ilib bin/kpeg -o lib/kpeg/string_escape.rb -f lib/kpeg/string_escape.kpeg"
  32
+  ruby "-Ilib bin/kpeg -o lib/kpeg/format_parser.rb -s -f lib/kpeg/format.kpeg"
33 33
 end
  34
+
  35
+# vim: syntax=ruby
54  kpeg.gemspec
... ...
@@ -1,24 +1,42 @@
1 1
 # -*- encoding: utf-8 -*-
2  
-$:.push File.expand_path("../lib", __FILE__)
3  
-require "kpeg/version"
4 2
 
5 3
 Gem::Specification.new do |s|
6  
-  s.name        = "kpeg"
7  
-  s.version     = KPeg::VERSION
8  
-  s.platform    = Gem::Platform::RUBY
9  
-  s.authors     = ["Evan Phoenix"]
10  
-  s.email       = ["evan@fallingsnow.net"]
11  
-  s.homepage    = "https://github.com/evanphx/kpeg"
12  
-  s.summary     = %q{Peg-based Code Generator}
13  
-  s.description = %q{A tool for generating parsers using PEG}
  4
+  s.name = "kpeg"
  5
+  s.version = "0.8.5.20120306163408"
14 6
 
15  
-  rb = Dir["lib/**/*.rb"] << "bin/kpeg"
16  
-  docs = Dir["doc/**/*"]
17  
-
18  
-  s.files = rb + docs + ["README.md", "Rakefile", "kpeg.gemspec", "Gemfile"]
19  
-  s.test_files    = Dir["test/**/*.rb"]
20  
-  s.bindir = "bin"
  7
+  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
  8
+  s.authors = ["Eric Hodel"]
  9
+  s.cert_chain = ["/Users/drbrain/.gem/gem-public_cert.pem"]
  10
+  s.date = "2012-03-07"
  11
+  s.description = "KPeg is a simple PEG library for Ruby. It provides an API as well as native\ngrammar to build the grammar.\n\nKPeg strives to provide a simple, powerful API without being too exotic.\n\nKPeg supports direct left recursion of rules via the\n{OMeta memoization}[http://www.vpri.org/pdf/tr2008003_experimenting.pdf] trick."
  12
+  s.email = ["drbrain@segment7.net"]
21 13
   s.executables = ["kpeg"]
22  
-  s.add_development_dependency "rake"
23  
-  s.add_development_dependency "minitest", "~> 2.11"
  14
+  s.extra_rdoc_files = ["History.txt", "Manifest.txt", "README.rdoc"]
  15
+  s.files = [".autotest", "Gemfile", "Gemfile.lock", "History.txt", "LICENSE", "Manifest.txt", "README.rdoc", "Rakefile", "bin/kpeg", "examples/calculator/calculator.kpeg", "examples/calculator/calculator.rb", "examples/foreign_reference/literals.kpeg", "examples/foreign_reference/matcher.kpeg", "examples/foreign_reference/matcher.rb", "examples/lua_string/driver.rb", "examples/lua_string/lua_string.kpeg", "examples/lua_string/lua_string.kpeg.rb", "examples/phone_number/README.md", "examples/phone_number/phone_number.kpeg", "examples/phone_number/phone_number.rb", "examples/upper/README.md", "examples/upper/upper.kpeg", "examples/upper/upper.rb", "kpeg.gemspec", "lib/kpeg.rb", "lib/kpeg/code_generator.rb", "lib/kpeg/compiled_parser.rb", "lib/kpeg/format.kpeg", "lib/kpeg/format_parser.rb", "lib/kpeg/grammar.rb", "lib/kpeg/grammar_renderer.rb", "lib/kpeg/match.rb", "lib/kpeg/parser.rb", "lib/kpeg/position.rb", "lib/kpeg/string_escape.kpeg", "lib/kpeg/string_escape.rb", "lib/kpeg/version.rb", "test/inputs/comments.kpeg", "test/test_file_parser_roundtrip.rb", "test/test_gen_calc.rb", "test/test_kpeg.rb", "test/test_kpeg_code_generator.rb", "test/test_kpeg_compiled_parser.rb", "test/test_kpeg_format.rb", "test/test_kpeg_grammar_renderer.rb", "test/test_left_recursion.rb", "vim/syntax_kpeg/ftdetect/kpeg.vim", "vim/syntax_kpeg/syntax/kpeg.vim", ".gemtest"]
  16
+  s.homepage = "https://github.com/evanphx/kpeg"
  17
+  s.rdoc_options = ["--main", "README.rdoc"]
  18
+  s.require_paths = ["lib"]
  19
+  s.rubyforge_project = "kpeg"
  20
+  s.rubygems_version = "1.8.12"
  21
+  s.signing_key = "/Users/drbrain/.gem/gem-private_key.pem"
  22
+  s.summary = "KPeg is a simple PEG library for Ruby"
  23
+  s.test_files = ["test/test_file_parser_roundtrip.rb", "test/test_gen_calc.rb", "test/test_kpeg.rb", "test/test_kpeg_code_generator.rb", "test/test_kpeg_compiled_parser.rb", "test/test_kpeg_format.rb", "test/test_kpeg_grammar_renderer.rb", "test/test_left_recursion.rb"]
  24
+
  25
+  if s.respond_to? :specification_version then
  26
+    s.specification_version = 3
  27
+
  28
+    if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
  29
+      s.add_development_dependency(%q<minitest>, ["~> 2.11"])
  30
+      s.add_development_dependency(%q<rdoc>, ["~> 3.10"])
  31
+      s.add_development_dependency(%q<hoe>, ["~> 2.15"])
  32
+    else
  33
+      s.add_dependency(%q<minitest>, ["~> 2.11"])
  34
+      s.add_dependency(%q<rdoc>, ["~> 3.10"])
  35
+      s.add_dependency(%q<hoe>, ["~> 2.15"])
  36
+    end
  37
+  else
  38
+    s.add_dependency(%q<minitest>, ["~> 2.11"])
  39
+    s.add_dependency(%q<rdoc>, ["~> 3.10"])
  40
+    s.add_dependency(%q<hoe>, ["~> 2.15"])
  41
+  end
24 42
 end
3  lib/kpeg.rb
... ...
@@ -1,4 +1,7 @@
1 1
 module KPeg
  2
+
  3
+  VERSION = "0.8.5"
  4
+
2 5
   def self.grammar
3 6
     g = Grammar.new
4 7
     yield g
3  lib/kpeg/version.rb
... ...
@@ -1,3 +0,0 @@
1  
-module KPeg
2  
-  VERSION = "0.8.5"
3  
-end
0  doc/syntax_kpeg/ftdetect/kpeg.vim → vim/syntax_kpeg/ftdetect/kpeg.vim
File renamed without changes
0  doc/syntax_kpeg/syntax/kpeg.vim → vim/syntax_kpeg/syntax/kpeg.vim
File renamed without changes

0 notes on commit 5bb3a77

Please sign in to comment.
Something went wrong with that request. Please try again.