loxby 0.0.2 → 0.0.3
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.
- checksums.yaml +4 -4
- data/.github/workflows/gem-push.yml +2 -2
- data/.gitignore +8 -0
- data/.ruby-version +1 -0
- data/LICENSE.txt +21 -0
- data/README.md +4 -1
- data/bin/loxby +2 -2
- data/lib/loxby/config.rb +93 -0
- data/lib/loxby/core.rb +24 -14
- data/lib/loxby/helpers/ast.rb +18 -31
- data/lib/loxby/helpers/callable.rb +18 -0
- data/lib/loxby/helpers/environment.rb +18 -7
- data/lib/loxby/helpers/errors.rb +7 -1
- data/lib/loxby/helpers/functions.rb +40 -0
- data/lib/loxby/helpers/native_functions.rb +48 -0
- data/lib/loxby/helpers/token_type.rb +9 -21
- data/lib/loxby/interpreter.rb +76 -3
- data/lib/loxby/parser.rb +196 -11
- data/lib/loxby/runner.rb +13 -5
- data/lib/loxby/scanner.rb +33 -45
- data/lib/loxby/version.rb +2 -2
- data/lib/loxby/visitors/ast_printer.rb +18 -0
- data/lib/loxby/visitors/base.rb +1 -1
- data/lib/loxby/visitors/rpn_converter.rb +2 -0
- data/lib/loxby.rb +0 -0
- data/loxby.gemspec +7 -4
- metadata +13 -7
- data/.rubocop.yml +0 -8
- data/Gemfile.lock +0 -47
data/loxby.gemspec
CHANGED
|
@@ -4,28 +4,31 @@ require_relative 'lib/loxby/version'
|
|
|
4
4
|
|
|
5
5
|
Gem::Specification.new do |s|
|
|
6
6
|
s.name = 'loxby'
|
|
7
|
-
s.version =
|
|
7
|
+
s.version = Lox::VERSION
|
|
8
8
|
s.authors = ['Paul Hartman']
|
|
9
9
|
s.email = ['real.paul.hartman@gmail.com']
|
|
10
10
|
|
|
11
11
|
s.summary = 'A Lox interpreter written in Ruby'
|
|
12
12
|
s.description = 'Loxby is written following the first ' \
|
|
13
13
|
"half of Robert Nystrom's wonderful web-format book " \
|
|
14
|
-
'
|
|
14
|
+
'Crafting Interpreters (https://www.craftinginterpreters.com), ' \
|
|
15
15
|
'adapting the Java code to modern Ruby. This project is ' \
|
|
16
16
|
'intended to explore what elegant object-oriented code ' \
|
|
17
17
|
'can look like and accomplish.'
|
|
18
18
|
s.homepage = 'https://github.com/paul-c-hartman/loxby'
|
|
19
19
|
s.license = 'MIT'
|
|
20
|
-
s.required_ruby_version = Gem::Requirement.new(
|
|
20
|
+
s.required_ruby_version = Gem::Requirement.new(">= #{File.read('.ruby-version').chomp}") # Shorthand hash syntax
|
|
21
21
|
|
|
22
22
|
s.metadata['homepage_uri'] = s.homepage
|
|
23
23
|
s.metadata['source_code_uri'] = s.homepage
|
|
24
|
+
s.metadata['github_repo'] = s.homepage
|
|
24
25
|
|
|
25
26
|
# Specify which files should be added to the gem when it is released.
|
|
26
27
|
# `git ls-files -z` loads the files in the gem which git is tracking.
|
|
27
28
|
s.files = Dir.chdir(File.expand_path(__dir__)) do
|
|
28
|
-
`git ls-files -z`.split("\x0").reject {
|
|
29
|
+
`git ls-files -z`.split("\x0").reject {
|
|
30
|
+
_1.match %r{^(test|spec|features)/}
|
|
31
|
+
} - %w[Gemfile Gemfile.lock .rubocop.yml]
|
|
29
32
|
end
|
|
30
33
|
s.bindir = 'bin'
|
|
31
34
|
s.executables = %w[loxby]
|
metadata
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: loxby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Paul Hartman
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2024-
|
|
11
|
+
date: 2024-10-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Loxby is written following the first half of Robert Nystrom's wonderful
|
|
14
|
-
web-format book
|
|
14
|
+
web-format book Crafting Interpreters (https://www.craftinginterpreters.com), adapting
|
|
15
15
|
the Java code to modern Ruby. This project is intended to explore what elegant object-oriented
|
|
16
16
|
code can look like and accomplish.
|
|
17
17
|
email:
|
|
@@ -22,15 +22,20 @@ extensions: []
|
|
|
22
22
|
extra_rdoc_files: []
|
|
23
23
|
files:
|
|
24
24
|
- ".github/workflows/gem-push.yml"
|
|
25
|
-
- ".
|
|
26
|
-
-
|
|
25
|
+
- ".gitignore"
|
|
26
|
+
- ".ruby-version"
|
|
27
|
+
- LICENSE.txt
|
|
27
28
|
- README.md
|
|
28
29
|
- bin/loxby
|
|
29
30
|
- lib/loxby.rb
|
|
31
|
+
- lib/loxby/config.rb
|
|
30
32
|
- lib/loxby/core.rb
|
|
31
33
|
- lib/loxby/helpers/ast.rb
|
|
34
|
+
- lib/loxby/helpers/callable.rb
|
|
32
35
|
- lib/loxby/helpers/environment.rb
|
|
33
36
|
- lib/loxby/helpers/errors.rb
|
|
37
|
+
- lib/loxby/helpers/functions.rb
|
|
38
|
+
- lib/loxby/helpers/native_functions.rb
|
|
34
39
|
- lib/loxby/helpers/token_type.rb
|
|
35
40
|
- lib/loxby/interpreter.rb
|
|
36
41
|
- lib/loxby/parser.rb
|
|
@@ -47,6 +52,7 @@ licenses:
|
|
|
47
52
|
metadata:
|
|
48
53
|
homepage_uri: https://github.com/paul-c-hartman/loxby
|
|
49
54
|
source_code_uri: https://github.com/paul-c-hartman/loxby
|
|
55
|
+
github_repo: https://github.com/paul-c-hartman/loxby
|
|
50
56
|
post_install_message:
|
|
51
57
|
rdoc_options: []
|
|
52
58
|
require_paths:
|
|
@@ -55,14 +61,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
55
61
|
requirements:
|
|
56
62
|
- - ">="
|
|
57
63
|
- !ruby/object:Gem::Version
|
|
58
|
-
version: 3.
|
|
64
|
+
version: 3.3.5
|
|
59
65
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
60
66
|
requirements:
|
|
61
67
|
- - ">="
|
|
62
68
|
- !ruby/object:Gem::Version
|
|
63
69
|
version: '0'
|
|
64
70
|
requirements: []
|
|
65
|
-
rubygems_version: 3.
|
|
71
|
+
rubygems_version: 3.5.16
|
|
66
72
|
signing_key:
|
|
67
73
|
specification_version: 4
|
|
68
74
|
summary: A Lox interpreter written in Ruby
|
data/.rubocop.yml
DELETED
data/Gemfile.lock
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
PATH
|
|
2
|
-
remote: .
|
|
3
|
-
specs:
|
|
4
|
-
loxby (0.0.1)
|
|
5
|
-
|
|
6
|
-
GEM
|
|
7
|
-
remote: https://rubygems.org/
|
|
8
|
-
specs:
|
|
9
|
-
ast (2.4.2)
|
|
10
|
-
json (2.7.2)
|
|
11
|
-
language_server-protocol (3.17.0.3)
|
|
12
|
-
parallel (1.24.0)
|
|
13
|
-
parser (3.3.2.0)
|
|
14
|
-
ast (~> 2.4.1)
|
|
15
|
-
racc
|
|
16
|
-
racc (1.8.0)
|
|
17
|
-
rainbow (3.1.1)
|
|
18
|
-
regexp_parser (2.9.2)
|
|
19
|
-
rexml (3.2.8)
|
|
20
|
-
strscan (>= 3.0.9)
|
|
21
|
-
rubocop (1.64.1)
|
|
22
|
-
json (~> 2.3)
|
|
23
|
-
language_server-protocol (>= 3.17.0)
|
|
24
|
-
parallel (~> 1.10)
|
|
25
|
-
parser (>= 3.3.0.2)
|
|
26
|
-
rainbow (>= 2.2.2, < 4.0)
|
|
27
|
-
regexp_parser (>= 1.8, < 3.0)
|
|
28
|
-
rexml (>= 3.2.5, < 4.0)
|
|
29
|
-
rubocop-ast (>= 1.31.1, < 2.0)
|
|
30
|
-
ruby-progressbar (~> 1.7)
|
|
31
|
-
unicode-display_width (>= 2.4.0, < 3.0)
|
|
32
|
-
rubocop-ast (1.31.3)
|
|
33
|
-
parser (>= 3.3.1.0)
|
|
34
|
-
ruby-progressbar (1.13.0)
|
|
35
|
-
strscan (3.1.0)
|
|
36
|
-
unicode-display_width (2.5.0)
|
|
37
|
-
|
|
38
|
-
PLATFORMS
|
|
39
|
-
x64-mingw-ucrt
|
|
40
|
-
|
|
41
|
-
DEPENDENCIES
|
|
42
|
-
loxby!
|
|
43
|
-
rubocop
|
|
44
|
-
strscan
|
|
45
|
-
|
|
46
|
-
BUNDLED WITH
|
|
47
|
-
2.5.10
|