Skip to content

[Bug]: The lexer breaks if the placeholder is within a comment or a quoted literal #1373

Open
@nogitting

Description

@nogitting

What happened?

Hello & kudos.

The error occurs with this (or a similar) configuration:

  • templater = placeholder
  • param_style = dollar (but not only)
  • -- This is ${my_param} or WHERE full_name = '${some_name}' (in the given SQL file)

Here is what it outputs:

thread 'main' panicked at crates/lib-core/src/parser/lexer.rs:787:25:
not implemented
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

SQLFluff parses it correctly though.

One hacky workaround is to add a space before the parameter name. So, -- This is ${ my_param} and WHERE full_name = '${ some_name}' work, regardless of the dialect.

Version

Latest (0.25.10)

Checked in Playground

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions