Skip to content

Commit

Permalink
Including offset info in meta data
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidBakerEffendi committed Oct 23, 2024
1 parent 6200594 commit 91561b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
.vscode
*.gem
*.jar

Gemfile.lock
# rspec failure tracking
.rspec_status
2 changes: 2 additions & 0 deletions lib/ruby_ast_gen/node_handling.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ def self.ast_to_json(node, code, current_depth: 0, file_path: nil)
start_column: fetch_member(loc, :column),
end_line: fetch_member(loc, :last_line),
end_column: fetch_member(loc, :last_column),
offset_start: loc&.expression&.begin_pos,
offset_end: loc&.expression&.end_pos,
code: self.extract_code_snippet(loc, code)
}
if current_depth >= MAX_NESTING_DEPTH
Expand Down

0 comments on commit 91561b0

Please sign in to comment.