atomy 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +30 -0
- data/README.md +1 -0
- data/bin/atomy +134 -0
- data/kernel/block.ay +30 -0
- data/kernel/boot.ay +10 -0
- data/kernel/comparison.ay +61 -0
- data/kernel/concurrency.ay +84 -0
- data/kernel/condition.ay +277 -0
- data/kernel/control-flow.ay +222 -0
- data/kernel/cosmetics.ay +3 -0
- data/kernel/data-delta.ay +105 -0
- data/kernel/data.ay +56 -0
- data/kernel/define.ay +93 -0
- data/kernel/doc.ay +453 -0
- data/kernel/documentation.ay +135 -0
- data/kernel/dynamic.ay +42 -0
- data/kernel/errors.ay +6 -0
- data/kernel/format.ay +13 -0
- data/kernel/format/data.ay +89 -0
- data/kernel/format/formatter.ay +345 -0
- data/kernel/format/parser.ay +13 -0
- data/kernel/hashes.ay +39 -0
- data/kernel/io.ay +244 -0
- data/kernel/namespaces.ay +63 -0
- data/kernel/node.ay +48 -0
- data/kernel/operators.ay +28 -0
- data/kernel/particles.ay +53 -0
- data/kernel/patterns.ay +256 -0
- data/kernel/precision.ay +148 -0
- data/kernel/pretty.ay +283 -0
- data/kernel/repl.ay +140 -0
- data/kernel/therie.ay +204 -0
- data/lib/ast/binary_send.rb +44 -0
- data/lib/ast/block.rb +268 -0
- data/lib/ast/constant.rb +88 -0
- data/lib/ast/internal/assign.rb +19 -0
- data/lib/ast/internal/block_pass.rb +21 -0
- data/lib/ast/internal/catch.rb +247 -0
- data/lib/ast/internal/class.rb +30 -0
- data/lib/ast/internal/class_variable.rb +23 -0
- data/lib/ast/internal/define.rb +174 -0
- data/lib/ast/internal/ensure.rb +135 -0
- data/lib/ast/internal/file.rb +14 -0
- data/lib/ast/internal/global_variable.rb +20 -0
- data/lib/ast/internal/if_then_else.rb +24 -0
- data/lib/ast/internal/instance_variable.rb +17 -0
- data/lib/ast/internal/let_macro.rb +35 -0
- data/lib/ast/internal/macro_quote.rb +23 -0
- data/lib/ast/internal/match.rb +53 -0
- data/lib/ast/internal/module.rb +30 -0
- data/lib/ast/internal/pattern.rb +17 -0
- data/lib/ast/internal/return.rb +29 -0
- data/lib/ast/internal/set.rb +19 -0
- data/lib/ast/internal/singleton_class.rb +18 -0
- data/lib/ast/internal/splat.rb +14 -0
- data/lib/ast/internal/when.rb +24 -0
- data/lib/ast/list.rb +25 -0
- data/lib/ast/macro.rb +37 -0
- data/lib/ast/node.rb +599 -0
- data/lib/ast/operator.rb +21 -0
- data/lib/ast/particle.rb +13 -0
- data/lib/ast/primitive.rb +20 -0
- data/lib/ast/quasi_quote.rb +20 -0
- data/lib/ast/quote.rb +13 -0
- data/lib/ast/send.rb +104 -0
- data/lib/ast/splice.rb +32 -0
- data/lib/ast/string.rb +23 -0
- data/lib/ast/unary.rb +44 -0
- data/lib/ast/unquote.rb +45 -0
- data/lib/ast/variable.rb +64 -0
- data/lib/atomy.kpeg.rb +3995 -0
- data/lib/code_loader.rb +137 -0
- data/lib/compiler/compiler.rb +155 -0
- data/lib/compiler/stages.rb +81 -0
- data/lib/formatter.kpeg.rb +1394 -0
- data/lib/macros.rb +317 -0
- data/lib/method.rb +261 -0
- data/lib/namespace.rb +236 -0
- data/lib/parser.rb +28 -0
- data/lib/patterns.rb +276 -0
- data/lib/patterns/any.rb +21 -0
- data/lib/patterns/attribute.rb +59 -0
- data/lib/patterns/block_pass.rb +54 -0
- data/lib/patterns/constant.rb +33 -0
- data/lib/patterns/default.rb +44 -0
- data/lib/patterns/head_tail.rb +63 -0
- data/lib/patterns/list.rb +77 -0
- data/lib/patterns/match.rb +45 -0
- data/lib/patterns/named.rb +55 -0
- data/lib/patterns/named_class.rb +46 -0
- data/lib/patterns/named_global.rb +46 -0
- data/lib/patterns/named_instance.rb +46 -0
- data/lib/patterns/particle.rb +29 -0
- data/lib/patterns/quasi_quote.rb +184 -0
- data/lib/patterns/quote.rb +33 -0
- data/lib/patterns/singleton_class.rb +31 -0
- data/lib/patterns/splat.rb +57 -0
- data/lib/util.rb +37 -0
- metadata +164 -0
data/lib/util.rb
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
class Rubinius::Generator
|
2
|
+
def debug(name = "")
|
3
|
+
dup
|
4
|
+
send :inspect, 0
|
5
|
+
push_literal name + ": "
|
6
|
+
swap
|
7
|
+
push_literal "\n"
|
8
|
+
string_build 3
|
9
|
+
send :display, 0
|
10
|
+
pop
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
module Atomy
|
15
|
+
def self.const_from_string(g, name)
|
16
|
+
g.push_cpath_top
|
17
|
+
top = nil
|
18
|
+
name.split("::").each do |s|
|
19
|
+
next if s.empty?
|
20
|
+
g.find_const s.to_sym
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.assign_local(g, name, set = false)
|
25
|
+
if !set && g.state.scope.respond_to?(:pseudo_local)
|
26
|
+
var = g.state.scope.pseudo_local(name)
|
27
|
+
else
|
28
|
+
var = g.state.scope.search_local(name)
|
29
|
+
end
|
30
|
+
|
31
|
+
if var && (set || var.depth == 0)
|
32
|
+
var
|
33
|
+
else
|
34
|
+
g.state.scope.new_local(name).reference
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
metadata
ADDED
@@ -0,0 +1,164 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: atomy
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 25
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Alex Suraci
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2011-02-26 00:00:00 -05:00
|
19
|
+
default_executable:
|
20
|
+
dependencies: []
|
21
|
+
|
22
|
+
description: the Atomy programming language
|
23
|
+
email: i.am@toogeneric.com
|
24
|
+
executables:
|
25
|
+
- atomy
|
26
|
+
extensions: []
|
27
|
+
|
28
|
+
extra_rdoc_files: []
|
29
|
+
|
30
|
+
files:
|
31
|
+
- README.md
|
32
|
+
- COPYING
|
33
|
+
- bin/atomy
|
34
|
+
- lib/ast/binary_send.rb
|
35
|
+
- lib/ast/block.rb
|
36
|
+
- lib/ast/constant.rb
|
37
|
+
- lib/ast/list.rb
|
38
|
+
- lib/ast/macro.rb
|
39
|
+
- lib/ast/node.rb
|
40
|
+
- lib/ast/operator.rb
|
41
|
+
- lib/ast/particle.rb
|
42
|
+
- lib/ast/primitive.rb
|
43
|
+
- lib/ast/quasi_quote.rb
|
44
|
+
- lib/ast/quote.rb
|
45
|
+
- lib/ast/send.rb
|
46
|
+
- lib/ast/splice.rb
|
47
|
+
- lib/ast/string.rb
|
48
|
+
- lib/ast/unary.rb
|
49
|
+
- lib/ast/unquote.rb
|
50
|
+
- lib/ast/variable.rb
|
51
|
+
- lib/ast/internal/assign.rb
|
52
|
+
- lib/ast/internal/block_pass.rb
|
53
|
+
- lib/ast/internal/catch.rb
|
54
|
+
- lib/ast/internal/class.rb
|
55
|
+
- lib/ast/internal/class_variable.rb
|
56
|
+
- lib/ast/internal/define.rb
|
57
|
+
- lib/ast/internal/ensure.rb
|
58
|
+
- lib/ast/internal/file.rb
|
59
|
+
- lib/ast/internal/global_variable.rb
|
60
|
+
- lib/ast/internal/if_then_else.rb
|
61
|
+
- lib/ast/internal/instance_variable.rb
|
62
|
+
- lib/ast/internal/let_macro.rb
|
63
|
+
- lib/ast/internal/macro_quote.rb
|
64
|
+
- lib/ast/internal/match.rb
|
65
|
+
- lib/ast/internal/module.rb
|
66
|
+
- lib/ast/internal/pattern.rb
|
67
|
+
- lib/ast/internal/return.rb
|
68
|
+
- lib/ast/internal/set.rb
|
69
|
+
- lib/ast/internal/singleton_class.rb
|
70
|
+
- lib/ast/internal/splat.rb
|
71
|
+
- lib/ast/internal/when.rb
|
72
|
+
- lib/patterns/any.rb
|
73
|
+
- lib/patterns/attribute.rb
|
74
|
+
- lib/patterns/block_pass.rb
|
75
|
+
- lib/patterns/constant.rb
|
76
|
+
- lib/patterns/default.rb
|
77
|
+
- lib/patterns/head_tail.rb
|
78
|
+
- lib/patterns/list.rb
|
79
|
+
- lib/patterns/match.rb
|
80
|
+
- lib/patterns/named.rb
|
81
|
+
- lib/patterns/named_class.rb
|
82
|
+
- lib/patterns/named_global.rb
|
83
|
+
- lib/patterns/named_instance.rb
|
84
|
+
- lib/patterns/particle.rb
|
85
|
+
- lib/patterns/quasi_quote.rb
|
86
|
+
- lib/patterns/quote.rb
|
87
|
+
- lib/patterns/singleton_class.rb
|
88
|
+
- lib/patterns/splat.rb
|
89
|
+
- lib/compiler/compiler.rb
|
90
|
+
- lib/compiler/stages.rb
|
91
|
+
- lib/atomy.kpeg.rb
|
92
|
+
- lib/code_loader.rb
|
93
|
+
- lib/formatter.kpeg.rb
|
94
|
+
- lib/macros.rb
|
95
|
+
- lib/method.rb
|
96
|
+
- lib/namespace.rb
|
97
|
+
- lib/parser.rb
|
98
|
+
- lib/patterns.rb
|
99
|
+
- lib/util.rb
|
100
|
+
- kernel/block.ay
|
101
|
+
- kernel/boot.ay
|
102
|
+
- kernel/comparison.ay
|
103
|
+
- kernel/concurrency.ay
|
104
|
+
- kernel/condition.ay
|
105
|
+
- kernel/control-flow.ay
|
106
|
+
- kernel/cosmetics.ay
|
107
|
+
- kernel/data-delta.ay
|
108
|
+
- kernel/data.ay
|
109
|
+
- kernel/define.ay
|
110
|
+
- kernel/doc.ay
|
111
|
+
- kernel/documentation.ay
|
112
|
+
- kernel/dynamic.ay
|
113
|
+
- kernel/errors.ay
|
114
|
+
- kernel/format.ay
|
115
|
+
- kernel/hashes.ay
|
116
|
+
- kernel/io.ay
|
117
|
+
- kernel/namespaces.ay
|
118
|
+
- kernel/node.ay
|
119
|
+
- kernel/operators.ay
|
120
|
+
- kernel/particles.ay
|
121
|
+
- kernel/patterns.ay
|
122
|
+
- kernel/precision.ay
|
123
|
+
- kernel/pretty.ay
|
124
|
+
- kernel/repl.ay
|
125
|
+
- kernel/therie.ay
|
126
|
+
- kernel/format/data.ay
|
127
|
+
- kernel/format/formatter.ay
|
128
|
+
- kernel/format/parser.ay
|
129
|
+
has_rdoc: true
|
130
|
+
homepage: http://www.atomy-lang.org
|
131
|
+
licenses:
|
132
|
+
- BSD
|
133
|
+
post_install_message:
|
134
|
+
rdoc_options: []
|
135
|
+
|
136
|
+
require_paths:
|
137
|
+
- lib
|
138
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
139
|
+
none: false
|
140
|
+
requirements:
|
141
|
+
- - ">="
|
142
|
+
- !ruby/object:Gem::Version
|
143
|
+
hash: 3
|
144
|
+
segments:
|
145
|
+
- 0
|
146
|
+
version: "0"
|
147
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
148
|
+
none: false
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
hash: 3
|
153
|
+
segments:
|
154
|
+
- 0
|
155
|
+
version: "0"
|
156
|
+
requirements: []
|
157
|
+
|
158
|
+
rubyforge_project: atomy
|
159
|
+
rubygems_version: 1.5.2
|
160
|
+
signing_key:
|
161
|
+
specification_version: 3
|
162
|
+
summary: the Atomy programming language
|
163
|
+
test_files: []
|
164
|
+
|