taozhi8833998 / taozhi8833998/node-sql-parser

have line/char available in AST?

Open
#1,439 2 comments 0 reactions 1 assignee View on GitHub

@taozhi8833998 is already working on this.

Since May 29, 2023.

Dominant language
PEG.js
Stars
1k
Forks
244
PR merge metrics
No merged PRs in 30d

Description

Not a bug, more of a feature. I wasn't sure where to ask. I'm writing an interpreter for SQL and I'd like to tell the user exactly where they made a semantic error. I was going to use sqlify() to render the branch of the tree the problem occurred on, but sqlify only accepts top-level ast nodes (for instance, I can't sqlify a column_ref). Is there something I can use to visually show the user where their error was made (perhaps line numbers somewhere or an offset, or maybe another sqlify function?).

Thank you.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.