loxxy 0.1.0 → 0.1.01

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 42a88690625576399255ae7fadd3ac6aee022fc8d56a8e10c1206b55eca207ab
4
- data.tar.gz: 4042d268f199763405a264480765bbd5fe7aeaa998eb5e0a4353ae702c3bef2a
3
+ metadata.gz: c477fc7db959df775fc4656e21d577dbb3fce65724b07c8a7ec020496c196100
4
+ data.tar.gz: f941317a01b0dbcdca250697a4e84b88f85b572fa7f4f67be3de7c162bc8e2cb
5
5
  SHA512:
6
- metadata.gz: 21a6a82509ead9c0d9f38c6798147dda38c436d87b8800a33ca7027553631866ce4215f2eb90c482f3c5a9b0bb42e99b7868fca888b78fcf7eca67afcd7db756
7
- data.tar.gz: 71b53af0df630894c0d45639a84f427f34c7b92a5092e07cea16bc3786af666be13b0035a13c07b2910c374c76caa009c3acdbd675f430c8f6e4b7951c2b68a7
6
+ metadata.gz: b379767ee5cdf986a1b5e704c0254bb8901123811504ba58c59d3996897c29413e84298f6d3c65db849ad289183261d30657e1605d076c4ab9a8e9b0c38318da
7
+ data.tar.gz: 258f5a4d501bedbbec5f235ca7d858a4195c9088dcef8d63a6a16b9c25306167eecf93ff3b51aafc8ecf17fd6ed40f9dfe220797a033021f377eb62200de99c3
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## [0.1.01] - 2021-02-20
2
+ ### Fixed
3
+ - Fixed most offences for Rubocop.
4
+
5
+
1
6
  ## [0.1.00] - 2021-02-20
2
7
  - Version number bumped, `Loxxy` supports function definitions
3
8
 
@@ -233,7 +233,7 @@ module Loxxy
233
233
  end
234
234
 
235
235
  # rule('block' => 'LEFT_BRACE RIGHT_BRACE').as 'block_empty'
236
- def reduce_block_empty(_production, _range, tokens, theChildren)
236
+ def reduce_block_empty(_production, _range, tokens, _children)
237
237
  Ast::LoxBlockStmt.new(tokens[0].position, nil)
238
238
  end
239
239
 
@@ -298,7 +298,7 @@ module Loxxy
298
298
  def reduce_function(_production, _range, _tokens, theChildren)
299
299
  first_child = theChildren.first
300
300
  pos = first_child.token.position
301
- fun_stmt = LoxFunStmt.new(pos, first_child.token.lexeme, theChildren[2], theChildren[4])
301
+ LoxFunStmt.new(pos, first_child.token.lexeme, theChildren[2], theChildren[4])
302
302
  end
303
303
 
304
304
  # rule('parameters' => 'parameters COMMA IDENTIFIER')
@@ -4,6 +4,7 @@ require_relative 'lox_compound_expr'
4
4
 
5
5
  module Loxxy
6
6
  module Ast
7
+ # rubocop: disable Style/AccessorGrouping
7
8
  class LoxFunStmt < LoxCompoundExpr
8
9
  attr_reader :name
9
10
  attr_reader :params
@@ -28,5 +29,6 @@ module Loxxy
28
29
 
29
30
  alias operands subnodes
30
31
  end # class
32
+ # rubocop: enable Style/AccessorGrouping
31
33
  end # module
32
34
  end # module
@@ -213,7 +213,7 @@ module Loxxy
213
213
  stack.push(aValue)
214
214
  end
215
215
 
216
- def after_fun_stmt(aFunStmt, aVisitor)
216
+ def after_fun_stmt(aFunStmt, _visitor)
217
217
  function = Function.new(aFunStmt.name, aFunStmt.params, aFunStmt.body, stack)
218
218
  new_var = Variable.new(aFunStmt.name, function)
219
219
  symbol_table.insert(new_var)
@@ -4,18 +4,16 @@ require_relative '../datatype/all_datatypes'
4
4
 
5
5
  module Loxxy
6
6
  module BackEnd
7
+ # rubocop: disable Style/AccessorGrouping
7
8
  # Representation of a Lox function.
8
9
  # It is a named slot that can be associated with a value at the time.
9
10
  class Function
10
-
11
11
  # @return [String]
12
12
  attr_reader :name
13
13
 
14
14
  # @return [Array<>] the parameters
15
15
  attr_reader :parameters
16
-
17
16
  attr_reader :body
18
-
19
17
  attr_reader :stack
20
18
 
21
19
  # Create a variable with given name and initial value
@@ -41,5 +39,6 @@ module Loxxy
41
39
  "<fn #{name}>"
42
40
  end
43
41
  end # class
42
+ # rubocop: enable Style/AccessorGrouping
44
43
  end # module
45
44
  end # module
data/lib/loxxy/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Loxxy
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.01'
5
5
  end
@@ -9,6 +9,7 @@ require_relative '../lib/loxxy/interpreter'
9
9
  module Loxxy
10
10
  # This spec contains the bare bones test for the Interpreter class.
11
11
  # The execution of Lox code is tested elsewhere.
12
+ # rubocop: disable Metrics/BlockLength
12
13
  describe Interpreter do
13
14
  let(:sample_cfg) do
14
15
  { ostream: StringIO.new }
@@ -429,4 +430,5 @@ LOX_END
429
430
  end
430
431
  end # context
431
432
  end # describe
433
+ # rubocop: enable Metrics/BlockLength
432
434
  end # module
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: loxxy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.01
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dimitri Geshef