Update tests for differentiating commands

This commit is contained in:
Uy Ha 2021-06-04 13:02:16 +02:00
parent 6973cc46d2
commit 387faac594
7 changed files with 6433 additions and 2789 deletions

View file

@ -7,12 +7,14 @@ message([[]])
---
(source_file
(command_invocation
(normal_command
(identifier)
(arguments
(argument (bracket_argument))
)
)
)
)
==========================
One empty bracket argument
@ -23,12 +25,14 @@ message([[An argument]])
---
(source_file
(command_invocation
(normal_command
(identifier)
(arguments
(argument (bracket_argument (bracket_content)))
)
)
)
)
====================
One bracket argument
@ -39,12 +43,14 @@ message([[An argument]])
---
(source_file
(command_invocation
(normal_command
(identifier)
(arguments
(argument (bracket_argument (bracket_content)))
)
)
)
)
=====================
Two bracket arguments
@ -55,6 +61,7 @@ message([[First argument]] [[Second argument]])
---
(source_file
(command_invocation
(normal_command
(identifier)
(arguments
(argument (bracket_argument (bracket_content)))
@ -63,6 +70,7 @@ message([[First argument]] [[Second argument]])
)
)
)
)
=====================================
Two bracket with two equals arguments
@ -76,6 +84,7 @@ message(
---
(source_file
(command_invocation
(normal_command
(identifier)
(seperation (space))
(arguments
@ -86,6 +95,7 @@ message(
)
)
)
)
================================
Bracket argument with line break
@ -98,10 +108,12 @@ with line break
---
(source_file
(command_invocation
(normal_command
(identifier)
(arguments
(argument (bracket_argument (bracket_content)))
)
)
)
)

View file

@ -8,7 +8,11 @@ message()
(source_file
(command_invocation
(identifier)))
(normal_command
(identifier)
)
)
)
===============================================
Command invocation without argument with spaces
@ -20,10 +24,12 @@ message( )
(source_file
(command_invocation
(normal_command
(identifier)
(seperation (space))
)
)
)
================================================
Command invocation without argument with newline
@ -37,10 +43,12 @@ message(
(source_file
(command_invocation
(normal_command
(identifier)
(seperation
(line_ending (newline))
)
)
)
)

View file

@ -7,12 +7,14 @@ message("")
---
(source_file
(command_invocation
(normal_command
(identifier)
(arguments
(argument (quoted_argument))
)
)
)
)
===================
One quoted argument
@ -23,12 +25,14 @@ message("An argument")
---
(source_file
(command_invocation
(normal_command
(identifier)
(arguments
(argument (quoted_argument (quoted_element)))
)
)
)
)
====================
Two quoted arguments
@ -39,6 +43,7 @@ message("First argument" "Second argument")
---
(source_file
(command_invocation
(normal_command
(identifier)
(arguments
(argument (quoted_argument (quoted_element)))
@ -47,6 +52,7 @@ message("First argument" "Second argument")
)
)
)
)
=================================
A quoted argument with line break
@ -58,12 +64,14 @@ with line break")
---
(source_file
(command_invocation
(normal_command
(identifier)
(arguments
(argument (quoted_argument (quoted_element)))
)
)
)
)
======================
One variable reference
@ -74,6 +82,7 @@ message("${var}")
---
(source_file
(command_invocation
(normal_command
(identifier)
(arguments
(argument
@ -86,6 +95,7 @@ message("${var}")
)
)
)
)
=======================
Two Variable references
@ -96,6 +106,7 @@ message("${var} ${var}")
---
(source_file
(command_invocation
(normal_command
(identifier)
(arguments
(argument
@ -109,3 +120,4 @@ message("${var} ${var}")
)
)
)
)

View file

@ -8,12 +8,14 @@ message(STATUS)
(source_file
(command_invocation
(normal_command
(identifier)
(arguments
(argument (unquoted_argument))
)
)
)
)
=====================================
Command invocation with two arguments
@ -25,6 +27,7 @@ message(STATUS Hello)
(source_file
(command_invocation
(normal_command
(identifier)
(arguments
(argument (unquoted_argument))
@ -33,6 +36,7 @@ message(STATUS Hello)
)
)
)
)
===========================================
Command invocations with leading seperation
@ -45,13 +49,16 @@ STATUS)
(source_file
(command_invocation
(normal_command
(identifier)
(seperation (space))
(arguments
(argument (unquoted_argument))
)
)
)
(command_invocation
(normal_command
(identifier)
(seperation (line_ending (newline)))
(arguments
@ -59,6 +66,7 @@ STATUS)
)
)
)
)
========================================
Command invocations with escape sequence
========================================
@ -70,13 +78,16 @@ STATUS)
(source_file
(command_invocation
(normal_command
(identifier)
(seperation (space))
(arguments
(argument (unquoted_argument))
)
)
)
(command_invocation
(normal_command
(identifier)
(seperation (line_ending (newline)))
(arguments
@ -84,6 +95,7 @@ STATUS)
)
)
)
)
====================
Variable referencing
@ -93,6 +105,7 @@ message(${var_ref})
(source_file
(command_invocation
(normal_command
(identifier)
(arguments
(argument
@ -103,4 +116,5 @@ message(${var_ref})
)
)
)
)

View file

@ -399,9 +399,33 @@
"type": "STRING",
"value": "("
},
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "seperation"
}
},
{
"type": "CHOICE",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "arguments"
},
"named": true,
"value": "foreach_items"
},
{
"type": "BLANK"
}
]
},
{
"type": "SYMBOL",
"name": "foreach_range"
@ -467,15 +491,6 @@
}
]
},
"foreach_items": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "items"
}
]
},
"foreach_range": {
"type": "SEQ",
"members": [

View file

@ -115,6 +115,25 @@
"named": true,
"fields": {}
},
{
"type": "foreach_items",
"named": true,
"fields": {},
"children": {
"multiple": true,
"required": true,
"types": [
{
"type": "argument",
"named": true
},
{
"type": "seperation",
"named": true
}
]
}
},
{
"type": "foreach_lists_items",
"named": true,
@ -126,12 +145,16 @@
"fields": {},
"children": {
"multiple": true,
"required": true,
"required": false,
"types": [
{
"type": "command_invocation",
"named": true
},
{
"type": "foreach_items",
"named": true
},
{
"type": "foreach_lists_items",
"named": true
@ -431,10 +454,6 @@
"type": "identifier",
"named": true
},
{
"type": "items",
"named": false
},
{
"type": "newline",
"named": true

File diff suppressed because it is too large Load diff