masamune-ast 1.1.1 → 1.1.2

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: a00f60e535cf2096a37cd6efd639aa7c132c70e58c3b422a23538128368b5c85
4
- data.tar.gz: 5d548fc4b9d5cf25c1099a2b446542f57342694d7b414052df004dcd2cf311c2
3
+ metadata.gz: 0cafe74abe55158e29178163ef544558f8e8d042d8adae0668a8625e1883c843
4
+ data.tar.gz: f0068f9e6783403ba0d17f65902c0ecfded0806424383c8d325168ce0b4c7a58
5
5
  SHA512:
6
- metadata.gz: c80bcefac510bfd4103d56fd13f39a46d1e4531eceb678d620709b97fe0c941f20f1e7ffddc6058e77aab46ab093d1d4ba768b6860649c5a57197e36f89bf109
7
- data.tar.gz: 731a46f94d655a820acdd949d7d7fa03f3fc37277858b5b5daea3c0c13444720b3b1ca829d0f304d5aecb3f390e3055168503ce6655653268cb89fcf19ab28e3
6
+ metadata.gz: b6647c5ea9745d2e1f842a0d0eea3de05e795c7afa9a3241cf9d6a87dd802c4c62e7c9fdb266afcbc8e54ffe51af25d9bacc32830d4f28009f9c34b2a4f733a8
7
+ data.tar.gz: d7781f44d57a0bca23d7a61eaed10cdb687431a66540433ac0e01f43c6a625cd05aea2cd06168b1ea980d2fffaa827634ba3633ca8a94950df2110a60d4f9f5c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- masamune-ast (1.1.1)
4
+ masamune-ast (1.1.2)
5
5
  activesupport
6
6
 
7
7
  GEM
@@ -70,6 +70,14 @@ module Masamune
70
70
  def brace_block_params
71
71
  end
72
72
 
73
+ # @tree only shows comments as a type of `:void_stmt` and
74
+ # doesn't have a data node, so we get comments from @lex_nodes.
75
+ def comments(content: nil)
76
+ comments = @lex_nodes.select {|node| node.type == :comment}
77
+ comments.select {|comment| comment.token == content} if content
78
+ comments.map {|comment| {position: comment.position, token: comment.token}}
79
+ end
80
+
73
81
  def all_methods
74
82
  method_definitions + method_calls
75
83
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Masamune
4
- VERSION = "1.1.1"
4
+ VERSION = "1.1.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: masamune-ast
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriel Zayas