fOOrth 0.6.5 → 0.6.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c3e8b4a5ccbb3c56347525737ec50f95a1016e19
4
- data.tar.gz: 9bdb8b038c70895ddb82722ff0deeed11c3bdf47
3
+ metadata.gz: b78d9f4016b73209d62eaf5c8d01497f64b65582
4
+ data.tar.gz: 98ec2f26ae3bf20ea9a65d120ecb0d9bc6b2f88c
5
5
  SHA512:
6
- metadata.gz: 8fe86ae93e915c05e9702fd3996d96a258cd0c5e164292eb2c9a1776a576a2c2878fd59c640bdae12e0543689cf3854b2a24076e2c2b8534b6cc4e6180d56241
7
- data.tar.gz: 04f4a12816c42a8b698a2f7c43055d7ba3ce3151dee06103f1d17826cc9182355f66240a3d8390b6939376dcd193abad00a4271507d7bcf2b5cac7b2f1fa0d18
6
+ metadata.gz: f04893f0850026b62865f1087298d8f8ad1a621da78d097a96106adcba71f00ba14abe1968992bcdda57ef14ed6a0bfc4969d9f3b291793b55618d0b7cad0e09
7
+ data.tar.gz: 0f17fc2d2d9dd61a37e6b3be5440346a18af935d591d261ef53a3d7b2eb9e94ef29460bf6b40babe243d39efb4139dc63bd97081cb098bac012a04ac03869dc6
@@ -22,6 +22,16 @@ class DataRefLibraryTester < Minitest::Test
22
22
 
23
23
  foorth_equal('10 val#: #test2', [])
24
24
  foorth_equal('#test2', [10])
25
+
26
+ foorth_run(': test_tv3 42 val#: #ttv3 ; ')
27
+ foorth_equal('#ttv3', [nil])
28
+ foorth_run('test_tv3')
29
+ foorth_equal('#ttv3', [42])
30
+
31
+ foorth_run(': test_tv5 42 var#: #ttv5 ; ')
32
+ foorth_raises('#ttv5 #')
33
+ foorth_run('test_tv5')
34
+ foorth_equal('#ttv5 @', [42])
25
35
  end
26
36
 
27
37
  def test_thread_vars_some_more
@@ -39,6 +49,16 @@ class DataRefLibraryTester < Minitest::Test
39
49
 
40
50
  foorth_equal('10 val$: $test2', [])
41
51
  foorth_equal('$test2', [10])
52
+
53
+ foorth_run(': test_gv4 69 val$: $tgv4 ; ')
54
+ foorth_equal('$tgv4', [nil])
55
+ foorth_run('test_gv4')
56
+ foorth_equal('$tgv4', [69])
57
+
58
+ foorth_run(': test_gv6 69 var$: $tgv6 ; ')
59
+ foorth_raises('$tgv6 @')
60
+ foorth_run('test_gv6')
61
+ foorth_equal('$tgv6 @', [69])
42
62
  end
43
63
 
44
64
  def test_shared_instance_variables
@@ -4,8 +4,6 @@
4
4
  module XfOOrth
5
5
 
6
6
  #* debug/display_abort.rb - Display diagnostic information on an error.
7
- #<br>Endemic Code Smells
8
- #* :reek:TooManyStatements
9
7
  class VirtualMachine
10
8
 
11
9
  #Display the diagnostic data required for a language abort error.
@@ -31,45 +31,41 @@ module XfOOrth
31
31
 
32
32
  # Thread Variables
33
33
  # [n] var#: #tv [], Thread.current[#tv] = [n]
