mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 20:59:16 +00:00
LibSQL: Add parsing and evaluation of BOOLEAN type literals
This allows you to enter TRUE or FALSE in a SQL statement for BOOLEAN types. Note that this differs from SQLite, which requires entering 1 or 0 for BOOLEANs; having explicit keywords feels a bit more natural.
This commit is contained in:
parent
c67c7dd1f2
commit
41e0e4cdd7
Notes:
sideshowbarker
2024-07-17 07:06:47 +09:00
Author: https://github.com/trflynn89
Commit: 41e0e4cdd7
Pull-request: https://github.com/SerenityOS/serenity/pull/16741
5 changed files with 43 additions and 0 deletions
|
@ -524,6 +524,10 @@ RefPtr<Expression> Parser::parse_literal_value_expression()
|
|||
auto value = consume().value();
|
||||
return create_ast_node<BlobLiteral>(value);
|
||||
}
|
||||
if (consume_if(TokenType::True))
|
||||
return create_ast_node<BooleanLiteral>(true);
|
||||
if (consume_if(TokenType::False))
|
||||
return create_ast_node<BooleanLiteral>(false);
|
||||
if (consume_if(TokenType::Null))
|
||||
return create_ast_node<NullLiteral>();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue