forthic 0.1.0 → 0.2.0

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 '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,23 @@
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
+ 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"
25
25
  end
metadata CHANGED
@@ -1,13 +1,14 @@
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.0
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: 2025-07-13 00:00:00.000000000 Z
11
12
  dependencies: []
12
13
  description: This package provides a Forthic interpreter that allows you to execute
13
14
  Forthic code within your Ruby projects. Forthic is a stack-based programming language
@@ -20,6 +21,7 @@ extra_rdoc_files: []
20
21
  files:
21
22
  - ".standard.yml"
22
23
  - CHANGELOG.md
24
+ - CLAUDE.md
23
25
  - Guardfile
24
26
  - README.md
25
27
  - Rakefile
@@ -52,6 +54,7 @@ licenses: []
52
54
  metadata:
53
55
  homepage_uri: https://github.com/linkedin/forthic
54
56
  source_code_uri: https://github.com/linkedin/forthic
57
+ post_install_message:
55
58
  rdoc_options: []
56
59
  require_paths:
57
60
  - lib
@@ -66,7 +69,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
66
69
  - !ruby/object:Gem::Version
67
70
  version: '0'
68
71
  requirements: []
69
- rubygems_version: 3.6.2
72
+ rubygems_version: 3.3.26
73
+ signing_key:
70
74
  specification_version: 4
71
75
  summary: A Forthic interpreter that runs within Ruby.
72
76
  test_files: []