forthic 0.1.0 → 0.2.4

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.
@@ -1,7 +1,7 @@
1
1
  # # frozen_string_literal: true
2
2
 
3
- require_relative 'word'
4
- require_relative '../token'
3
+ require_relative "word"
4
+ require_relative "../token"
5
5
 
6
6
  module Forthic
7
7
  class EndArrayWord < Word
@@ -25,4 +25,4 @@ module Forthic
25
25
  interp.stack_push(items)
26
26
  end
27
27
  end
28
- end
28
+ end
@@ -1,6 +1,6 @@
1
1
  # # frozen_string_literal: true
2
2
 
3
- require_relative 'word'
3
+ require_relative "word"
4
4
 
5
5
  module Forthic
6
6
  class EndModuleWord < Word
@@ -13,4 +13,4 @@ module Forthic
13
13
  interp.module_stack_pop
14
14
  end
15
15
  end
16
- end
16
+ end
@@ -1,7 +1,7 @@
1
1
  # # frozen_string_literal: true
2
2
 
3
- require_relative 'word'
4
- require_relative 'module_word'
3
+ require_relative "word"
4
+ require_relative "module_word"
5
5
 
6
6
  module Forthic
7
7
  class ImportedWord < Word
@@ -24,4 +24,4 @@ module Forthic
24
24
  interp.module_stack_pop
25
25
  end
26
26
  end
27
- end
27
+ end
@@ -157,13 +157,13 @@ module Forthic
157
157
 
158
158
  errors = []
159
159
  result = if items.is_a?(Array)
160
- descend_list.call(items, @depth, [], errors)
161
- else
162
- descend_record.call(items, @depth, {}, errors)
163
- end
160
+ descend_list.call(items, @depth, [], errors)
161
+ else
162
+ descend_record.call(items, @depth, {}, errors)
163
+ end
164
164
  @result = result
165
165
  @errors = errors
166
166
  [result, errors]
167
167
  end
168
168
  end
169
- end
169
+ end
@@ -1,7 +1,7 @@
1
1
  # # frozen_string_literal: true
2
2
 
3
- require_relative 'word'
4
- require_relative 'module_memo_word'
3
+ require_relative "word"
4
+ require_relative "module_memo_word"
5
5
 
6
6
  module Forthic
7
7
  class ModuleMemoBangAtWord < Word
@@ -19,4 +19,4 @@ module Forthic
19
19
  interp.stack_push(@memo_word.value)
20
20
  end
21
21
  end
22
- end
22
+ end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'word'
4
- require_relative 'module_memo_word'
3
+ require_relative "word"
4
+ require_relative "module_memo_word"
5
5
 
6
6
  module Forthic
7
7
  class ModuleMemoBangWord < Word
@@ -18,4 +18,4 @@ module Forthic
18
18
  @memo_word.refresh(interp)
19
19
  end
20
20
  end
21
- end
21
+ end
@@ -1,6 +1,6 @@
1
1
  # # frozen_string_literal: true
2
2
 
3
- require_relative 'word'
3
+ require_relative "word"
4
4
 
5
5
  module Forthic
6
6
  class ModuleMemoWord < Word
@@ -32,4 +32,4 @@ module Forthic
32
32
  @value = nil
33
33
  end
34
34
  end
35
- end
35
+ end
@@ -1,6 +1,6 @@
1
- # # frozen_string_literal: true
1
+ # frozen_string_literal: true
2
2
 
3
- require_relative 'word'
3
+ require_relative "word"
4
4
 
5
5
  module Forthic
6
6
  class ModuleWord < Word
@@ -18,4 +18,4 @@ module Forthic
18
18
  @handler.call(interp)
19
19
  end
20
20
  end
21
- end
21
+ end
@@ -1,6 +1,6 @@
1
- # # frozen_string_literal: true
1
+ # frozen_string_literal: true
2
2
 
3
- require_relative 'word'
3
+ require_relative "word"
4
4
 
5
5
  module Forthic
6
6
  class PushValueWord < Word
@@ -18,4 +18,4 @@ module Forthic
18
18
  interp.stack_push(@value)
19
19
  end
20
20
  end
21
- end
21
+ end
@@ -1,23 +1,23 @@
1
1
  # # frozen_string_literal: true
2
2
 
3
- require_relative 'word'
4
- require_relative '../forthic_module'
3
+ require_relative "word"
4
+ require_relative "../forthic_module"
5
5
 
6
6
  module Forthic
7
7
  class StartModuleWord < Word
8
8
  # @param [Interpreter] interp
9
9
  def execute(interp)
10
10
  # The app module is the only module with a blank name
11
- if self.name == ""
11
+ if name == ""
12
12
  interp.module_stack_push(interp.get_app_module)
13
13
  return
14
14
  end
15
15
 
16
16
  # If the module is used by the current module, push it onto the stack, otherwise
17
17
  # create a new module.
18
- mod = interp.cur_module.find_module(self.name)
18
+ mod = interp.cur_module.find_module(name)
19
19
  unless mod
20
- mod = ForthicModule.new(self.name)
20
+ mod = ForthicModule.new(name)
21
21
  interp.cur_module.register_module(mod.name, mod.name, mod)
22
22
 
23
23
  # If we're at the app module, also register with interpreter
@@ -28,4 +28,4 @@ module Forthic
28
28
  interp.module_stack_push(mod)
29
29
  end
30
30
  end
31
- end
31
+ end
@@ -27,4 +27,4 @@ module Forthic
27
27
  raise "Must override Word.execute"
28
28
  end
29
29
  end
30
- end
30
+ end
data/lib/forthic.rb CHANGED
@@ -3,23 +3,27 @@
3
3
  require_relative "forthic/version"
4
4
 
5
5
  module Forthic
6
- autoload :Tokenizer, 'forthic/tokenizer'
7
- autoload :CodeLocation, 'forthic/code_location'
8
- autoload :Token, 'forthic/token'
9
- autoload :PositionedString, 'forthic/positioned_string'
10
- autoload :ForthicError, 'forthic/forthic_error'
11
- autoload :Word, 'forthic/words/word'
12
- autoload :PushValueWord, 'forthic/words/push_value_word'
13
- autoload :DefinitionWord, 'forthic/words/definition_word'
14
- autoload :ModuleMemoWord, 'forthic/words/module_memo_word'
15
- autoload :ModuleMemoBangAtWord, 'forthic/words/module_memo_bang_at_word'
16
- autoload :ModuleMemoBangWord, 'forthic/words/module_memo_bang_word'
17
- autoload :ModuleMemoBangAtWord, 'forthic/words/module_memo_bang_at_word'
18
- autoload :EndArrayWord, 'forthic/words/end_array_word'
19
- autoload :StartModuleWord, 'forthic/words/start_module_word'
20
- autoload :EndModuleWord, 'forthic/words/end_module_word'
21
- autoload :MapWord, 'forthic/words/map_word'
22
- autoload :ForthicModule, 'forthic/forthic_module'
23
- autoload :GlobalModule, 'forthic/global_module'
24
- autoload :Interpreter, 'forthic/interpreter'
6
+ autoload :Tokenizer, "forthic/tokenizer"
7
+ autoload :CodeLocation, "forthic/code_location"
8
+ autoload :Token, "forthic/token"
9
+ autoload :PositionedString, "forthic/positioned_string"
10
+ autoload :ForthicError, "forthic/forthic_error"
11
+
12
+ module Errors
13
+ autoload :UnknownWordError, "forthic/errors/unknown_word_error"
14
+ end
15
+ autoload :Word, "forthic/words/word"
16
+ autoload :PushValueWord, "forthic/words/push_value_word"
17
+ autoload :DefinitionWord, "forthic/words/definition_word"
18
+ autoload :ModuleMemoWord, "forthic/words/module_memo_word"
19
+ autoload :ModuleMemoBangAtWord, "forthic/words/module_memo_bang_at_word"
20
+ autoload :ModuleMemoBangWord, "forthic/words/module_memo_bang_word"
21
+ autoload :ModuleMemoBangAtWord, "forthic/words/module_memo_bang_at_word"
22
+ autoload :EndArrayWord, "forthic/words/end_array_word"
23
+ autoload :StartModuleWord, "forthic/words/start_module_word"
24
+ autoload :EndModuleWord, "forthic/words/end_module_word"
25
+ autoload :MapWord, "forthic/words/map_word"
26
+ autoload :ForthicModule, "forthic/forthic_module"
27
+ autoload :GlobalModule, "forthic/global_module"
28
+ autoload :Interpreter, "forthic/interpreter"
25
29
  end
