Add string literals
Once again, taking the rules more or less straight from tree-sitter-go.
This commit is contained in:
parent
62f5031144
commit
2b78a3365a
5 changed files with 712 additions and 181 deletions
|
|
@ -31,3 +31,43 @@ foo = -42
|
|||
(assignment
|
||||
(identifier)
|
||||
(integer_literal)))
|
||||
|
||||
================================================================================
|
||||
String
|
||||
================================================================================
|
||||
|
||||
foo = "Hello World!"
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
(source_file
|
||||
(assignment
|
||||
(identifier)
|
||||
(interpreted_string_literal)))
|
||||
|
||||
================================================================================
|
||||
String (escape)
|
||||
================================================================================
|
||||
|
||||
foo = "Hello\nWorld!"
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
(source_file
|
||||
(assignment
|
||||
(identifier)
|
||||
(interpreted_string_literal
|
||||
(escape_sequence))))
|
||||
|
||||
================================================================================
|
||||
String (raw)
|
||||
================================================================================
|
||||
|
||||
foo = `Hello\nWorld!`
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
(source_file
|
||||
(assignment
|
||||
(identifier)
|
||||
(raw_string_literal)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue