Update tests for differentiating commands
This commit is contained in:
parent
6973cc46d2
commit
387faac594
|
@ -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)))
|
||||
|
@ -62,7 +69,8 @@ message([[First argument]] [[Second argument]])
|
|||
(argument (bracket_argument (bracket_content)))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
=====================================
|
||||
Two bracket with two equals arguments
|
||||
|
@ -76,6 +84,7 @@ message(
|
|||
---
|
||||
(source_file
|
||||
(command_invocation
|
||||
(normal_command
|
||||
(identifier)
|
||||
(seperation (space))
|
||||
(arguments
|
||||
|
@ -85,7 +94,8 @@ message(
|
|||
(seperation (line_ending (newline)))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
================================
|
||||
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)))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
|
|
@ -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))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
|
|
@ -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)))
|
||||
|
@ -46,7 +51,8 @@ message("First argument" "Second argument")
|
|||
(argument (quoted_argument (quoted_element)))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
=================================
|
||||
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
|
||||
|
@ -85,7 +94,8 @@ message("${var}")
|
|||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
=======================
|
||||
Two Variable references
|
||||
|
@ -96,6 +106,7 @@ message("${var} ${var}")
|
|||
---
|
||||
(source_file
|
||||
(command_invocation
|
||||
(normal_command
|
||||
(identifier)
|
||||
(arguments
|
||||
(argument
|
||||
|
@ -108,4 +119,5 @@ message("${var} ${var}")
|
|||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
|
|
@ -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))
|
||||
|
@ -32,7 +35,8 @@ message(STATUS Hello)
|
|||
(argument (unquoted_argument))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
===========================================
|
||||
Command invocations with leading seperation
|
||||
|
@ -45,20 +49,24 @@ STATUS)
|
|||
|
||||
(source_file
|
||||
(command_invocation
|
||||
(normal_command
|
||||
(identifier)
|
||||
(seperation (space))
|
||||
(arguments
|
||||
(argument (unquoted_argument))
|
||||
)
|
||||
)
|
||||
)
|
||||
(command_invocation
|
||||
(normal_command
|
||||
(identifier)
|
||||
(seperation (line_ending (newline)))
|
||||
(arguments
|
||||
(argument (unquoted_argument))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
========================================
|
||||
Command invocations with escape sequence
|
||||
========================================
|
||||
|
@ -70,20 +78,24 @@ STATUS)
|
|||
|
||||
(source_file
|
||||
(command_invocation
|
||||
(normal_command
|
||||
(identifier)
|
||||
(seperation (space))
|
||||
(arguments
|
||||
(argument (unquoted_argument))
|
||||
)
|
||||
)
|
||||
)
|
||||
(command_invocation
|
||||
(normal_command
|
||||
(identifier)
|
||||
(seperation (line_ending (newline)))
|
||||
(arguments
|
||||
(argument (unquoted_argument))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
====================
|
||||
Variable referencing
|
||||
|
@ -93,6 +105,7 @@ message(${var_ref})
|
|||
|
||||
(source_file
|
||||
(command_invocation
|
||||
(normal_command
|
||||
(identifier)
|
||||
(arguments
|
||||
(argument
|
||||
|
@ -102,5 +115,6 @@ message(${var_ref})
|
|||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
|
|
@ -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": [
|
||||
|
|
|
@ -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
|
||||
|
|
8820
src/parser.c
8820
src/parser.c
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue