sorcerer 1.0.1 → 1.0.2

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
  SHA1:
3
- metadata.gz: df8721926f741e7dbf02d294af27ffb0ef6a5966
4
- data.tar.gz: 56a609a42385912a4ff0be8851e93c958bd60fce
3
+ metadata.gz: 8dcf3cdd1a1b69cbc70d2768c27dce5582958aaf
4
+ data.tar.gz: 25a67f7a15125bfba2759b37ccda0afeb9eaa5fb
5
5
  SHA512:
6
- metadata.gz: 3211b38e8163a2ec485269bcc6d4d31644bb9659470d254f0c9604f458440255446d1cf9571ce97eb57cb2365a6de62e28c14c12b0b162e8c9265fb7d8f5ab2c
7
- data.tar.gz: ff4f4a85b6076fe49dc3599eeacc10d1d9d896919d0a8b043c6dcf1d6c542587f48950c8e7d90381788fb09e5deb0ed4e5f6f80ed1da34a588bbf7c264941e64
6
+ metadata.gz: 35d606b74d95f711284738d5d72878967ae569c664a25d2bc1f0f786fc06061df63cbcc66d7f870972176afc49a3ec95e0c4d41d66c12879f8ef244f00056653
7
+ data.tar.gz: 5fb9dbda6db23f37cbec9d5d823fd17cdee7a6ee88289bc484745480215fd511995f0711e61701578f28b5d9c7798ba12633e0a02d9111631fd1f382fa593f02
data/README.md CHANGED
@@ -130,6 +130,8 @@ MIT-LICENSE file for details.
130
130
 
131
131
  ## History
132
132
 
133
+ * 1.0.2 - Fix bug in interpolated regular expression resourcing.
134
+
133
135
  * 1.0.1 - Add support for missing exception class or variable in
134
136
  rescue (from Trent Ogren).
135
137
 
@@ -284,6 +284,7 @@ module Sorcerer
284
284
  SPACE = lambda { |sexp| emit(" ") }
285
285
  PASS1 = lambda { |sexp| resource(sexp[1]) }
286
286
  PASS2 = lambda { |sexp| resource(sexp[2]) }
287
+ PASSBOTH = lambda { |sexp| resource(sexp[1]); resource(sexp[2]) }
287
288
  EMIT1 = lambda { |sexp| emit(sexp[1]) }
288
289
 
289
290
  # Earlier versions of ripper miss array node for words, see
@@ -649,14 +650,8 @@ module Sorcerer
649
650
  emit(" = ")
650
651
  resource(sexp[2])
651
652
  },
652
- :method_add_arg => lambda { |sexp|
653
- resource(sexp[1])
654
- resource(sexp[2])
655
- },
656
- :method_add_block => lambda { |sexp|
657
- resource(sexp[1])
658
- resource(sexp[2])
659
- },
653
+ :method_add_arg => PASSBOTH,
654
+ :method_add_block => PASSBOTH,
660
655
  :mlhs_add => lambda { |sexp|
661
656
  resource(sexp[1])
662
657
  emit(", ") unless sexp[1] == [:mlhs_new]
@@ -728,13 +723,14 @@ module Sorcerer
728
723
  :redo => lambda { |sexp|
729
724
  emit("redo")
730
725
  },
731
- :regexp_add => PASS2,
726
+ :regexp_add => PASSBOTH,
732
727
  :regexp_literal => lambda { |sexp|
733
728
  delims = determine_regexp_delimiters(sexp[2])
734
729
  emit(delims[0])
735
730
  resource(sexp[1])
736
731
  emit(delims[1])
737
732
  },
733
+ :regexp_new => NOOP,
738
734
  :rescue => lambda { |sexp|
739
735
  outdent do emit("rescue") end
740
736
  if sexp[1] # Exception list
@@ -790,10 +786,7 @@ module Sorcerer
790
786
  resource(sexp[2]) if sexp[2]
791
787
  },
792
788
  :stmts_new => NOOP,
793
- :string_add => lambda { |sexp|
794
- resource(sexp[1])
795
- resource(sexp[2])
796
- },
789
+ :string_add => PASSBOTH,
797
790
  :string_concat => lambda { |sexp|
798
791
  resource(sexp[1])
799
792
  emit(" ")
@@ -903,10 +896,7 @@ module Sorcerer
903
896
  words("W", sexp)
904
897
  },
905
898
  :words_new => NOOP,
906
- :xstring_add => lambda { |sexp|
907
- resource(sexp[1])
908
- resource(sexp[2])
909
- },
899
+ :xstring_add => PASSBOTH,
910
900
  :xstring_literal => lambda { |sexp|
911
901
  emit('"')
912
902
  resource(sexp[1])
@@ -2,7 +2,7 @@ module Sorcerer
2
2
  VERSION_NUMBERS = [
3
3
  VERSION_MAJOR = 1,
4
4
  VERSION_MINOR = 0,
5
- VERSION_BUILD = 1,
5
+ VERSION_BUILD = 2,
6
6
  ]
7
7
 
8
8
  VERSION = VERSION_NUMBERS.join('.')
@@ -276,6 +276,7 @@ class ResourceTest < Test::Unit::TestCase
276
276
  assert_resource "/[a-z]/"
277
277
  assert_resource "/\[a-z\]/"
278
278
  assert_resource '/#{name}/'
279
+ assert_resource '/before #{name} after/'
279
280
  end
280
281
 
281
282
  def test_can_source_regular_expressions_with_alternate_delimiters
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sorcerer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Weirich