Git Product home page Git Product logo

Comments (4)

MarinPostma avatar MarinPostma commented on July 28, 2024

alright I found it, in parse.y, this bit:

table_option(A) ::= nm(X). {
  if "strict".eq_ignore_ascii_case(&X.0) {
    A = TableOptions::STRICT;
  }else{
    A = TableOptions::NONE;
    let msg = format!("unknown table option: {}", &X);
    self.ctx.sqlite3_error_msg(&msg);
  }
}

generates:

//line 161 "src/parser/parse.y"
{
  if "strict".eq_ignore_ascii_case(&self.yy_move(0).yy222().0) {
    yylhsminor = YYMINORTYPE::yy201( TableOptions::STRICT);
  }else{
    yylhsminor = YYMINORTYPE::yy201( TableOptions::NONE);
    let msg = format!("unknown table option: {}", &self.yy_move(0).yy222());
    self.ctx.sqlite3_error_msg(&msg);
  }
}

but the call to yy222 consumes self. on the subsequent call to create the error message, the content of the name was already taken from self.minor, and it blows up.

changing the rule to:

table_option(A) ::= nm(X). {
  let name = X;
  if "strict".eq_ignore_ascii_case(&name.0) {
    A = TableOptions::STRICT;
  }else{
    A = TableOptions::NONE;
    let msg = format!("unknown table option: {name}");
    self.ctx.sqlite3_error_msg(&msg);
  }
}

it doesn't panic anymore, but doesn't return an error either. Still investigating.

from lemon-rs.

gwenn avatar gwenn commented on July 28, 2024

Indeed, in one action, we are supposed to consume entry once.

from lemon-rs.

MarinPostma avatar MarinPostma commented on July 28, 2024

I fixed it by immediately returning a ParseError after self.ctx.sqlite3_error_msg(&msg);, now it returns an error as expected. LMK if you are interested in these fixes!

from lemon-rs.

gwenn avatar gwenn commented on July 28, 2024

I've reapplied your fix here: a7cd0c1
And I am going to fix all usages of sqlite3_error_msg.
Thanks for all your feedback.

from lemon-rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.