sorcerer 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.textile CHANGED
@@ -18,15 +18,15 @@ bq. <em>Technically, Sorcerer should work on Ruby 1.8, but since Ripper is
18
18
 
19
19
  h2. Links
20
20
 
21
- Documents:: "http://github.com/jimweirich/sorcerer":http://github.com/jimweirich/sorcerer
22
- Git Clone:: git://github.com/jimweirich/sorcerer.git
23
- Issue Tracking:: "http://www.pivotaltracker.com/projects/56858":http://www.pivotaltracker.com/projects/56858
24
- Bug Reporting:: "http://onestepback.org/cgi-bin/bugs.cgi?project=sorcerer":http://onestepback.org/cgi-bin/bugs.cgi?project=sorcerer
21
+ Documents :: http://github.com/jimweirich/sorcerer
22
+ Git Clone :: git://github.com/jimweirich/sorcerer.git
23
+ Issues / Bug Tracking :: https://github.com/jimweirich/sorcerer/issues
24
+ Continuous Integration :: http://travis-ci.org/#!/jimweirich/sorcerer
25
25
 
26
26
  h2. Examples
27
27
 
28
28
  <pre style="background: LightGray">
29
- sexp = [:binary,
29
+ sexp = [:binary,
30
30
  [:var_ref, [:@ident, "a", [1, 0]]],
31
31
  :+,
32
32
  [:var_ref, [:@ident, "b", [1, 4]]]]
@@ -133,5 +133,3 @@ h2. History
133
133
 
134
134
  * 0.3.1 - 1.9.3 support. Indenting stabby procs. RedCloth not required
135
135
  for testing.
136
-
137
-
data/Rakefile CHANGED
@@ -13,6 +13,8 @@ rescue Exception
13
13
  nil
14
14
  end
15
15
 
16
+ CLEAN.include('pkg/sorcerer-*').exclude('pkg/*.gem')
17
+
16
18
  PROJ = 'sorcerer'
17
19
  RUBY = ENV['RUBY19'] || 'ruby19'
18
20
  PKG_VERSION = Sorcerer::VERSION
@@ -242,7 +242,7 @@ module Sorcerer
242
242
  }
243
243
 
244
244
  def determine_regexp_delimiters(sexp)
245
- sym, end_delim, other = sexp
245
+ sym, end_delim, _ = sexp
246
246
  fail UnexpectedSexpError, "Expected :@regexp_end, got #{sym.inspect}" unless sym == :@regexp_end
247
247
  end_delim_char = end_delim[0]
248
248
  first_delim = BALANCED_DELIMS[end_delim_char] || end_delim_char
@@ -786,7 +786,10 @@ module Sorcerer
786
786
  :top_const_field => NYI,
787
787
  :top_const_ref => NYI,
788
788
  :unary => lambda { |sexp|
789
- emit(sexp[1].to_s[0,1])
789
+ op = sexp[1].to_s
790
+ op = op[0,1] if op =~ /^.@$/
791
+ emit(op)
792
+ emit(" ") if op.size > 1
790
793
  resource(sexp[2])
791
794
  },
792
795
  :undef => lambda { |sexp|
@@ -1,11 +1,9 @@
1
1
  module Sorcerer
2
- VERSION_MAJOR = 0
3
- VERSION_MINOR = 3
4
- VERSION_BUILD = 2
5
- VERSION_BETA = 0
6
-
7
- VERSION_NUMBERS = [VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD] +
8
- (VERSION_BETA > 0 ? [VERSION_BETA] : [])
2
+ VERSION_NUMBERS = [
3
+ VERSION_MAJOR = 0,
4
+ VERSION_MINOR = 3,
5
+ VERSION_BUILD = 3,
6
+ ]
9
7
 
10
8
  VERSION = VERSION_NUMBERS.join('.')
11
9
  end
@@ -367,6 +367,9 @@ class SourcerTest < Test::Unit::TestCase
367
367
  assert_resource "-1"
368
368
  assert_resource "+a"
369
369
  assert_resource "-a"
370
+ assert_resource "~a"
371
+ assert_resource "!a"
372
+ assert_resource "not a"
370
373
  end
371
374
 
372
375
  def test_can_source_binary_expressions
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: 0.3.2
4
+ version: 0.3.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-14 00:00:00.000000000 Z
12
+ date: 2012-09-03 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Generate the original Ruby source from a Ripper-style abstract syntax
15
15
  tree.