fix: allow empty string literals
This commit is contained in:
@@ -7,6 +7,9 @@ housekeeping:
|
||||
* regenerate parser
|
||||
* fix clang+windows CI job
|
||||
|
||||
fix:
|
||||
* allow empty string literals
|
||||
|
||||
## 0.6.0 - 2021-09-20
|
||||
|
||||
feature:
|
||||
|
||||
@@ -108,7 +108,7 @@ module.exports = grammar({
|
||||
|
||||
string_lit: $ => prec(PREC.string_lit, seq(
|
||||
$.quoted_template_start,
|
||||
$.template_literal,
|
||||
optional($.template_literal),
|
||||
$.quoted_template_end,
|
||||
)),
|
||||
|
||||
|
||||
@@ -312,10 +312,18 @@
|
||||
"type": "SYMBOL",
|
||||
"name": "quoted_template_start"
|
||||
},
|
||||
{
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "template_literal"
|
||||
},
|
||||
{
|
||||
"type": "BLANK"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "quoted_template_end"
|
||||
|
||||
18970
src/parser.c
18970
src/parser.c
File diff suppressed because it is too large
Load Diff
@@ -29,6 +29,25 @@ block_1 {}
|
||||
(block_start)
|
||||
(block_end))))
|
||||
|
||||
================================================================================
|
||||
basic block with empty type
|
||||
================================================================================
|
||||
|
||||
block_1 "" {
|
||||
}
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
(config_file
|
||||
(body
|
||||
(block
|
||||
(identifier)
|
||||
(string_lit
|
||||
(quoted_template_start)
|
||||
(quoted_template_end))
|
||||
(block_start)
|
||||
(block_end))))
|
||||
|
||||
================================================================================
|
||||
block with attribute
|
||||
================================================================================
|
||||
@@ -166,8 +185,8 @@ locals { timestamp = regex_replace(timestamp(), "[- TZ:]", "") }
|
||||
(template_literal)
|
||||
(quoted_template_end))))
|
||||
(expression
|
||||
(template_expr
|
||||
(quoted_template
|
||||
(literal_value
|
||||
(string_lit
|
||||
(quoted_template_start)
|
||||
(quoted_template_end)))))))))
|
||||
(block_end))))
|
||||
|
||||
@@ -126,8 +126,8 @@ resource "azurerm_storage_blob" "proxy_cert" {
|
||||
(identifier))
|
||||
(get_attr
|
||||
(identifier))
|
||||
(template_expr
|
||||
(quoted_template
|
||||
(literal_value
|
||||
(string_lit
|
||||
(quoted_template_start)
|
||||
(quoted_template_end))))))
|
||||
(expression
|
||||
@@ -158,8 +158,8 @@ resource "azurerm_storage_blob" "proxy_cert" {
|
||||
(identifier))
|
||||
(get_attr
|
||||
(identifier))
|
||||
(template_expr
|
||||
(quoted_template
|
||||
(literal_value
|
||||
(string_lit
|
||||
(quoted_template_start)
|
||||
(quoted_template_end))))))
|
||||
(expression
|
||||
@@ -203,8 +203,8 @@ resource "azurerm_storage_blob" "proxy_cert" {
|
||||
(identifier))
|
||||
(get_attr
|
||||
(identifier))
|
||||
(template_expr
|
||||
(quoted_template
|
||||
(literal_value
|
||||
(string_lit
|
||||
(quoted_template_start)
|
||||
(quoted_template_end))))))
|
||||
(expression
|
||||
@@ -259,8 +259,8 @@ resource "azurerm_storage_blob" "proxy_cert" {
|
||||
(identifier))
|
||||
(get_attr
|
||||
(identifier))
|
||||
(template_expr
|
||||
(quoted_template
|
||||
(literal_value
|
||||
(string_lit
|
||||
(quoted_template_start)
|
||||
(quoted_template_end))))))
|
||||
(expression
|
||||
@@ -315,8 +315,8 @@ resource "azurerm_storage_blob" "proxy_cert" {
|
||||
(identifier))
|
||||
(get_attr
|
||||
(identifier))
|
||||
(template_expr
|
||||
(quoted_template
|
||||
(literal_value
|
||||
(string_lit
|
||||
(quoted_template_start)
|
||||
(quoted_template_end))))))
|
||||
(expression
|
||||
@@ -396,16 +396,16 @@ resource "azurerm_storage_blob" "proxy_cert" {
|
||||
(identifier))
|
||||
(get_attr
|
||||
(identifier))
|
||||
(template_expr
|
||||
(quoted_template
|
||||
(literal_value
|
||||
(string_lit
|
||||
(quoted_template_start)
|
||||
(quoted_template_end)))))
|
||||
(variable_expr
|
||||
(identifier))))
|
||||
(get_attr
|
||||
(identifier))
|
||||
(template_expr
|
||||
(quoted_template
|
||||
(literal_value
|
||||
(string_lit
|
||||
(quoted_template_start)
|
||||
(quoted_template_end))))))
|
||||
(expression
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
================================================================================
|
||||
empty string
|
||||
================================================================================
|
||||
|
||||
foo = ""
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
(config_file
|
||||
(body
|
||||
(attribute
|
||||
(identifier)
|
||||
(expression
|
||||
(literal_value
|
||||
(string_lit
|
||||
(quoted_template_start)
|
||||
(quoted_template_end)))))))
|
||||
|
||||
================================================================================
|
||||
unescaped tab
|
||||
================================================================================
|
||||
|
||||
Reference in New Issue
Block a user