nydp 0.2.1 → 0.2.2
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.
- checksums.yaml +4 -4
- data/lib/lisp/core-012-utils.nydp +3 -4
- data/lib/lisp/core-015-documentation.nydp +11 -10
- data/lib/lisp/core-017-builtin-dox.nydp +1 -1
- data/lib/lisp/core-040-utils.nydp +34 -7
- data/lib/lisp/core-050-test-runner.nydp +2 -2
- data/lib/lisp/core-060-benchmarking.nydp +62 -8
- data/lib/lisp/core-080-pretty-print.nydp +131 -78
- data/lib/lisp/tests/boot-tests.nydp +8 -0
- data/lib/lisp/tests/intersperse-examples.nydp +57 -0
- data/lib/lisp/tests/invocation-tests.nydp +60 -10
- data/lib/lisp/tests/list-tests.nydp +14 -1
- data/lib/lisp/tests/pretty-print-tests.nydp +274 -15
- data/lib/lisp/tests/sort-examples.nydp +3 -1
- data/lib/nydp/compiler.rb +2 -1
- data/lib/nydp/context_symbol.rb +38 -43
- data/lib/nydp/function_invocation.rb +70 -0
- data/lib/nydp/lexical_context.rb +39 -59
- data/lib/nydp/lexical_context_builder.rb +84 -176
- data/lib/nydp/symbol.rb +5 -1
- data/lib/nydp/symbol_lookup.rb +2 -24
- data/lib/nydp/version.rb +1 -1
- metadata +3 -2
data/lib/nydp/symbol.rb
CHANGED
data/lib/nydp/symbol_lookup.rb
CHANGED
@@ -4,41 +4,19 @@ module Nydp
|
|
4
4
|
class SymbolLookup
|
5
5
|
extend Helper
|
6
6
|
|
7
|
-
attr_reader :expression
|
8
|
-
|
9
|
-
def initialize expression
|
10
|
-
@expression = expression
|
11
|
-
end
|
12
|
-
|
13
|
-
def execute vm
|
14
|
-
vm.push_arg expression.value vm.current_context
|
15
|
-
end
|
16
|
-
|
17
|
-
def assign value, context=nil
|
18
|
-
@expression.assign value, context
|
19
|
-
end
|
20
|
-
|
21
7
|
def self.build name, bindings
|
22
8
|
depth = 0
|
23
9
|
while Nydp::NIL.isnt? bindings
|
24
10
|
here = bindings.car
|
25
11
|
if here.key? name
|
26
12
|
binding_index = here[name]
|
27
|
-
return
|
13
|
+
return ContextSymbol.build(depth, name, binding_index)
|
28
14
|
else
|
29
15
|
depth += 1
|
30
16
|
bindings = bindings.cdr
|
31
17
|
end
|
32
18
|
end
|
33
|
-
|
34
|
-
end
|
35
|
-
|
36
|
-
def to_s
|
37
|
-
"#lookup:#{expression}:"
|
38
|
-
end
|
39
|
-
|
40
|
-
def inspect
|
41
|
-
"#lookup_symbol:#{@expression.inspect}"
|
19
|
+
name
|
42
20
|
end
|
43
21
|
end
|
44
22
|
end
|
data/lib/nydp/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nydp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Conan Dalton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -124,6 +124,7 @@ files:
|
|
124
124
|
- lib/lisp/tests/group-by-examples.nydp
|
125
125
|
- lib/lisp/tests/hash-examples.nydp
|
126
126
|
- lib/lisp/tests/include-examples.nydp
|
127
|
+
- lib/lisp/tests/intersperse-examples.nydp
|
127
128
|
- lib/lisp/tests/invocation-tests.nydp
|
128
129
|
- lib/lisp/tests/isa-examples.nydp
|
129
130
|
- lib/lisp/tests/len-examples.nydp
|