quecto_calc 0.1.0 → 0.1.1
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/CHANGELOG.md +4 -0
- data/lib/quecto_calc/const_interface.rb +30 -0
- data/lib/quecto_calc/version.rb +1 -1
- data/lib/quecto_calc.rb +3 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20adbf781b1eb596029581cca4444cb87ee04d5c9e5b821027789486f6f38b65
|
4
|
+
data.tar.gz: 1acc1509de74d7f7f5681bd86c24d90433dd8bfc43706600c9d60bfadff78290
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f25a9e6c5a2630528ff65aa83f46043ab1d0076dfe8b1c617cea9dfe23af4f9ea966f50b276e08c13236e1ccc715b6d9e06eb973d6bc090167609b3e23b136a9
|
7
|
+
data.tar.gz: bdaac5eb72f9ace46f008759c07037b396af76e29e6984e6c7d6e6310b24e6437b77d0e48e134ddab417a128a07fd078b78ddcdecfa61a3055d2f4c245f48151
|
data/CHANGELOG.md
CHANGED
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "token_types"
|
4
|
+
|
5
|
+
#
|
6
|
+
# Provides an interface to retrieve token types constants to the outer world.
|
7
|
+
#
|
8
|
+
module ConstInterface
|
9
|
+
include TokenTypes
|
10
|
+
|
11
|
+
def tt_int
|
12
|
+
TT_INT
|
13
|
+
end
|
14
|
+
|
15
|
+
def tt_const
|
16
|
+
TT_CONST
|
17
|
+
end
|
18
|
+
|
19
|
+
def tt_plus
|
20
|
+
TT_PLUS
|
21
|
+
end
|
22
|
+
|
23
|
+
def tt_minus
|
24
|
+
TT_MINUS
|
25
|
+
end
|
26
|
+
|
27
|
+
def tt_eof
|
28
|
+
TT_EOF
|
29
|
+
end
|
30
|
+
end
|
data/lib/quecto_calc/version.rb
CHANGED
data/lib/quecto_calc.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative "quecto_calc/evaluator"
|
4
|
+
require_relative "quecto_calc/const_interface"
|
4
5
|
require_relative "quecto_calc/lexer"
|
5
6
|
require_relative "quecto_calc/parser"
|
6
7
|
require_relative "quecto_calc/version"
|
@@ -20,6 +21,8 @@ require_relative "quecto_calc/version"
|
|
20
21
|
# @ https://github.com/davidcallanan/py-myopl-code
|
21
22
|
#
|
22
23
|
class QuectoCalc
|
24
|
+
include ConstInterface
|
25
|
+
|
23
26
|
#
|
24
27
|
# Evaluate an expression.
|
25
28
|
#
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quecto_calc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mate
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-02-
|
11
|
+
date: 2023-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Evaluates primitive arithmetic expressions represented in a text form.
|
14
14
|
email:
|
@@ -29,6 +29,7 @@ files:
|
|
29
29
|
- lib/quecto_calc.rb
|
30
30
|
- lib/quecto_calc/bin_op_node.rb
|
31
31
|
- lib/quecto_calc/char_rules.rb
|
32
|
+
- lib/quecto_calc/const_interface.rb
|
32
33
|
- lib/quecto_calc/evaluator.rb
|
33
34
|
- lib/quecto_calc/lexer.rb
|
34
35
|
- lib/quecto_calc/number_node.rb
|