rubasteme 0.1.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.
- checksums.yaml +7 -0
- data/.github/workflows/main.yml +18 -0
- data/.gitignore +57 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile +10 -0
- data/LICENSE +21 -0
- data/README.md +136 -0
- data/Rakefile +20 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/examples/mini_rus3 +193 -0
- data/examples/mini_sicp_scheme +62 -0
- data/examples/sicp_scheme/environment.rb +103 -0
- data/examples/sicp_scheme/error.rb +5 -0
- data/examples/sicp_scheme/evaluator.rb +312 -0
- data/examples/sicp_scheme/primitives.rb +123 -0
- data/examples/sicp_scheme/printer.rb +12 -0
- data/exe/rubasteme +88 -0
- data/lib/rubasteme.rb +16 -0
- data/lib/rubasteme/ast.rb +93 -0
- data/lib/rubasteme/ast/branch_node.rb +514 -0
- data/lib/rubasteme/ast/leaf_node.rb +62 -0
- data/lib/rubasteme/error.rb +50 -0
- data/lib/rubasteme/parser.rb +608 -0
- data/lib/rubasteme/utils.rb +14 -0
- data/lib/rubasteme/version.rb +6 -0
- data/rubasteme.gemspec +31 -0
- metadata +88 -0
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Rubasteme
|
4
|
+
module Utils
|
5
|
+
def self.camel_case(snake_case)
|
6
|
+
snake_case.to_s.split("_").map(&:capitalize).join("")
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.snake_case(camel_case)
|
10
|
+
camel_case.gsub(/([a-z])([A-Z])/, '\1_\2').downcase
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
data/rubasteme.gemspec
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "lib/rubasteme/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "rubasteme"
|
7
|
+
spec.version = Rubasteme::VERSION
|
8
|
+
spec.authors = ["mnbi"]
|
9
|
+
spec.email = ["mnbi@users.noreply.github.com"]
|
10
|
+
|
11
|
+
spec.summary = "Simple Abstract Syntax Tree for Scheme written in Ruby"
|
12
|
+
spec.description = "Simple Abstract Syntax Tree and a parser for Scheme, which is intended to be a part of a Scheme implementation written in Ruby."
|
13
|
+
spec.homepage = "https://github.com/mnbi/rubasteme"
|
14
|
+
spec.license = "MIT"
|
15
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
|
16
|
+
|
17
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
18
|
+
spec.metadata["source_code_uri"] = "https://github.com/mnbi/rubasteme"
|
19
|
+
spec.metadata["changelog_uri"] = "https://github.com/mnbi/rubasteme/blob/main/CHANGELOG.md"
|
20
|
+
|
21
|
+
# Specify which files should be added to the gem when it is released.
|
22
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
23
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
24
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
|
25
|
+
end
|
26
|
+
spec.bindir = "exe"
|
27
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
28
|
+
spec.require_paths = ["lib"]
|
29
|
+
|
30
|
+
spec.add_dependency "rbscmlex", ">= 0.1.3"
|
31
|
+
end
|
metadata
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rubasteme
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- mnbi
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2021-05-20 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rbscmlex
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.1.3
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.1.3
|
27
|
+
description: Simple Abstract Syntax Tree and a parser for Scheme, which is intended
|
28
|
+
to be a part of a Scheme implementation written in Ruby.
|
29
|
+
email:
|
30
|
+
- mnbi@users.noreply.github.com
|
31
|
+
executables:
|
32
|
+
- rubasteme
|
33
|
+
extensions: []
|
34
|
+
extra_rdoc_files: []
|
35
|
+
files:
|
36
|
+
- ".github/workflows/main.yml"
|
37
|
+
- ".gitignore"
|
38
|
+
- CHANGELOG.md
|
39
|
+
- Gemfile
|
40
|
+
- LICENSE
|
41
|
+
- README.md
|
42
|
+
- Rakefile
|
43
|
+
- bin/console
|
44
|
+
- bin/setup
|
45
|
+
- examples/mini_rus3
|
46
|
+
- examples/mini_sicp_scheme
|
47
|
+
- examples/sicp_scheme/environment.rb
|
48
|
+
- examples/sicp_scheme/error.rb
|
49
|
+
- examples/sicp_scheme/evaluator.rb
|
50
|
+
- examples/sicp_scheme/primitives.rb
|
51
|
+
- examples/sicp_scheme/printer.rb
|
52
|
+
- exe/rubasteme
|
53
|
+
- lib/rubasteme.rb
|
54
|
+
- lib/rubasteme/ast.rb
|
55
|
+
- lib/rubasteme/ast/branch_node.rb
|
56
|
+
- lib/rubasteme/ast/leaf_node.rb
|
57
|
+
- lib/rubasteme/error.rb
|
58
|
+
- lib/rubasteme/parser.rb
|
59
|
+
- lib/rubasteme/utils.rb
|
60
|
+
- lib/rubasteme/version.rb
|
61
|
+
- rubasteme.gemspec
|
62
|
+
homepage: https://github.com/mnbi/rubasteme
|
63
|
+
licenses:
|
64
|
+
- MIT
|
65
|
+
metadata:
|
66
|
+
homepage_uri: https://github.com/mnbi/rubasteme
|
67
|
+
source_code_uri: https://github.com/mnbi/rubasteme
|
68
|
+
changelog_uri: https://github.com/mnbi/rubasteme/blob/main/CHANGELOG.md
|
69
|
+
post_install_message:
|
70
|
+
rdoc_options: []
|
71
|
+
require_paths:
|
72
|
+
- lib
|
73
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - ">="
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 2.7.0
|
78
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
requirements: []
|
84
|
+
rubygems_version: 3.2.15
|
85
|
+
signing_key:
|
86
|
+
specification_version: 4
|
87
|
+
summary: Simple Abstract Syntax Tree for Scheme written in Ruby
|
88
|
+
test_files: []
|