From d5592b5a7b48ca3eb00889995ba8a82080f917bf Mon Sep 17 00:00:00 2001 From: ptmcg Date: Tue, 13 Sep 2016 01:40:31 +0000 Subject: Expand results names to capture multiple values; add '*' as potential function argument git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@438 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b --- src/examples/select_parser.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/examples/select_parser.py b/src/examples/select_parser.py index 5b823a4..f969f02 100644 --- a/src/examples/select_parser.py +++ b/src/examples/select_parser.py @@ -56,7 +56,7 @@ type_name = oneOf("TEXT REAL INTEGER BLOB NULL") expr_term = ( CAST + LPAR + expr + AS + type_name + RPAR | EXISTS + LPAR + select_stmt + RPAR | - function_name.setName("function_name") + LPAR + Optional(delimitedList(expr)) + RPAR | + function_name.setName("function_name") + LPAR + Optional("*" | delimitedList(expr)) + RPAR | literal_value | bind_parameter | Combine(identifier+('.'+identifier)*(0,2)).setName("ident") @@ -88,8 +88,8 @@ join_constraint = Group(Optional(ON + expr | USING + LPAR + Group(delimitedList( join_op = COMMA | Group(Optional(NATURAL) + Optional(INNER | CROSS | LEFT + OUTER | LEFT | OUTER) + JOIN) join_source = Forward() -single_source = ( (Group(database_name("database") + "." + table_name("table")) | table_name("table")) + - Optional(Optional(AS) + table_alias("table_alias")) + +single_source = ( (Group(database_name("database") + "." + table_name("table*")) | table_name("table*")) + + Optional(Optional(AS) + table_alias("table_alias*")) + Optional(INDEXED + BY + index_name("name") | NOT + INDEXED)("index") | (LPAR + select_stmt + RPAR + Optional(Optional(AS) + table_alias)) | (LPAR + join_source + RPAR) ) -- cgit v1.2.1