Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Improve code loading

  • Loading branch information...
commit 69f47eaf0dc591025977935138d18b322c84a682 1 parent 0e91312
Josep M. Bach authored
6 kernel/object.nsc
... ... @@ -1,5 +1,5 @@
1 1 !RBIX
2   -962095474583808978
  2 +4133602583519257427
3 3 0
4 4 M
5 5 1
@@ -275,7 +275,7 @@ I
275 275 I
276 276 26
277 277 x
278   -16
279   -kernel/object.ns
  278 +42
  279 +/Users/txus/Code/noscript/kernel/object.ns
280 280 p
281 281 0
6 kernel/test_case.nsc
... ... @@ -1,5 +1,5 @@
1 1 !RBIX
2   -962095474583808978
  2 +4133602583519257427
3 3 0
4 4 M
5 5 1
@@ -1743,7 +1743,7 @@ I
1743 1743 I
1744 1744 a1
1745 1745 x
1746   -19
1747   -kernel/test_case.ns
  1746 +45
  1747 +/Users/txus/Code/noscript/kernel/test_case.ns
1748 1748 p
1749 1749 0
6 kernel/traits.nsc
... ... @@ -1,5 +1,5 @@
1 1 !RBIX
2   -962095474583808978
  2 +4133602583519257427
3 3 0
4 4 M
5 5 1
@@ -423,7 +423,7 @@ e
423 423 I
424 424 4c
425 425 x
426   -16
427   -kernel/traits.ns
  426 +42
  427 +/Users/txus/Code/noscript/kernel/traits.ns
428 428 p
429 429 0
1  lib/noscript.rb
@@ -12,6 +12,7 @@ module Noscript
12 12 require_relative 'noscript/code_loader'
13 13
14 14 CodeLoader.load_paths << File.expand_path('../noscript', __FILE__)
  15 + CodeLoader.load_paths << File.expand_path('../../', __FILE__)
15 16 CodeLoader.run('kernel/object')
16 17 CodeLoader.run('kernel/traits')
17 18 CodeLoader.run('kernel/test_case')
5 lib/noscript/parser.rb
@@ -4,9 +4,14 @@ module Noscript
4 4 class Parser
5 5 def initialize(*)
6 6 @line = 1
  7 + @pre_exe = []
7 8 super
8 9 end
9 10
  11 + def pre_exe
  12 + @pre_exe
  13 + end
  14 +
10 15 def parse_file(filename, log = false)
11 16 parse_string(File.read(filename), filename, log)
12 17 end
3  lib/noscript/runtime.rb
@@ -184,6 +184,7 @@ class Runtime
184 184 end
185 185
186 186 class Function
  187 + attr_reader :executable
187 188 def initialize(blk_env)
188 189 @executable = blk_env.code
189 190 end
@@ -232,7 +233,7 @@ class Array
232 233 end
233 234
234 235 class Hash
235   - noscript_alias [:keys, :values, :length]
  236 + noscript_alias [:keys, :values, :length, :fetch]
236 237 noscript_def("each pair") do |*args|
237 238 fn = args.shift
238 239 each_pair do |k,v|

0 comments on commit 69f47ea

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