furnace 0.3.0.beta3 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -135,7 +135,8 @@ module Furnace::AST
135
135
  # @param [Integer] indent Base indentation level.
136
136
  # @return [String]
137
137
  def to_sexp(indent=0)
138
- sexp = "#{" " * indent}(#{fancy_type}"
138
+ indented = " " * indent
139
+ sexp = "#{indented}(#{fancy_type}"
139
140
 
140
141
  first_node_child = children.index do |child|
141
142
  child.is_a?(Node) || child.is_a?(Array)
@@ -144,6 +145,18 @@ module Furnace::AST
144
145
  children.each_with_index do |child, idx|
145
146
  if child.is_a?(Node) && idx >= first_node_child
146
147
  sexp << "\n#{child.to_sexp(indent + 1)}"
148
+ elsif child.is_a?(Hash)
149
+ sexp << " {\n"
150
+ child.each do |key, value|
151
+ if value.is_a?(Node)
152
+ pretty_value = value.to_sexp(indent + 2).lstrip
153
+ else
154
+ pretty_value = value.inspect
155
+ end
156
+
157
+ sexp << "#{indented} #{key.inspect} => #{pretty_value}\n"
158
+ end
159
+ sexp << "#{indented} }"
147
160
  else
148
161
  sexp << " #{child.inspect}"
149
162
  end
@@ -1,3 +1,3 @@
1
1
  module Furnace
2
- VERSION = "0.3.0.beta3"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: furnace
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0.beta3
5
- prerelease: 6
4
+ version: 0.3.0
5
+ prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Peter Zotov
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-19 00:00:00.000000000 Z
12
+ date: 2012-11-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -118,13 +118,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
118
118
  version: '0'
119
119
  segments:
120
120
  - 0
121
- hash: 4298627248929422388
121
+ hash: 3607178250975202722
122
122
  required_rubygems_version: !ruby/object:Gem::Requirement
123
123
  none: false
124
124
  requirements:
125
- - - ! '>'
125
+ - - ! '>='
126
126
  - !ruby/object:Gem::Version
127
- version: 1.3.1
127
+ version: '0'
128
+ segments:
129
+ - 0
130
+ hash: 3607178250975202722
128
131
  requirements: []
129
132
  rubyforge_project:
130
133
  rubygems_version: 1.8.23