metadata CHANGED
@@ -1,17 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forthic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rino Jose
8
+ autorequire:
8
9
  bindir: exe
9
10
  cert_chain: []
10
- date: 2025-01-02 00:00:00.000000000 Z
11
+ date: 2026-01-01 00:00:00.000000000 Z
11
12
  dependencies: []
12
- description: This package provides a Forthic interpreter that allows you to execute
13
- Forthic code within your Ruby projects. Forthic is a stack-based programming language
14
- inspired by Forth.
13
+ description: "[ARCHIVED] This package provides a Forthic interpreter that allows you
14
+ to execute Forthic code within your Ruby projects. Forthic is a stack-based programming
15
+ language inspired by Forth. This gem is from an archived repository. Please see
16
+ https://github.com/forthix/forthic-rb for the new official repository."
15
17
  email:
16
18
  - rjose@forthix.com
17
19
  executables: []
@@ -20,11 +22,13 @@ extra_rdoc_files: []
20
22
  files:
21
23
  - ".standard.yml"
22
24
  - CHANGELOG.md
25
+ - CLAUDE.md
23
26
  - Guardfile
24
27
  - README.md
25
28
  - Rakefile
26
29
  - lib/forthic.rb
27
30
  - lib/forthic/code_location.rb
31
+ - lib/forthic/errors/unknown_word_error.rb
28
32
  - lib/forthic/forthic_error.rb
29
33
  - lib/forthic/forthic_module.rb
30
34
  - lib/forthic/global_module.rb
@@ -47,11 +51,16 @@ files:
47
51
  - lib/forthic/words/start_module_word.rb
48
52
  - lib/forthic/words/word.rb
49
53
  - sig/forthic.rbs
50
- homepage: https://github.com/linkedin/forthic
54
+ homepage: https://github.com/forthix/forthic-rb
51
55
  licenses: []
52
56
  metadata:
53
- homepage_uri: https://github.com/linkedin/forthic
54
- source_code_uri: https://github.com/linkedin/forthic
57
+ homepage_uri: https://github.com/forthix/forthic-rb
58
+ source_code_uri: https://github.com/forthix/forthic-rb
59
+ post_install_message: |
60
+ ⚠️ NOTICE: This gem is from an archived repository.
61
+
62
+ The Forthic project has moved to: https://github.com/forthix/forthic-rb
63
+ Please visit the new repository for updates and support.
55
64
  rdoc_options: []
56
65
  require_paths:
57
66
  - lib
@@ -66,7 +75,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
66
75
  - !ruby/object:Gem::Version
67
76
  version: '0'
68
77
  requirements: []
69
- rubygems_version: 3.6.2
78
+ rubygems_version: 3.3.26
79
+ signing_key:
70
80
  specification_version: 4
71
- summary: A Forthic interpreter that runs within Ruby.
81
+ summary: "[ARCHIVED] A Forthic interpreter that runs within Ruby - See https://github.com/forthix/forthic-rb"
72
82
  test_files: []