simplify whitespace handling; support hexadecimal numeric literals; allow empty configs
This commit is contained in:
@@ -10,8 +10,7 @@ block_1 {
|
||||
(config_file
|
||||
(body
|
||||
(block
|
||||
(identifier)
|
||||
(body))))
|
||||
(identifier))))
|
||||
|
||||
================================================================================
|
||||
basic block on one line
|
||||
@@ -69,8 +68,7 @@ block_1 {
|
||||
(identifier)
|
||||
(body
|
||||
(block
|
||||
(identifier)
|
||||
(body))))))
|
||||
(identifier))))))
|
||||
|
||||
================================================================================
|
||||
nested block on one line
|
||||
@@ -122,20 +120,22 @@ locals { timestamp = regex_replace(timestamp(), "[- TZ:]", "") }
|
||||
|
||||
(config_file
|
||||
(body
|
||||
(one_line_block
|
||||
(block
|
||||
(identifier)
|
||||
(identifier)
|
||||
(expression
|
||||
(function_call
|
||||
(body
|
||||
(attribute
|
||||
(identifier)
|
||||
(function_arguments
|
||||
(expression
|
||||
(function_call
|
||||
(identifier)))
|
||||
(expression
|
||||
(literal_value
|
||||
(string_lit
|
||||
(template_literal))))
|
||||
(expression
|
||||
(template_expr
|
||||
(quoted_template)))))))))
|
||||
(expression
|
||||
(function_call
|
||||
(identifier)
|
||||
(function_arguments
|
||||
(expression
|
||||
(function_call
|
||||
(identifier)))
|
||||
(expression
|
||||
(literal_value
|
||||
(string_lit
|
||||
(template_literal))))
|
||||
(expression
|
||||
(template_expr
|
||||
(quoted_template)))))))))))
|
||||
|
||||
@@ -365,3 +365,4 @@ worker_groups = [
|
||||
(expression
|
||||
(literal_value
|
||||
(numeric_lit)))))))))))))
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
================================================================================
|
||||
numeric literal hex 1
|
||||
================================================================================
|
||||
|
||||
pi = 0x314F
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
(config_file
|
||||
(body
|
||||
(attribute
|
||||
(identifier)
|
||||
(expression
|
||||
(literal_value
|
||||
(numeric_lit))))))
|
||||
|
||||
================================================================================
|
||||
numeric literal scientific notation 1
|
||||
================================================================================
|
||||
|
||||
@@ -11,32 +11,12 @@ foo = "bar\uZZ"
|
||||
(attribute
|
||||
(identifier)
|
||||
(expression
|
||||
(literal_value
|
||||
(string_lit
|
||||
(template_expr
|
||||
(quoted_template
|
||||
(template_literal
|
||||
(ERROR
|
||||
(UNEXPECTED '\')))))))))
|
||||
|
||||
================================================================================
|
||||
literal multi line error
|
||||
================================================================================
|
||||
|
||||
foo = "
|
||||
bar"
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
(config_file
|
||||
(body
|
||||
(attribute
|
||||
(identifier)
|
||||
(expression
|
||||
(literal_value
|
||||
(string_lit
|
||||
(ERROR
|
||||
(UNEXPECTED '\n'))
|
||||
(template_literal)))))))
|
||||
|
||||
================================================================================
|
||||
unescaped tab
|
||||
================================================================================
|
||||
@@ -67,8 +47,8 @@ foo = "foo\bar"
|
||||
(attribute
|
||||
(identifier)
|
||||
(expression
|
||||
(literal_value
|
||||
(string_lit
|
||||
(template_expr
|
||||
(quoted_template
|
||||
(template_literal
|
||||
(ERROR
|
||||
(UNEXPECTED '\')))))))))
|
||||
|
||||
Reference in New Issue
Block a user