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 +4 -4
- data/README.md +2 -0
- data/lib/sorcerer/resource.rb +7 -17
- data/lib/sorcerer/version.rb +1 -1
- data/test/sorcerer/resource_test.rb +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8dcf3cdd1a1b69cbc70d2768c27dce5582958aaf
|
4
|
+
data.tar.gz: 25a67f7a15125bfba2759b37ccda0afeb9eaa5fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35d606b74d95f711284738d5d72878967ae569c664a25d2bc1f0f786fc06061df63cbcc66d7f870972176afc49a3ec95e0c4d41d66c12879f8ef244f00056653
|
7
|
+
data.tar.gz: 5fb9dbda6db23f37cbec9d5d823fd17cdee7a6ee88289bc484745480215fd511995f0711e61701578f28b5d9c7798ba12633e0a02d9111631fd1f382fa593f02
|
data/README.md
CHANGED
data/lib/sorcerer/resource.rb
CHANGED
@@ -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 =>
|
653
|
-
|
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 =>
|
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 =>
|
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 =>
|
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])
|
data/lib/sorcerer/version.rb
CHANGED
@@ -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
|