ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: "matz (Yukihiro Matsumoto)" <noreply@ruby-lang.org>
To: ruby-core@neon.ruby-lang.org
Subject: [ruby-core:110550] [Ruby master Feature#19083] Add `node_id_for_backtrace_location` to ast.c
Date: Mon, 31 Oct 2022 02:04:33 +0000 (UTC)	[thread overview]
Message-ID: <redmine.journal-99878.20221031020432.9236@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-19083.20221025133804.9236@ruby-lang.org

Issue #19083 has been updated by matz (Yukihiro Matsumoto).


Sounds OK. Please merge.

Matz.


----------------------------------------
Feature #19083: Add `node_id_for_backtrace_location` to ast.c
https://bugs.ruby-lang.org/issues/19083#change-99878

* Author: eileencodes (Eileen Uchitelle)
* Status: Open
* Priority: Normal
----------------------------------------
Opening a ticket to get public comments on https://github.com/ruby/ruby/pull/6593. I worked on this with Aaron Patterson.

We want to use error highlight with eval'd code, specifically ERB templates. We're able to recover the generated code for eval'd templates and can get a parse tree for the ERB generated code, but we don't have a way to get the node id from the backtrace location. So we can't pass the right node into error highlight.

This patch gives us an API to get the node id from the backtrace location so we can find the node in the AST.

This change is needed for column info in ERB templates that Aaron worked on here https://github.com/rails/rails/pull/46171. Without this change we need to set `RubyVM.keep_script_lines = true`. With the changes here we should be able to remove keep_script_lines.

---Files--------------------------------
0001-Add-node_id_for_backtrace_location-function.patch (3.07 KB)


-- 
https://bugs.ruby-lang.org/

  parent reply	other threads:[~2022-10-31  2:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-25 13:38 [ruby-core:110513] [Ruby master Feature#19083] Add `node_id_for_location` to ast.c eileencodes (Eileen Uchitelle)
2022-10-29 15:25 ` [ruby-core:110544] [Ruby master Feature#19083] Add `node_id_for_backtrace_location` " eileencodes (Eileen Uchitelle)
2022-10-31  2:04 ` matz (Yukihiro Matsumoto) [this message]
2022-10-31  4:40 ` [ruby-core:110553] " mame (Yusuke Endoh)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-99878.20221031020432.9236@ruby-lang.org \
    --to=ruby-core@ruby-lang.org \
    --cc=ruby-core@neon.ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).