Skip to content
Browse files

Improve code loading

  • Loading branch information...
1 parent 0e91312 commit 69f47eaf0dc591025977935138d18b322c84a682 @txus committed Jan 25, 2012
Showing with 17 additions and 10 deletions.
  1. +3 −3 kernel/object.nsc
  2. +3 −3 kernel/test_case.nsc
  3. +3 −3 kernel/traits.nsc
  4. +1 −0 lib/noscript.rb
  5. +5 −0 lib/noscript/parser.rb
  6. +2 −1 lib/noscript/runtime.rb
View
6 kernel/object.nsc
@@ -1,5 +1,5 @@
!RBIX
-962095474583808978
+4133602583519257427
0
M
1
@@ -275,7 +275,7 @@ I
I
26
x
-16
-kernel/object.ns
+42
+/Users/txus/Code/noscript/kernel/object.ns
p
0
View
6 kernel/test_case.nsc
@@ -1,5 +1,5 @@
!RBIX
-962095474583808978
+4133602583519257427
0
M
1
@@ -1743,7 +1743,7 @@ I
I
a1
x
-19
-kernel/test_case.ns
+45
+/Users/txus/Code/noscript/kernel/test_case.ns
p
0
View
6 kernel/traits.nsc
@@ -1,5 +1,5 @@
!RBIX
-962095474583808978
+4133602583519257427
0
M
1
@@ -423,7 +423,7 @@ e
I
4c
x
-16
-kernel/traits.ns
+42
+/Users/txus/Code/noscript/kernel/traits.ns
p
0
View
1 lib/noscript.rb
@@ -12,6 +12,7 @@ module Noscript
require_relative 'noscript/code_loader'
CodeLoader.load_paths << File.expand_path('../noscript', __FILE__)
+ CodeLoader.load_paths << File.expand_path('../../', __FILE__)
CodeLoader.run('kernel/object')
CodeLoader.run('kernel/traits')
CodeLoader.run('kernel/test_case')
View
5 lib/noscript/parser.rb
@@ -4,9 +4,14 @@ module Noscript
class Parser
def initialize(*)
@line = 1
+ @pre_exe = []
super
end
+ def pre_exe
+ @pre_exe
+ end
+
def parse_file(filename, log = false)
parse_string(File.read(filename), filename, log)
end
View
3 lib/noscript/runtime.rb
@@ -184,6 +184,7 @@ class Runtime
end
class Function
+ attr_reader :executable
def initialize(blk_env)
@executable = blk_env.code
end
@@ -232,7 +233,7 @@ class Array
end
class Hash
- noscript_alias [:keys, :values, :length]
+ noscript_alias [:keys, :values, :length, :fetch]
noscript_def("each pair") do |*args|
fn = args.shift
each_pair do |k,v|

0 comments on commit 69f47ea

Please sign in to comment.
Something went wrong with that request. Please try again.