nydp 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +18 -0
- data/.rspec +2 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +58 -0
- data/Rakefile +1 -0
- data/bin/nydp +5 -0
- data/bin/nydp-tests +5 -0
- data/lib/lisp/boot.nydp +219 -0
- data/lib/lisp/test-runner.nydp +39 -0
- data/lib/lisp/tests/foundation-test.nydp +28 -0
- data/lib/nydp.rb +143 -0
- data/lib/nydp/assignment.rb +40 -0
- data/lib/nydp/builtin.rb +8 -0
- data/lib/nydp/builtin/apply.rb +16 -0
- data/lib/nydp/builtin/car.rb +5 -0
- data/lib/nydp/builtin/cdr.rb +5 -0
- data/lib/nydp/builtin/cdr_set.rb +8 -0
- data/lib/nydp/builtin/comment.rb +5 -0
- data/lib/nydp/builtin/cons.rb +16 -0
- data/lib/nydp/builtin/divide.rb +13 -0
- data/lib/nydp/builtin/error.rb +6 -0
- data/lib/nydp/builtin/eval.rb +14 -0
- data/lib/nydp/builtin/greater_than.rb +10 -0
- data/lib/nydp/builtin/hash.rb +30 -0
- data/lib/nydp/builtin/inspect.rb +5 -0
- data/lib/nydp/builtin/is_equal.rb +5 -0
- data/lib/nydp/builtin/less_than.rb +10 -0
- data/lib/nydp/builtin/millisecs.rb +7 -0
- data/lib/nydp/builtin/minus.rb +13 -0
- data/lib/nydp/builtin/plus.rb +28 -0
- data/lib/nydp/builtin/pre_compile.rb +5 -0
- data/lib/nydp/builtin/puts.rb +7 -0
- data/lib/nydp/builtin/quit.rb +5 -0
- data/lib/nydp/builtin/random_string.rb +11 -0
- data/lib/nydp/builtin/times.rb +13 -0
- data/lib/nydp/builtin/to_string.rb +12 -0
- data/lib/nydp/builtin/to_sym.rb +21 -0
- data/lib/nydp/builtin/vm_info.rb +13 -0
- data/lib/nydp/closure.rb +17 -0
- data/lib/nydp/compiler.rb +49 -0
- data/lib/nydp/cond.rb +56 -0
- data/lib/nydp/context_symbol.rb +22 -0
- data/lib/nydp/error.rb +4 -0
- data/lib/nydp/function_invocation.rb +52 -0
- data/lib/nydp/helper.rb +32 -0
- data/lib/nydp/interpreted_function.rb +79 -0
- data/lib/nydp/lexical_context.rb +38 -0
- data/lib/nydp/literal.rb +40 -0
- data/lib/nydp/pair.rb +112 -0
- data/lib/nydp/parser.rb +123 -0
- data/lib/nydp/string_atom.rb +24 -0
- data/lib/nydp/string_token.rb +21 -0
- data/lib/nydp/symbol.rb +47 -0
- data/lib/nydp/symbol_lookup.rb +43 -0
- data/lib/nydp/tokeniser.rb +80 -0
- data/lib/nydp/truth.rb +37 -0
- data/lib/nydp/version.rb +3 -0
- data/lib/nydp/vm.rb +76 -0
- data/nydp.gemspec +27 -0
- data/spec/boot_spec.rb +119 -0
- data/spec/embedded_spec.rb +106 -0
- data/spec/nypd_spec.rb +127 -0
- data/spec/pair_spec.rb +102 -0
- data/spec/parser_spec.rb +191 -0
- data/spec/spec_helper.rb +10 -0
- data/spec/symbol_spec.rb +32 -0
- metadata +176 -0
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
require 'nydp'
|
2
|
+
require 'nydp/symbol'
|
3
|
+
|
4
|
+
RSpec.configure do |config|
|
5
|
+
config.treat_symbols_as_metadata_keys_with_true_values = true
|
6
|
+
config.run_all_when_everything_filtered = true
|
7
|
+
config.filter_run :focus
|
8
|
+
config.order = 'random'
|
9
|
+
config.include Nydp::Helper
|
10
|
+
end
|
data/spec/symbol_spec.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Nydp::Symbol do
|
4
|
+
let(:ns) { { } }
|
5
|
+
|
6
|
+
it "should not recognise an unknown symbol" do
|
7
|
+
sym = Nydp::Symbol.find :foo, ns
|
8
|
+
expect(sym).to eq nil
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should create a new symbol" do
|
12
|
+
sym = Nydp::Symbol.mk :foo, ns
|
13
|
+
expect(sym.name.should).to eq :foo
|
14
|
+
end
|
15
|
+
|
16
|
+
it "should not create a new symbol when the symbol already exists" do
|
17
|
+
sym1 = Nydp::Symbol.mk :baz, ns
|
18
|
+
sym2 = Nydp::Symbol.mk :baz, ns
|
19
|
+
|
20
|
+
expect(sym1).to equal sym2
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should consider symbols == when they share the same name" do
|
24
|
+
ns1 = { }
|
25
|
+
ns2 = { }
|
26
|
+
|
27
|
+
sym1 = Nydp::Symbol.mk :baz, ns1
|
28
|
+
sym2 = Nydp::Symbol.mk :baz, ns2
|
29
|
+
|
30
|
+
expect(sym1).to eq sym2
|
31
|
+
end
|
32
|
+
end
|
metadata
ADDED
@@ -0,0 +1,176 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: nydp
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Conan Dalton
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-11-29 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.3'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '2.9'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '2.9'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec_numbering_formatter
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description: Not Your Daddy's Parentheses
|
70
|
+
email:
|
71
|
+
- conan@conandalton.net
|
72
|
+
executables:
|
73
|
+
- nydp
|
74
|
+
- nydp-tests
|
75
|
+
extensions: []
|
76
|
+
extra_rdoc_files: []
|
77
|
+
files:
|
78
|
+
- ".gitignore"
|
79
|
+
- ".rspec"
|
80
|
+
- Gemfile
|
81
|
+
- LICENSE.txt
|
82
|
+
- README.md
|
83
|
+
- Rakefile
|
84
|
+
- bin/nydp
|
85
|
+
- bin/nydp-tests
|
86
|
+
- lib/lisp/boot.nydp
|
87
|
+
- lib/lisp/test-runner.nydp
|
88
|
+
- lib/lisp/tests/foundation-test.nydp
|
89
|
+
- lib/nydp.rb
|
90
|
+
- lib/nydp/assignment.rb
|
91
|
+
- lib/nydp/builtin.rb
|
92
|
+
- lib/nydp/builtin/apply.rb
|
93
|
+
- lib/nydp/builtin/car.rb
|
94
|
+
- lib/nydp/builtin/cdr.rb
|
95
|
+
- lib/nydp/builtin/cdr_set.rb
|
96
|
+
- lib/nydp/builtin/comment.rb
|
97
|
+
- lib/nydp/builtin/cons.rb
|
98
|
+
- lib/nydp/builtin/divide.rb
|
99
|
+
- lib/nydp/builtin/error.rb
|
100
|
+
- lib/nydp/builtin/eval.rb
|
101
|
+
- lib/nydp/builtin/greater_than.rb
|
102
|
+
- lib/nydp/builtin/hash.rb
|
103
|
+
- lib/nydp/builtin/inspect.rb
|
104
|
+
- lib/nydp/builtin/is_equal.rb
|
105
|
+
- lib/nydp/builtin/less_than.rb
|
106
|
+
- lib/nydp/builtin/millisecs.rb
|
107
|
+
- lib/nydp/builtin/minus.rb
|
108
|
+
- lib/nydp/builtin/plus.rb
|
109
|
+
- lib/nydp/builtin/pre_compile.rb
|
110
|
+
- lib/nydp/builtin/puts.rb
|
111
|
+
- lib/nydp/builtin/quit.rb
|
112
|
+
- lib/nydp/builtin/random_string.rb
|
113
|
+
- lib/nydp/builtin/times.rb
|
114
|
+
- lib/nydp/builtin/to_string.rb
|
115
|
+
- lib/nydp/builtin/to_sym.rb
|
116
|
+
- lib/nydp/builtin/vm_info.rb
|
117
|
+
- lib/nydp/closure.rb
|
118
|
+
- lib/nydp/compiler.rb
|
119
|
+
- lib/nydp/cond.rb
|
120
|
+
- lib/nydp/context_symbol.rb
|
121
|
+
- lib/nydp/error.rb
|
122
|
+
- lib/nydp/function_invocation.rb
|
123
|
+
- lib/nydp/helper.rb
|
124
|
+
- lib/nydp/interpreted_function.rb
|
125
|
+
- lib/nydp/lexical_context.rb
|
126
|
+
- lib/nydp/literal.rb
|
127
|
+
- lib/nydp/pair.rb
|
128
|
+
- lib/nydp/parser.rb
|
129
|
+
- lib/nydp/string_atom.rb
|
130
|
+
- lib/nydp/string_token.rb
|
131
|
+
- lib/nydp/symbol.rb
|
132
|
+
- lib/nydp/symbol_lookup.rb
|
133
|
+
- lib/nydp/tokeniser.rb
|
134
|
+
- lib/nydp/truth.rb
|
135
|
+
- lib/nydp/version.rb
|
136
|
+
- lib/nydp/vm.rb
|
137
|
+
- nydp.gemspec
|
138
|
+
- spec/boot_spec.rb
|
139
|
+
- spec/embedded_spec.rb
|
140
|
+
- spec/nypd_spec.rb
|
141
|
+
- spec/pair_spec.rb
|
142
|
+
- spec/parser_spec.rb
|
143
|
+
- spec/spec_helper.rb
|
144
|
+
- spec/symbol_spec.rb
|
145
|
+
homepage: http://github.com/conanite/nydp
|
146
|
+
licenses:
|
147
|
+
- MIT
|
148
|
+
metadata: {}
|
149
|
+
post_install_message:
|
150
|
+
rdoc_options: []
|
151
|
+
require_paths:
|
152
|
+
- lib
|
153
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
154
|
+
requirements:
|
155
|
+
- - ">="
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: '0'
|
158
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
159
|
+
requirements:
|
160
|
+
- - ">="
|
161
|
+
- !ruby/object:Gem::Version
|
162
|
+
version: '0'
|
163
|
+
requirements: []
|
164
|
+
rubyforge_project:
|
165
|
+
rubygems_version: 2.2.2
|
166
|
+
signing_key:
|
167
|
+
specification_version: 4
|
168
|
+
summary: A new lisp for a new age
|
169
|
+
test_files:
|
170
|
+
- spec/boot_spec.rb
|
171
|
+
- spec/embedded_spec.rb
|
172
|
+
- spec/nypd_spec.rb
|
173
|
+
- spec/pair_spec.rb
|
174
|
+
- spec/parser_spec.rb
|
175
|
+
- spec/spec_helper.rb
|
176
|
+
- spec/symbol_spec.rb
|