rubyscript 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,6 +19,21 @@ module RubyScript
19
19
  convert_anon(parsed)
20
20
  end
21
21
 
22
+ ###
23
+ ## Scopes and Blocks
24
+ ###
25
+ def convert_scope scope
26
+ convert_anon(scope[1])
27
+ end
28
+
29
+ def convert_block block
30
+ body = convert_anon(block[1])
31
+ "#{body};\n"
32
+ end
33
+
34
+ ###
35
+ ## Functions
36
+ ###
22
37
  def convert_defn defn
23
38
  func_name = defn[1]
24
39
  func_args = convert_args(defn[2])
@@ -34,15 +49,6 @@ module RubyScript
34
49
  args.join(", ")
35
50
  end
36
51
 
37
- def convert_scope scope
38
- convert_anon(scope[1])
39
- end
40
-
41
- def convert_block block
42
- body = convert_anon(block[1])
43
- "#{body};\n"
44
- end
45
-
46
52
  def convert_call call
47
53
  call_name = call[2]
48
54
  call_args = convert_arglist(call[3])
@@ -62,7 +68,9 @@ module RubyScript
62
68
  args
63
69
  end
64
70
 
65
- # Data types
71
+ ###
72
+ ## Data types
73
+ ###
66
74
  def convert_nil nil_arg
67
75
  "null"
68
76
  end
@@ -73,20 +81,20 @@ module RubyScript
73
81
 
74
82
  def convert_dstr dstr
75
83
  dstr.delete_at(0)
76
- string = "\"#{dstr[0]}"
84
+ string = ""
77
85
  dstr.delete_at(0)
78
- dstr.each do |str|
79
- if (str[0] == :str)
80
- string << "#{str[1]}"
86
+ dstr.each_index do |i|
87
+ if i == (dstr.count - 1)
88
+ string << convert_anon(dstr[i])
81
89
  else
82
- string << convert_anon(str)
90
+ string << "#{convert_anon(dstr[i])} + "
83
91
  end
84
92
  end
85
- "#{string}\""
93
+ string
86
94
  end
87
95
 
88
96
  def convert_evstr evstr
89
- "\" + #{convert_anon(evstr[1])} + \""
97
+ "(#{convert_anon(evstr[1])})"
90
98
  end
91
99
 
92
100
  def convert_lvar lvar
@@ -1,3 +1,3 @@
1
1
  module RubyScript
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: rubyscript
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.5
5
+ version: 0.0.6
6
6
  platform: ruby
7
7
  authors:
8
8
  - James Birtles