34
- VirtualMachine.create_shared_method('var#:', VmSpec, [], &lambda {|vm|
34
+ VirtualMachine.create_shared_method('var#:', VmSpec, [:immediate], &lambda {|vm|
35
35
  name = vm.parser.get_word()
36
36
  error "F10: Invalid var name #{name}" unless /^#[a-z][a-z0-9_]*$/ =~ name
37
37
  symbol = XfOOrth::SymbolMap.add_entry(name)
38
- @data[symbol] = [vm.pop]
39
-
38
+ process_text("vm.data[#{symbol.inspect}] = [vm.pop]; ")
40
39
  vm.create_exclusive_method(name, ThreadVarSpec, [])
41
40
  })
42
41
 
43
42
  # Thread values.
44
43
  # [n] val#: #tv [], Thread.current[#tv] = n
45
- VirtualMachine.create_shared_method('val#:', VmSpec, [], &lambda {|vm|
44
+ VirtualMachine.create_shared_method('val#:', VmSpec, [:immediate], &lambda {|vm|
46
45
  name = vm.parser.get_word()
47
46
  error "F10: Invalid val name #{name}" unless /^#[a-z][a-z0-9_]*$/ =~ name
48
47
  symbol = XfOOrth::SymbolMap.add_entry(name)
49
- @data[symbol] = vm.pop
50
-
48
+ process_text("vm.data[#{symbol.inspect}] = vm.pop; ")
51
49
  vm.create_exclusive_method(name, ThreadVarSpec, [])
52
50
  })
53
51
 
54
52
  # Global Variables
55
53
  # [n] var$: $gv [], $gv = [n]
56
- VirtualMachine.create_shared_method('var$:', VmSpec, [], &lambda {|vm|
54
+ VirtualMachine.create_shared_method('var$:', VmSpec, [:immediate], &lambda {|vm|
57
55
  name = vm.parser.get_word()
58
56
  error "F10: Invalid var name #{name}" unless /^\$[a-z][a-z0-9_]*$/ =~ name
59
57
  symbol = XfOOrth::SymbolMap.add_entry(name)
60
- eval "#{'$' + symbol.to_s} = [vm.pop]"
61
-
58
+ process_text("#{'$' + symbol.to_s} = [vm.pop]; ")
62
59
  $FOORTH_GLOBALS[symbol] = GlobalVarSpec.new(name, symbol, [])
63
60
  })
64
61
 
65
62
  # Global Values
66
63
  # [n] val$: $gv [], $gv = n
67
- VirtualMachine.create_shared_method('val$:', VmSpec, [], &lambda {|vm|
64
+ VirtualMachine.create_shared_method('val$:', VmSpec, [:immediate], &lambda {|vm|
68
65
  name = vm.parser.get_word()
69
66
  error "F10: Invalid val name #{name}" unless /^\$[a-z][a-z0-9_]*$/ =~ name
70
67
  symbol = XfOOrth::SymbolMap.add_entry(name)
71
- eval "#{'$' + symbol.to_s} = vm.pop"
72
-
68
+ process_text("#{'$' + symbol.to_s} = vm.pop; ")
73
69
  $FOORTH_GLOBALS[symbol] = GlobalVarSpec.new(name, symbol, [])
74
70
  })
75
71
 
@@ -3,5 +3,5 @@
3
3
  #* version.rb - The version string for fOOrth.
4
4
  module XfOOrth
5
5
  #The version string for fOOrth.
6
- VERSION = "0.6.5"
6
+ VERSION = "0.6.6"
7
7
  end
data/reek.txt CHANGED
@@ -1 +1,59 @@
1
- 0 total warnings
1
+ lib/fOOrth/compiler/context/map_name.rb -- 1 warning:
2
+ [31]:ControlParameter: XfOOrth::Context#do_map_name is controlled by argument allow_defaults [https://github.com/troessner/reek/blob/master/docs/Control-Parameter.md]
3
+ lib/fOOrth/library/compile_library.rb -- 2 warnings:
4
+ [230]:ControlParameter: XfOOrth#self.name_to_type is controlled by argument cast_spec [https://github.com/troessner/reek/blob/master/docs/Control-Parameter.md]
5
+ [191]:TooManyStatements: XfOOrth#self.add_common_compiler_locals has approx 8 statements [https://github.com/troessner/reek/blob/master/docs/Too-Many-Statements.md]
6
+ lib/fOOrth/library/formatting/bullets.rb -- 10 warnings:
7
+ [20, 22]:DuplicateMethodCall: XfOOrth::BulletPoints#add calls raw_bullet.in_array 2 times [https://github.com/troessner/reek/blob/master/docs/Duplicate-Method-Call.md]
8
+ [62, 68]:DuplicateMethodCall: XfOOrth::BulletPoints#render_bullet calls ' ' * @key_length 2 times [https://github.com/troessner/reek/blob/master/docs/Duplicate-Method-Call.md]
9
+ [67, 76]:DuplicateMethodCall: XfOOrth::BulletPoints#render_bullet calls result << temp 2 times [https://github.com/troessner/reek/blob/master/docs/Duplicate-Method-Call.md]
10
+ [63, 69]:DuplicateMethodCall: XfOOrth::BulletPoints#render_bullet calls temp.length 2 times [https://github.com/troessner/reek/blob/master/docs/Duplicate-Method-Call.md]
11
+ [26, 27]:FeatureEnvy: XfOOrth::BulletPoints#add refers to items more than self (maybe move it to another class?) [https://github.com/troessner/reek/blob/master/docs/Feature-Envy.md]
12
+ [20, 22]:FeatureEnvy: XfOOrth::BulletPoints#add refers to raw_bullet more than self (maybe move it to another class?) [https://github.com/troessner/reek/blob/master/docs/Feature-Envy.md]
13
+ [18, 23]:FeatureEnvy: XfOOrth::BulletPoints#add refers to raw_item more than self (maybe move it to another class?) [https://github.com/troessner/reek/blob/master/docs/Feature-Envy.md]
14
+ [83]:IrresponsibleModule: Array has no descriptive comment [https://github.com/troessner/reek/blob/master/docs/Irresponsible-Module.md]
15
+ [103]:IrresponsibleModule: Hash has no descriptive comment [https://github.com/troessner/reek/blob/master/docs/Irresponsible-Module.md]
16
+ [51]:TooManyStatements: XfOOrth::BulletPoints#render_bullet has approx 15 statements [https://github.com/troessner/reek/blob/master/docs/Too-Many-Statements.md]
17
+ lib/fOOrth/library/formatting/columns.rb -- 2 warnings:
18
+ [36]:NestedIterators: XfOOrth::ColumnizedPage#render contains iterators nested 2 deep [https://github.com/troessner/reek/blob/master/docs/Nested-Iterators.md]
19
+ [31]:TooManyStatements: XfOOrth::ColumnizedPage#render has approx 8 statements [https://github.com/troessner/reek/blob/master/docs/Too-Many-Statements.md]
20
+ lib/fOOrth/library/introspection/class.rb -- 15 warnings:
21
+ [35, 42]:DuplicateMethodCall: Class#foorth_method_info calls !spec.has_tag?(:stub) 2 times [https://github.com/troessner/reek/blob/master/docs/Duplicate-Method-Call.md]
22
+ [36, 43]:DuplicateMethodCall: Class#foorth_method_info calls (results << ["", ""]).concat(info) 2 times [https://github.com/troessner/reek/blob/master/docs/Duplicate-Method-Call.md]
23
+ [36, 43]:DuplicateMethodCall: Class#foorth_method_info calls (results << ["", ""]).concat(info).concat(spec.get_info) 2 times [https://github.com/troessner/reek/blob/master/docs/Duplicate-Method-Call.md]
24
+ [36, 43]:DuplicateMethodCall: Class#foorth_method_info calls results << ["", ""] 2 times [https://github.com/troessner/reek/blob/master/docs/Duplicate-Method-Call.md]
25
+ [36, 43]:DuplicateMethodCall: Class#foorth_method_info calls spec.get_info 2 times [https://github.com/troessner/reek/blob/master/docs/Duplicate-Method-Call.md]
26
+ [35, 42]:DuplicateMethodCall: Class#foorth_method_info calls spec.has_tag?(:stub) 2 times [https://github.com/troessner/reek/blob/master/docs/Duplicate-Method-Call.md]
27
+ [62, 74]:DuplicateMethodCall: Class#get_info calls (results << ["", ""]).concat(info) 2 times [https://github.com/troessner/reek/blob/master/docs/Duplicate-Method-Call.md]
28
+ [61, 73]:DuplicateMethodCall: Class#get_info calls XfOOrth::SymbolMap.map_info(name) 2 times [https://github.com/troessner/reek/blob/master/docs/Duplicate-Method-Call.md]
29
+ [62, 74]:DuplicateMethodCall: Class#get_info calls results << ["", ""] 2 times [https://github.com/troessner/reek/blob/master/docs/Duplicate-Method-Call.md]
30
+ [65, 77]:DuplicateMethodCall: Class#get_info calls results.concat(info) 2 times [https://github.com/troessner/reek/blob/master/docs/Duplicate-Method-Call.md]
31
+ [65, 77]:DuplicateMethodCall: Class#get_info calls results.concat(info).concat(spec.get_info) 2 times [https://github.com/troessner/reek/blob/master/docs/Duplicate-Method-Call.md]
32
+ [65, 77]:DuplicateMethodCall: Class#get_info calls spec.get_info 2 times [https://github.com/troessner/reek/blob/master/docs/Duplicate-Method-Call.md]
33
+ [35, 36, 42, 43]:FeatureEnvy: Class#foorth_method_info refers to spec more than self (maybe move it to another class?) [https://github.com/troessner/reek/blob/master/docs/Feature-Envy.md]
34
+ [28]:TooManyStatements: Class#foorth_method_info has approx 10 statements [https://github.com/troessner/reek/blob/master/docs/Too-Many-Statements.md]
35
+ [54]:TooManyStatements: Class#get_info has approx 14 statements [https://github.com/troessner/reek/blob/master/docs/Too-Many-Statements.md]
36
+ lib/fOOrth/library/introspection/context.rb -- 3 warnings:
37
+ [14, 28]:DuplicateMethodCall: XfOOrth::Context#get_info calls results << ["", ""] 2 times [https://github.com/troessner/reek/blob/master/docs/Duplicate-Method-Call.md]
38
+ [14, 17, 18, 19, 21, 22, 28, 29]:FeatureEnvy: XfOOrth::Context#get_info refers to results more than self (maybe move it to another class?) [https://github.com/troessner/reek/blob/master/docs/Feature-Envy.md]
39
+ [10]:TooManyStatements: XfOOrth::Context#get_info has approx 11 statements [https://github.com/troessner/reek/blob/master/docs/Too-Many-Statements.md]
40
+ lib/fOOrth/library/introspection/object.rb -- 3 warnings:
41
+ [53, 57]:FeatureEnvy: Object#foorth_method_info refers to results more than self (maybe move it to another class?) [https://github.com/troessner/reek/blob/master/docs/Feature-Envy.md]
42
+ [52, 53]:FeatureEnvy: Object#foorth_method_info refers to spec more than self (maybe move it to another class?) [https://github.com/troessner/reek/blob/master/docs/Feature-Envy.md]
43
+ [18]:TooManyStatements: Object#get_info has approx 12 statements [https://github.com/troessner/reek/blob/master/docs/Too-Many-Statements.md]
44
+ lib/fOOrth/library/introspection/string.rb -- 10 warnings:
45
+ [17, 20]:DuplicateMethodCall: String#foorth_method_scan calls (results << ["", ""]).concat(info) 2 times [https://github.com/troessner/reek/blob/master/docs/Duplicate-Method-Call.md]
46
+ [17, 20]:DuplicateMethodCall: String#foorth_method_scan calls (results << ["", ""]).concat(info).concat(spec.get_info) 2 times [https://github.com/troessner/reek/blob/master/docs/Duplicate-Method-Call.md]
47
+ [17, 20]:DuplicateMethodCall: String#foorth_method_scan calls results << ["", ""] 2 times [https://github.com/troessner/reek/blob/master/docs/Duplicate-Method-Call.md]
48
+ [17, 20]:DuplicateMethodCall: String#foorth_method_scan calls spec.get_info 2 times [https://github.com/troessner/reek/blob/master/docs/Duplicate-Method-Call.md]
49
+ [17, 20, 23]:FeatureEnvy: String#foorth_method_scan refers to found more than self (maybe move it to another class?) [https://github.com/troessner/reek/blob/master/docs/Feature-Envy.md]
50
+ [17, 20, 23]:FeatureEnvy: String#foorth_method_scan refers to results more than self (maybe move it to another class?) [https://github.com/troessner/reek/blob/master/docs/Feature-Envy.md]
51
+ [13, 17, 20]:FeatureEnvy: String#foorth_method_scan refers to spec more than self (maybe move it to another class?) [https://github.com/troessner/reek/blob/master/docs/Feature-Envy.md]
52
+ [7]:TooManyStatements: String#foorth_method_scan has approx 12 statements [https://github.com/troessner/reek/blob/master/docs/Too-Many-Statements.md]
53
+ [14]:UncommunicativeVariableName: String#foorth_method_scan has the variable name 'a' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Variable-Name.md]
54
+ [14]:UncommunicativeVariableName: String#foorth_method_scan has the variable name 'b' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Variable-Name.md]
55
+ lib/fOOrth/library/introspection/vm.rb -- 3 warnings:
56
+ [10]:TooManyStatements: XfOOrth::VirtualMachine#get_info has approx 22 statements [https://github.com/troessner/reek/blob/master/docs/Too-Many-Statements.md]
57
+ [47]:UncommunicativeVariableName: XfOOrth::VirtualMachine#get_info has the variable name 'a' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Variable-Name.md]
58
+ [47]:UncommunicativeVariableName: XfOOrth::VirtualMachine#get_info has the variable name 'b' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Variable-Name.md]
59
+ 49 total warnings
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fOOrth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.5
4
+ version: 0.6.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Camilleri
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-14 00:00:00.000000000 Z
11
+ date: 2016-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler