Skip to content
This repository was archived by the owner on Sep 9, 2025. It is now read-only.
Closed
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
41047cb
Add skeleton Ruby project
May 11, 2023
9731142
Add storage and visualization features as required features
May 11, 2023
ae49472
Add a literal and statement test
May 11, 2023
4ad6b0a
Scaffold module / class include test
May 12, 2023
7fc44fa
Use working example.rb file
May 12, 2023
a97f2e9
Revert "Add storage and visualization features as required features"
May 12, 2023
95934bb
Remove empty LICENSE file
May 12, 2023
afd5f1a
Require clap derive explicitly
May 12, 2023
86366c9
Use Ruby comment syntax
May 12, 2023
24a61c7
Make includes module test more interesting
May 12, 2023
9c7065e
Fist class def test
May 15, 2023
9d0dead
Skip unsupported tests
May 15, 2023
e5ff578
Support class variables
May 15, 2023
757c895
Merge remote-tracking branch 'origin/main' into rubies-are-forever
May 16, 2023
bfa742d
Merge remote-tracking branch 'origin/main' into rubies-are-forever
May 16, 2023
213f5a5
Add nested class test
May 16, 2023
93c00bb
Add edge from program lexical scope to the root node
May 16, 2023
e4eb597
Differentiate between class definitions using scoped names versus sin…
May 16, 2023
738541f
Add support for resolving ::Foo scoped constants
May 16, 2023
29ce3c8
Add convenience scripts for development
May 17, 2023
6f75947
Reorganize program to global scope connectivity
May 17, 2023
9e05d34
A bit of header styling
May 17, 2023
cc6cbf5
Factor out identifiers into seperate rules
May 17, 2023
e4639c5
Support root variable definitions
May 17, 2023
3d4321c
Always use same output file
May 17, 2023
8bcf821
Support visiblity between split class definitions
May 17, 2023
5affcd5
Add module support
May 17, 2023
fc63478
Add push / pop node resolution for `new` method calls on class constants
May 17, 2023
a68be21
Model class instantiation with `new` constructor method call
May 17, 2023
455e90c
Introduce static_defs and instance_defs scoped variables.
May 19, 2023
d9e7f52
Update tests to use consistent commenting style and additional assert…
May 19, 2023
d180b11
Remove `.lexical_defs`
May 22, 2023
d5f310c
Use `.{def,ref}_value`
May 22, 2023
ee48789
Implement local variables and lexical scoping
May 22, 2023
22812c9
Also allow dereferencing `::` through constants
May 22, 2023
2ef2114
Implement refinement
May 23, 2023
a7c61a4
Prefer local definitions over surrounding context
May 23, 2023
a347fd1
Use tree-sitter query predicates instead of conditional statements to…
May 23, 2023
4218062
Add skipped test that triggers resolution bug
May 24, 2023
db447f1
Prevent path searching within refinement subgraphs when calling conte…
May 24, 2023
83518c9
Merge remote-tracking branch 'origin/main' into rubies-are-forever
May 30, 2023
df77c87
Merge remote-tracking branch 'origin/main' into rubies-are-forever
Jun 8, 2023
8aeff0b
Merge remote-tracking branch 'origin/main' into rubies-are-forever
Oct 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Prevent path searching within refinement subgraphs when calling conte…
…xt is not

refined.

An additional "<using>" pop symbol node is added as a guard to prevent path
searches from exploring "<refine>" subgraphs when not needed (i.e. when the
reference context is not using a refinement).

Co-authored-by: Hendrik van Antwerpen <hendrikvanantwerpen@github.com>
  • Loading branch information
Rick Winfrey Hendrik van Antwerpen
Rick Winfrey and Hendrik van Antwerpen committed May 24, 2023
commit db447f1f7f948f5562c8ee57adb531d40688bbc1
18 changes: 13 additions & 5 deletions languages/tree-sitter-stack-graphs-ruby/src/stack-graphs.tsg
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,14 @@ attribute node_symbol = node => symbol = (source-text node), source_n
node refine_scope
attr (refine_scope) is_endpoint

node using
attr (using) pop_symbol = "<using>"

node refine
attr (refine) push_scoped_symbol = "<refine>", scope = refine_scope

edge @call.static_defs -> refine
edge @call.static_defs -> using
edge using -> refine
edge refine -> @name.ref_value
edge @name.ref -> @call.lexical_scope

Expand All @@ -330,11 +334,15 @@ attribute node_symbol = node => symbol = (source-text node), source_n

;; using
(call method:(_)@_mthd_name (#eq? @_mthd_name "using") arguments:(argument_list (_)@name))@call {
node using
attr (using) pop_symbol = "<using>"
node pop_using
attr (pop_using) pop_symbol = "<using>"

node push_using
attr (push_using) push_symbol = "<using>"

edge @call.local_defs -> using
edge using -> @name.ref_value
edge @call.local_defs -> pop_using
edge pop_using -> push_using
edge push_using -> @name.ref_value
edge @name.ref -> @call.lexical_scope
}

Expand Down