quecto_calc 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3f56437ed3d312aa5c0508c4e787d2b33cb0ea8f6943fa6198ff201d8fc6f579
4
- data.tar.gz: c089f9abbc586cada86442f88c6fdbd9c063609613643388bca93ed6e5eb87a3
3
+ metadata.gz: 20adbf781b1eb596029581cca4444cb87ee04d5c9e5b821027789486f6f38b65
4
+ data.tar.gz: 1acc1509de74d7f7f5681bd86c24d90433dd8bfc43706600c9d60bfadff78290
5
5
  SHA512:
6
- metadata.gz: 3ec5be8c5bcbbba76dcea6a2b13cd75ce58a4f96d67d1cc2861cc909f9194982b25b15762a22200a7cab3ccb312fbecf7b55c6fee219369fcd14898832b2ae51
7
- data.tar.gz: 41348a16b6f58ecadc075f9e06e74e3f96dbdd1f61b5e1d8b8c10b9bccc8a3b06eb170bfb5e36e61905fe7e580bc25dfb1f6dadd01f24aaba22668870614dcd7
6
+ metadata.gz: f25a9e6c5a2630528ff65aa83f46043ab1d0076dfe8b1c617cea9dfe23af4f9ea966f50b276e08c13236e1ccc715b6d9e06eb973d6bc090167609b3e23b136a9
7
+ data.tar.gz: bdaac5eb72f9ace46f008759c07037b396af76e29e6984e6c7d6e6310b24e6437b77d0e48e134ddab417a128a07fd078b78ddcdecfa61a3055d2f4c245f48151
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 0.1.1 / 2023-02-19
2
+
3
+ * Added constants interface.
4
+
1
5
  ### 0.1.0 / 2023-02-17
2
6
 
3
7
  * Initial release.
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class QuectoCalc
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
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.0
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-17 00:00:00.000000000 Z
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