oedipus_lex 2.5.3 → 2.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 294308d6ea6c939c11f453d7f64236d9aa16030bab382949409fad9e9ea48068
4
- data.tar.gz: 176340a2625364bd9fa473c6ac165d4839e7774d09585e2debf5f8a75104f56f
3
+ metadata.gz: 76ef0dafd6dd7e9a77ef872dd57e00126bd625e390dd3e371c21e632be475b05
4
+ data.tar.gz: 825c243a8b09d1a53cfff2617943a214c814033ef4baf607f8d1e33f2f5c89d9
5
5
  SHA512:
6
- metadata.gz: e973dec5da6a7848ed1934fdb0fe47e24bf5dbdbbbce252565441d085cb7146af2cf6e72d5327c9cea7267d15f8dcef5bf7473149f523e68af5e4e2d5829ed74
7
- data.tar.gz: bd024dcd741969fc4119989bfbbc8f570142cc32b59ec8e66097af24f6531760a61571db228b0f751259d556d95b6fe9ddb5cb872049addb3a41c5bd089af71f
6
+ metadata.gz: 563998da3d28b997e96ab50dc6bed61a9a710b2aec3437624052253ba62e0f7c5602df1e9fb3dec5bc50ce947e357dfc64c52ba21ef87091e9d43936394d1b95
7
+ data.tar.gz: e2ba477d3ab9a8bc13652c576495a0a17b222982d0a437d67bd1c7239fbd60b965a2c333c79ccaa80bc00b3d62f6a268b0f6f57429b18697c08d433f2ee4e91a
checksums.yaml.gz.sig CHANGED
@@ -1,4 +1 @@
1
- O
2
- �E8����Ͳ�t��ս
3
- �]���7B�)W�v�7|Yr;��!���cY�W�Ԕ�P��Ͱ0��wn�$.�]�R�N��q��
4
- =�vi1�)f�y��S���}�R�;��bqr����;|Y�p9�觭v4��S���1rj���`�(�zdp2!��τ7/4�
1
+ c�p�W#-*��?��p2��Cy��̅+/{O�t�`�3�_�cg��U�׉����5�;�рj\�E�כ��߯Ȉ�}��yE�`�K�7���9���b������͹2<$��4�<gӚ�8������T��i���� �z�c������4'��m����:���d�iK�lK��Sl�/�=1_��Z�� �AUQ�KRWg�*��b��F��n;�|���8 ���Cr.a�j��+m9�4��D�O��*0
data/History.rdoc CHANGED
@@ -1,3 +1,20 @@
1
+ === 2.6.1 / 2023-05-31
2
+
3
+ * 1 bug fix:
4
+
5
+ * Bumped minimum supported version of ruby to 2.7
6
+
7
+ === 2.6.0 / 2021-10-27
8
+
9
+ * 2 minor enhancements:
10
+
11
+ * Add frozen_string_literal comment to generated lexers.
12
+ * Allow empty regex. (marcandre)
13
+
14
+ * 1 bug fix:
15
+
16
+ * Switched from peek(1) == "\n" to check(/\n/) to save a ton of strings.
17
+
1
18
  === 2.5.3 / 2021-05-29
2
19
 
3
20
  * 1 bug fix:
data/Rakefile CHANGED
@@ -13,7 +13,7 @@ Hoe.spec "oedipus_lex" do
13
13
  self.readme_file = "README.rdoc"
14
14
  self.history_file = "History.rdoc"
15
15
 
16
- require_ruby_version [">= 2.4", "< 4.0"]
16
+ require_ruby_version [">= 2.7", "< 4.0"]
17
17
  end
18
18
 
19
19
  Hoe.bad_plugins.each do |bad|
data/lib/oedipus_lex.rb CHANGED
@@ -30,7 +30,7 @@ require "oedipus_lex.rex"
30
30
  # books.
31
31
 
32
32
  class OedipusLex
33
- VERSION = "2.5.3" # :nodoc:
33
+ VERSION = "2.6.1" # :nodoc:
34
34
 
35
35
  ##
36
36
  # The class name to generate.
@@ -394,6 +394,7 @@ class OedipusLex
394
394
  # :stopdoc:
395
395
 
396
396
  TEMPLATE = <<-'REX'.gsub(/^ {6}/, '')
397
+ # frozen_string_literal: true
397
398
  <%= encoding %>
398
399
  #--
399
400
  # This file is automatically generated. Do not modify it.
@@ -564,7 +565,7 @@ class OedipusLex
564
565
 
565
566
  until ss.eos? or token do
566
567
  % if option[:lineno] then
567
- if ss.peek(1) == "\n"
568
+ if ss.check(/\n/) then
568
569
  self.lineno += 1
569
570
  % if option[:column] then
570
571
  # line starts 1 position after the newline
data/lib/oedipus_lex.rex CHANGED
@@ -8,7 +8,7 @@ option
8
8
 
9
9
  macro
10
10
  ST /(?:(:\S+|\w+\??))/
11
- RE /(\/(?:\\.|[^\/])+\/[ion]?)/
11
+ RE /(\/(?:\\.|[^\/])*\/[ion]?)/
12
12
  ACT /(\{.*|:?\w+)/
13
13
 
14
14
  rule
@@ -1,7 +1,8 @@
1
+ # frozen_string_literal: true
1
2
  # encoding: UTF-8
2
3
  #--
3
4
  # This file is automatically generated. Do not modify it.
4
- # Generated by: oedipus_lex version 2.5.2.
5
+ # Generated by: oedipus_lex version 2.6.0.
5
6
  # Source: lib/oedipus_lex.rex
6
7
  #++
7
8
 
@@ -14,7 +15,7 @@ class OedipusLex
14
15
 
15
16
  # :stopdoc:
16
17
  ST = /(?:(:\S+|\w+\??))/
17
- RE = /(\/(?:\\.|[^\/])+\/[ion]?)/
18
+ RE = /(\/(?:\\.|[^\/])*\/[ion]?)/
18
19
  ACT = /(\{.*|:?\w+)/
19
20
  # :startdoc:
20
21
  # :stopdoc:
@@ -137,7 +138,7 @@ class OedipusLex
137
138
  token = nil
138
139
 
139
140
  until ss.eos? or token do
140
- if ss.peek(1) == "\n"
141
+ if ss.check(/\n/) then
141
142
  self.lineno += 1
142
143
  # line starts 1 position after the newline
143
144
  self.start_of_current_line_pos = ss.pos + 1
@@ -635,7 +635,8 @@ class TestOedipusLex < Minitest::Test
635
635
 
636
636
  ruby = generate_lexer src
637
637
 
638
- exp = ["# encoding: UTF-8",
638
+ exp = ["# frozen_string_literal: true",
639
+ "# encoding: UTF-8",
639
640
  "#--",
640
641
  "# This file is automatically generated. Do not modify it.",
641
642
  "# Generated by: oedipus_lex version #{OedipusLex::VERSION}.",
@@ -644,7 +645,7 @@ class TestOedipusLex < Minitest::Test
644
645
  "module X",
645
646
  "module Y"]
646
647
 
647
- assert_equal exp, ruby.lines.map(&:chomp).first(8)
648
+ assert_equal exp, ruby.lines.map(&:chomp).first(9)
648
649
  end
649
650
 
650
651
  def test_header_encoding_is_on_top
@@ -665,7 +666,8 @@ class TestOedipusLex < Minitest::Test
665
666
 
666
667
  ruby = generate_lexer src
667
668
 
668
- exp = ["# encoding: UTF-8",
669
+ exp = ["# frozen_string_literal: true",
670
+ "# encoding: UTF-8",
669
671
  "#--",
670
672
  "# This file is automatically generated. Do not modify it.",
671
673
  "# Generated by: oedipus_lex version #{OedipusLex::VERSION}.",
@@ -674,7 +676,7 @@ class TestOedipusLex < Minitest::Test
674
676
  "",
675
677
  "module X"]
676
678
 
677
- assert_equal exp, ruby.lines.map(&:chomp).first(8)
679
+ assert_equal exp, ruby.lines.map(&:chomp).first(9)
678
680
  end
679
681
 
680
682
  def test_read_non_existent_file
@@ -765,6 +767,19 @@ class TestOedipusLex < Minitest::Test
765
767
  assert_match 'ss.scan(/#{X}/)', source
766
768
  end
767
769
 
770
+ def test_parses_empty_regexp
771
+ source = generate_lexer %q{
772
+ class Foo
773
+ rule
774
+ /\w+/ { @state = :ARG; emit :tFUNCTION_CALL }
775
+ :ARG /\(/ { @state = nil; emit :tARG_LIST_BEGIN }
776
+ :ARG // { @state = nil }
777
+ end
778
+ }
779
+
780
+ assert_match 'ss.skip(//)', source
781
+ end
782
+
768
783
  def test_changing_state_during_lexing
769
784
  src = <<-'REX'
770
785
  class Calculator
data.tar.gz.sig CHANGED
Binary file
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.5.3
4
+ version: 2.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Davis
@@ -10,9 +10,9 @@ bindir: bin
10
10
  cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
- MIIDPjCCAiagAwIBAgIBBTANBgkqhkiG9w0BAQsFADBFMRMwEQYDVQQDDApyeWFu
13
+ MIIDPjCCAiagAwIBAgIBBzANBgkqhkiG9w0BAQsFADBFMRMwEQYDVQQDDApyeWFu
14
14
  ZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJemVuc3BpZGVyMRMwEQYKCZImiZPyL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6LYj5Bg
27
+ sM574Onr0dZDM6Vn69bzQ7rBIFDfK/OhlPzqKZad4nsdcsVH8ODCiT+ATMIZyz5K
28
+ WCnNtqlyiWXI8tdTpahDgcUwfcN/oN7v4K8iU5IbLJX6HQ5DKgmKjfb6XyMth16k
29
+ ROfWo9Uyp8ba/j9eVG14KkYRaLydAY1MNQk2yd3R5CGfeOpD1kttxjoypoUJ2dOG
30
+ nsNBRuQJ1UfiCG97a6DNm+Fr
31
31
  -----END CERTIFICATE-----
32
- date: 2021-05-30 00:00:00.000000000 Z
32
+ date: 2023-05-31 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: rdoc
@@ -57,14 +57,14 @@ dependencies:
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: '3.22'
60
+ version: '4.0'
61
61
  type: :development
62
62
  prerelease: false
63
63
  version_requirements: !ruby/object:Gem::Requirement
64
64
  requirements:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: '3.22'
67
+ version: '4.0'
68
68
  description: |-
69
69
  Oedipus Lex is a lexer generator in the same family as Rexical and
70
70
  Rex. Oedipus Lex is my independent lexer fork of Rexical. Rexical was
@@ -140,7 +140,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
140
140
  requirements:
141
141
  - - ">="
142
142
  - !ruby/object:Gem::Version
143
- version: '2.4'
143
+ version: '2.7'
144
144
  - - "<"
145
145
  - !ruby/object:Gem::Version
146
146
  version: '4.0'
@@ -150,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
150
150
  - !ruby/object:Gem::Version
151
151
  version: '0'
152
152
  requirements: []
153
- rubygems_version: 3.2.16
153
+ rubygems_version: 3.4.10
154
154
  signing_key:
155
155
  specification_version: 4
156
156
  summary: Oedipus Lex is a lexer generator in the same family as Rexical and Rex
metadata.gz.sig CHANGED
@@ -1,2 +1 @@
1
- 
2
- #��Ir!A��xW�����ȇL[n`�|���j�D�g�-�}� ��'[H�У@_\H��
1
+ `�Ƿ�Ybr�H�`�z-k��F(�J����g���xU}�T8�U3O�����v����9<�ֈ=��_hQd����־�=�2 h!yY^�,�ĕ'T�|Q�3�c!^T�V��H_���w�1��aÃ�R��AI|�>�XYd�y�N b�q��G`�l���g�͞�������`�ė/8q��I�8S ���3��[��@�q��9�9��Y�:ڋt�v����lx*98��os������!_�N� }�[�QRB