oedipus_lex 2.3.1 → 2.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/History.rdoc +6 -0
- data/lib/oedipus_lex.rb +4 -4
- data/test/test_oedipus_lex.rb +17 -0
- metadata +4 -4
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d1d4969de9074724f4c4491ba4ed4e11c49625d
|
4
|
+
data.tar.gz: db2fff4a5947473754ff79c4b0ea7bce982496d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03883e37fc06e56850ded37019c6b500e54d30ee0d455f529d4f5b9fbfe4f31baf053305bd503fa7bbf69ac4bacb11fe0c832128fe1d024d6e7d4c2d7d374f8f
|
7
|
+
data.tar.gz: ff54b5cb64e1ca96a20c3a6f094ed925dfb845dba5a6e66de5e73925e24a6c5655fa4cb78d283e46f9bb2649ae2b9361377d891b657ee99c2d2dbc27fec977d1
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/History.rdoc
CHANGED
data/lib/oedipus_lex.rb
CHANGED
@@ -4,7 +4,7 @@ require "erb"
|
|
4
4
|
require "oedipus_lex.rex"
|
5
5
|
|
6
6
|
class OedipusLex
|
7
|
-
VERSION = "2.3.
|
7
|
+
VERSION = "2.3.2"
|
8
8
|
|
9
9
|
attr_accessor :class_name
|
10
10
|
attr_accessor :header
|
@@ -316,13 +316,13 @@ class OedipusLex
|
|
316
316
|
% starts.each do |s|
|
317
317
|
<%= s %>
|
318
318
|
% end
|
319
|
-
% if option[:lineno] then
|
320
|
-
self.lineno += 1 if ss.peek(1) == "\n"
|
321
|
-
% end
|
322
319
|
|
323
320
|
token = nil
|
324
321
|
|
325
322
|
until ss.eos? or token do
|
323
|
+
% if option[:lineno] then
|
324
|
+
self.lineno += 1 if ss.peek(1) == "\n"
|
325
|
+
% end
|
326
326
|
token =
|
327
327
|
case state
|
328
328
|
% all_states.each do |the_states|
|
data/test/test_oedipus_lex.rb
CHANGED
@@ -741,4 +741,21 @@ class TestOedipusLex < Minitest::Test
|
|
741
741
|
|
742
742
|
assert_lexer_error src, txt, "can not match (:B): 'a'"
|
743
743
|
end
|
744
|
+
|
745
|
+
def test_incrementing_lineno_on_nil_token
|
746
|
+
src = <<-'REX'
|
747
|
+
class Calculator
|
748
|
+
option
|
749
|
+
lineno
|
750
|
+
rule
|
751
|
+
/\n/
|
752
|
+
/a/ { [:A, lineno] }
|
753
|
+
end
|
754
|
+
REX
|
755
|
+
|
756
|
+
txt = "\n\na"
|
757
|
+
exp = [[:A, 3]]
|
758
|
+
|
759
|
+
assert_lexer src, txt, exp
|
760
|
+
end
|
744
761
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oedipus_lex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Davis
|
@@ -29,7 +29,7 @@ cert_chain:
|
|
29
29
|
Y4evBVezr3SjXz08vPqRO5YRdO3zfeMT8gBjRqZjWJGMZ2lD4XNfrs7eky74CyZw
|
30
30
|
xx3n58i0lQkBE1EpKE0lFu/y
|
31
31
|
-----END CERTIFICATE-----
|
32
|
-
date: 2014-
|
32
|
+
date: 2014-08-07 00:00:00.000000000 Z
|
33
33
|
dependencies:
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: minitest
|
@@ -37,14 +37,14 @@ dependencies:
|
|
37
37
|
requirements:
|
38
38
|
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '5.
|
40
|
+
version: '5.4'
|
41
41
|
type: :development
|
42
42
|
prerelease: false
|
43
43
|
version_requirements: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '5.
|
47
|
+
version: '5.4'
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: rdoc
|
50
50
|
requirement: !ruby/object:Gem::Requirement
|
metadata.gz.sig
CHANGED
Binary file
|