pytest-dsl 0.12.1__py3-none-any.whl → 0.14.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pytest_dsl/cli.py +59 -4
- pytest_dsl/core/custom_keyword_manager.py +250 -14
- pytest_dsl/core/dsl_executor.py +251 -25
- pytest_dsl/core/hook_manager.py +87 -0
- pytest_dsl/core/hookable_executor.py +134 -0
- pytest_dsl/core/hookable_keyword_manager.py +106 -0
- pytest_dsl/core/hookspecs.py +175 -0
- pytest_dsl/core/parser.py +7 -2
- pytest_dsl/core/parsetab.py +90 -89
- pytest_dsl/core/yaml_loader.py +142 -42
- pytest_dsl/core/yaml_vars.py +90 -7
- pytest_dsl/plugin.py +19 -2
- {pytest_dsl-0.12.1.dist-info → pytest_dsl-0.14.0.dist-info}/METADATA +1 -1
- {pytest_dsl-0.12.1.dist-info → pytest_dsl-0.14.0.dist-info}/RECORD +18 -14
- {pytest_dsl-0.12.1.dist-info → pytest_dsl-0.14.0.dist-info}/WHEEL +0 -0
- {pytest_dsl-0.12.1.dist-info → pytest_dsl-0.14.0.dist-info}/entry_points.txt +0 -0
- {pytest_dsl-0.12.1.dist-info → pytest_dsl-0.14.0.dist-info}/licenses/LICENSE +0 -0
- {pytest_dsl-0.12.1.dist-info → pytest_dsl-0.14.0.dist-info}/top_level.txt +0 -0
pytest_dsl/core/parsetab.py
CHANGED
@@ -6,9 +6,9 @@ _tabversion = '3.10'
|
|
6
6
|
|
7
7
|
_lr_method = 'LALR'
|
8
8
|
|
9
|
-
_lr_signature = 'leftCOMMAleftGTLTGELEEQNEleftPLUSMINUSleftTIMESDIVIDEMODULOrightEQUALSAS AUTHOR_KEYWORD BREAK COLON COMMA CONTINUE DATA_KEYWORD DATE DATE_KEYWORD DESCRIPTION_KEYWORD DIVIDE DO ELIF ELSE END EQ EQUALS FALSE FOR FUNCTION GE GT ID IF IMPORT_KEYWORD IN LBRACE LBRACKET LE LPAREN LT MINUS MODULO NAME_KEYWORD NE NUMBER PIPE PLACEHOLDER PLUS RANGE RBRACE RBRACKET REMOTE_KEYWORD RETURN RPAREN STRING TAGS_KEYWORD TEARDOWN TIMES TRUE USINGstart : metadata statements teardown\n | metadata statements\n | statements teardown\n | statementsmetadata : metadata_items\n | emptyempty :metadata_items : metadata_item metadata_items\n | metadata_itemmetadata_item : NAME_KEYWORD COLON metadata_value\n | DESCRIPTION_KEYWORD COLON metadata_value\n | TAGS_KEYWORD COLON LBRACKET tags RBRACKET\n | AUTHOR_KEYWORD COLON metadata_value\n | DATE_KEYWORD COLON DATE\n | DATA_KEYWORD COLON data_source\n | IMPORT_KEYWORD COLON STRING\n | REMOTE_KEYWORD COLON STRING AS IDmetadata_value : STRING\n | IDtags : tag COMMA tags\n | tagtag : STRING\n | IDstatements : statement statements\n | statementstatement : assignment\n | keyword_call\n | remote_keyword_call\n | loop\n | custom_keyword\n | return_statement\n | if_statement\n | break_statement\n | continue_statementassignment : ID EQUALS expression\n | ID EQUALS keyword_call\n | ID EQUALS remote_keyword_callexpression : expr_atom\n | comparison_expr\n | arithmetic_exprexpr_atom : NUMBER\n | STRING\n | PLACEHOLDER\n | ID\n | boolean_expr\n | list_expr\n | dict_expr\n | LPAREN expression RPARENboolean_expr : TRUE\n | FALSElist_expr : LBRACKET list_items RBRACKET\n | LBRACKET RBRACKETlist_items : list_item\n | list_item COMMA list_itemslist_item : expressiondict_expr : LBRACE dict_items RBRACE\n | LBRACE RBRACEdict_items : dict_item\n | dict_item COMMA dict_itemsdict_item : expression COLON expressionloop : FOR ID IN RANGE LPAREN expression COMMA expression RPAREN DO statements ENDkeyword_call : LBRACKET ID RBRACKET COMMA parameter_list\n | LBRACKET ID RBRACKETparameter_list : parameter_itemsparameter_items : parameter_item COMMA parameter_items\n | parameter_itemparameter_item : ID COLON expressionteardown : TEARDOWN DO statements ENDdata_source : STRING USING IDcustom_keyword : FUNCTION ID LPAREN param_definitions RPAREN DO statements ENDparam_definitions : param_def_list\n | param_def_list : param_def COMMA param_def_list\n | param_defparam_def : ID EQUALS STRING\n | ID EQUALS NUMBER\n | IDreturn_statement : RETURN expressionbreak_statement : BREAKcontinue_statement : CONTINUEif_statement : IF expression DO statements END\n | IF expression DO statements elif_clauses END\n | IF expression DO statements ELSE statements END\n | IF expression DO statements elif_clauses ELSE statements ENDelif_clauses : elif_clause\n | elif_clause elif_clauseselif_clause : ELIF expression DO statementscomparison_expr : expr_atom GT expr_atom\n | expr_atom LT expr_atom\n | expr_atom GE expr_atom\n | expr_atom LE expr_atom\n | expr_atom EQ expr_atom\n | expr_atom NE expr_atomarithmetic_expr : expression PLUS expression\n | expression MINUS expression\n | expression TIMES expression\n | expression DIVIDE expression\n | expression MODULO expressionremote_keyword_call : ID PIPE LBRACKET ID RBRACKET COMMA parameter_list\n | ID PIPE LBRACKET ID RBRACKET'
|
9
|
+
_lr_signature = 'leftCOMMAleftGTLTGELEEQNEleftPLUSMINUSleftTIMESDIVIDEMODULOrightEQUALSAS AUTHOR_KEYWORD BREAK COLON COMMA CONTINUE DATA_KEYWORD DATE DATE_KEYWORD DESCRIPTION_KEYWORD DIVIDE DO ELIF ELSE END EQ EQUALS FALSE FOR FUNCTION GE GT ID IF IMPORT_KEYWORD IN LBRACE LBRACKET LE LPAREN LT MINUS MODULO NAME_KEYWORD NE NUMBER PIPE PLACEHOLDER PLUS RANGE RBRACE RBRACKET REMOTE_KEYWORD RETURN RPAREN STRING TAGS_KEYWORD TEARDOWN TIMES TRUE USINGstart : metadata statements teardown\n | metadata statements\n | statements teardown\n | statementsmetadata : metadata_items\n | emptyempty :metadata_items : metadata_item metadata_items\n | metadata_itemmetadata_item : NAME_KEYWORD COLON metadata_value\n | DESCRIPTION_KEYWORD COLON metadata_value\n | TAGS_KEYWORD COLON LBRACKET tags RBRACKET\n | AUTHOR_KEYWORD COLON metadata_value\n | DATE_KEYWORD COLON DATE\n | DATE_KEYWORD COLON STRING\n | DATA_KEYWORD COLON data_source\n | IMPORT_KEYWORD COLON STRING\n | REMOTE_KEYWORD COLON STRING AS IDmetadata_value : STRING\n | IDtags : tag COMMA tags\n | tagtag : STRING\n | IDstatements : statement statements\n | statementstatement : assignment\n | keyword_call\n | remote_keyword_call\n | loop\n | custom_keyword\n | return_statement\n | if_statement\n | break_statement\n | continue_statementassignment : ID EQUALS expression\n | ID EQUALS keyword_call\n | ID EQUALS remote_keyword_callexpression : expr_atom\n | comparison_expr\n | arithmetic_exprexpr_atom : NUMBER\n | STRING\n | PLACEHOLDER\n | ID\n | boolean_expr\n | list_expr\n | dict_expr\n | LPAREN expression RPARENboolean_expr : TRUE\n | FALSElist_expr : LBRACKET list_items RBRACKET\n | LBRACKET RBRACKETlist_items : list_item\n | list_item COMMA list_itemslist_item : expressiondict_expr : LBRACE dict_items RBRACE\n | LBRACE RBRACEdict_items : dict_item\n | dict_item COMMA dict_itemsdict_item : expression COLON expressionloop : FOR ID IN RANGE LPAREN expression COMMA expression RPAREN DO statements ENDkeyword_call : LBRACKET ID RBRACKET COMMA parameter_list\n | LBRACKET ID RBRACKETparameter_list : parameter_itemsparameter_items : parameter_item COMMA parameter_items\n | parameter_itemparameter_item : ID COLON expressionteardown : TEARDOWN DO statements ENDdata_source : STRING USING IDcustom_keyword : FUNCTION ID LPAREN param_definitions RPAREN DO statements ENDparam_definitions : param_def_list\n | param_def_list : param_def COMMA param_def_list\n | param_defparam_def : ID EQUALS STRING\n | ID EQUALS NUMBER\n | IDreturn_statement : RETURN expressionbreak_statement : BREAKcontinue_statement : CONTINUEif_statement : IF expression DO statements END\n | IF expression DO statements elif_clauses END\n | IF expression DO statements ELSE statements END\n | IF expression DO statements elif_clauses ELSE statements ENDelif_clauses : elif_clause\n | elif_clause elif_clauseselif_clause : ELIF expression DO statementscomparison_expr : expr_atom GT expr_atom\n | expr_atom LT expr_atom\n | expr_atom GE expr_atom\n | expr_atom LE expr_atom\n | expr_atom EQ expr_atom\n | expr_atom NE expr_atomarithmetic_expr : expression PLUS expression\n | expression MINUS expression\n | expression TIMES expression\n | expression DIVIDE expression\n | expression MODULO expressionremote_keyword_call : ID PIPE LBRACKET ID RBRACKET COMMA parameter_list\n | ID PIPE LBRACKET ID RBRACKET'
|
10
10
|
|
11
|
-
_lr_action_items = {'ID':([0,2,4,5,6,7,8,9,10,11,12,13,14,15,16,20,27,28,29,30,31,32,37,38,39,42,47,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,69,70,71,72,73,74,75,76,77,78,80,82,83,84,85,86,87,89,90,91,92,93,94,95,96,97,98,99,100,103,107,110,116,117,118,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,145,146,148,149,150,151,152,153,154,157,161,163,165,167,168,169,173,175,176,180,181,182,183,186,187,189,190,193,195,],[26,26,-5,-6,26,-9,-26,-27,-28,-29,-30,-31,-32,-33,-34,41,49,50,58,58,-79,-80,-8,72,72,72,82,-78,-38,-39,-40,-41,-42,-43,-44,-45,-46,-47,58,-49,-50,58,58,26,-10,-18,-19,-11,115,-63,-13,-14,-15,-16,-44,-35,-36,-37,119,120,122,58,58,58,58,58,58,58,58,58,58,58,-52,-57,26,147,151,152,-94,-95,-96,-97,-98,-88,-89,-90,-91,-92,-93,-48,-51,58,-56,58,58,-12,115,-62,-64,-66,-69,-17,-100,58,122,-81,26,58,58,147,147,26,-82,26,-67,-65,-99,58,-83,26,-70,-84,26,-61,]),'LBRACKET':([0,2,4,5,6,7,8,9,10,11,12,13,14,15,16,29,30,31,32,37,40,47,48,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,69,70,71,72,73,75,76,77,78,80,82,83,84,85,86,90,91,92,93,94,95,96,97,98,99,100,103,107,110,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,145,148,149,150,151,152,153,154,161,163,165,167,173,175,176,180,181,182,183,186,187,189,190,193,195,],[20,20,-5,-6,20,-9,-26,-27,-28,-29,-30,-31,-32,-33,-34,65,65,-79,-80,-8,74,86,87,-78,-38,-39,-40,-41,-42,-43,-44,-45,-46,-47,65,-49,-50,65,65,20,-10,-18,-19,-11,-63,-13,-14,-15,-16,-44,-35,-36,-37,65,65,65,65,65,65,65,65,65,65,65,65,-52,-57,20,-94,-95,-96,-97,-98,-88,-89,-90,-91,-92,-93,-48,-51,65,-56,65,65,-12,-62,-64,-66,-69,-17,-100,65,-81,20,65,65,20,-82,20,-67,-65,-99,65,-83,20,-70,-84,20,-61,]),'FOR':([0,2,4,5,6,7,8,9,10,11,12,13,14,15,16,31,32,37,51,52,53,54,55,56,57,58,59,60,61,63,64,69,70,71,72,73,75,76,77,78,80,82,83,84,85,103,107,110,126,127,128,129,130,131,132,133,134,135,136,137,138,140,145,148,149,150,151,152,153,161,163,173,175,176,180,181,182,186,187,189,190,193,195,],[27,27,-5,-6,27,-9,-26,-27,-28,-29,-30,-31,-32,-33,-34,-79,-80,-8,-78,-38,-39,-40,-41,-42,-43,-44,-45,-46,-47,-49,-50,27,-10,-18,-19,-11,-63,-13,-14,-15,-16,-44,-35,-36,-37,-52,-57,27,-94,-95,-96,-97,-98,-88,-89,-90,-91,-92,-93,-48,-51,-56,-12,-62,-64,-66,-69,-17,-100,-81,27,27,-82,27,-67,-65,-99,-83,27,-70,-84,27,-61,]),'FUNCTION':([0,2,4,5,6,7,8,9,10,11,12,13,14,15,16,31,32,37,51,52,53,54,55,56,57,58,59,60,61,63,64,69,70,71,72,73,75,76,77,78,80,82,83,84,85,103,107,110,126,127,128,129,130,131,132,133,134,135,136,137,138,140,145,148,149,150,151,152,153,161,163,173,175,176,180,181,182,186,187,189,190,193,195,],[28,28,-5,-6,28,-9,-26,-27,-28,-29,-30,-31,-32,-33,-34,-79,-80,-8,-78,-38,-39,-40,-41,-42,-43,-44,-45,-46,-47,-49,-50,28,-10,-18,-19,-11,-63,-13,-14,-15,-16,-44,-35,-36,-37,-52,-57,28,-94,-95,-96,-97,-98,-88,-89,-90,-91,-92,-93,-48,-51,-56,-12,-62,-64,-66,-69,-17,-100,-81,28,28,-82,28,-67,-65,-99,-83,28,-70,-84,28,-61,]),'RETURN':([0,2,4,5,6,7,8,9,10,11,12,13,14,15,16,31,32,37,51,52,53,54,55,56,57,58,59,60,61,63,64,69,70,71,72,73,75,76,77,78,80,82,83,84,85,103,107,110,126,127,128,129,130,131,132,133,134,135,136,137,138,140,145,148,149,150,151,152,153,161,163,173,175,176,180,181,182,186,187,189,190,193,195,],[29,29,-5,-6,29,-9,-26,-27,-28,-29,-30,-31,-32,-33,-34,-79,-80,-8,-78,-38,-39,-40,-41,-42,-43,-44,-45,-46,-47,-49,-50,29,-10,-18,-19,-11,-63,-13,-14,-15,-16,-44,-35,-36,-37,-52,-57,29,-94,-95,-96,-97,-98,-88,-89,-90,-91,-92,-93,-48,-51,-56,-12,-62,-64,-66,-69,-17,-100,-81,29,29,-82,29,-67,-65,-99,-83,29,-70,-84,29,-61,]),'IF':([0,2,4,5,6,7,8,9,10,11,12,13,14,15,16,31,32,37,51,52,53,54,55,56,57,58,59,60,61,63,64,69,70,71,72,73,75,76,77,78,80,82,83,84,85,103,107,110,126,127,128,129,130,131,132,133,134,135,136,137,138,140,145,148,149,150,151,152,153,161,163,173,175,176,180,181,182,186,187,189,190,193,195,],[30,30,-5,-6,30,-9,-26,-27,-28,-29,-30,-31,-32,-33,-34,-79,-80,-8,-78,-38,-39,-40,-41,-42,-43,-44,-45,-46,-47,-49,-50,30,-10,-18,-19,-11,-63,-13,-14,-15,-16,-44,-35,-36,-37,-52,-57,30,-94,-95,-96,-97,-98,-88,-89,-90,-91,-92,-93,-48,-51,-56,-12,-62,-64,-66,-69,-17,-100,-81,30,30,-82,30,-67,-65,-99,-83,30,-70,-84,30,-61,]),'BREAK':([0,2,4,5,6,7,8,9,10,11,12,13,14,15,16,31,32,37,51,52,53,54,55,56,57,58,59,60,61,63,64,69,70,71,72,73,75,76,77,78,80,82,83,84,85,103,107,110,126,127,128,129,130,131,132,133,134,135,136,137,138,140,145,148,149,150,151,152,153,161,163,173,175,176,180,181,182,186,187,189,190,193,195,],[31,31,-5,-6,31,-9,-26,-27,-28,-29,-30,-31,-32,-33,-34,-79,-80,-8,-78,-38,-39,-40,-41,-42,-43,-44,-45,-46,-47,-49,-50,31,-10,-18,-19,-11,-63,-13,-14,-15,-16,-44,-35,-36,-37,-52,-57,31,-94,-95,-96,-97,-98,-88,-89,-90,-91,-92,-93,-48,-51,-56,-12,-62,-64,-66,-69,-17,-100,-81,31,31,-82,31,-67,-65,-99,-83,31,-70,-84,31,-61,]),'CONTINUE':([0,2,4,5,6,7,8,9,10,11,12,13,14,15,16,31,32,37,51,52,53,54,55,56,57,58,59,60,61,63,64,69,70,71,72,73,75,76,77,78,80,82,83,84,85,103,107,110,126,127,128,129,130,131,132,133,134,135,136,137,138,140,145,148,149,150,151,152,153,161,163,173,175,176,180,181,182,186,187,189,190,193,195,],[32,32,-5,-6,32,-9,-26,-27,-28,-29,-30,-31,-32,-33,-34,-79,-80,-8,-78,-38,-39,-40,-41,-42,-43,-44,-45,-46,-47,-49,-50,32,-10,-18,-19,-11,-63,-13,-14,-15,-16,-44,-35,-36,-37,-52,-57,32,-94,-95,-96,-97,-98,-88,-89,-90,-91,-92,-93,-48,-51,-56,-12,-62,-64,-66,-69,-17,-100,-81,32,32,-82,32,-67,-65,-99,-83,32,-70,-84,32,-61,]),'NAME_KEYWORD':([0,7,70,71,72,73,76,77,78,80,145,151,152,],[17,17,-10,-18,-19,-11,-13,-14,-15,-16,-12,-69,-17,]),'DESCRIPTION_KEYWORD':([0,7,70,71,72,73,76,77,78,80,145,151,152,],[18,18,-10,-18,-19,-11,-13,-14,-15,-16,-12,-69,-17,]),'TAGS_KEYWORD':([0,7,70,71,72,73,76,77,78,80,145,151,152,],[19,19,-10,-18,-19,-11,-13,-14,-15,-16,-12,-69,-17,]),'AUTHOR_KEYWORD':([0,7,70,71,72,73,76,77,78,80,145,151,152,],[21,21,-10,-18,-19,-11,-13,-14,-15,-16,-12,-69,-17,]),'DATE_KEYWORD':([0,7,70,71,72,73,76,77,78,80,145,151,152,],[22,22,-10,-18,-19,-11,-13,-14,-15,-16,-12,-69,-17,]),'DATA_KEYWORD':([0,7,70,71,72,73,76,77,78,80,145,151,152,],[23,23,-10,-18,-19,-11,-13,-14,-15,-16,-12,-69,-17,]),'IMPORT_KEYWORD':([0,7,70,71,72,73,76,77,78,80,145,151,152,],[24,24,-10,-18,-19,-11,-13,-14,-15,-16,-12,-69,-17,]),'REMOTE_KEYWORD':([0,7,70,71,72,73,76,77,78,80,145,151,152,],[25,25,-10,-18,-19,-11,-13,-14,-15,-16,-12,-69,-17,]),'$end':([1,3,6,8,9,10,11,12,13,14,15,16,31,32,33,34,36,51,52,53,54,55,56,57,58,59,60,61,63,64,68,75,82,83,84,85,103,107,126,127,128,129,130,131,132,133,134,135,136,137,138,140,144,148,149,150,153,161,175,180,181,182,186,189,190,195,],[0,-4,-25,-26,-27,-28,-29,-30,-31,-32,-33,-34,-79,-80,-2,-3,-24,-78,-38,-39,-40,-41,-42,-43,-44,-45,-46,-47,-49,-50,-1,-63,-44,-35,-36,-37,-52,-57,-94,-95,-96,-97,-98,-88,-89,-90,-91,-92,-93,-48,-51,-56,-68,-62,-64,-66,-100,-81,-82,-67,-65,-99,-83,-70,-84,-61,]),'TEARDOWN':([3,6,8,9,10,11,12,13,14,15,16,31,32,33,36,51,52,53,54,55,56,57,58,59,60,61,63,64,75,82,83,84,85,103,107,126,127,128,129,130,131,132,133,134,135,136,137,138,140,148,149,150,153,161,175,180,181,182,186,189,190,195,],[35,-25,-26,-27,-28,-29,-30,-31,-32,-33,-34,-79,-80,35,-24,-78,-38,-39,-40,-41,-42,-43,-44,-45,-46,-47,-49,-50,-63,-44,-35,-36,-37,-52,-57,-94,-95,-96,-97,-98,-88,-89,-90,-91,-92,-93,-48,-51,-56,-62,-64,-66,-100,-81,-82,-67,-65,-99,-83,-70,-84,-61,]),'END':([6,8,9,10,11,12,13,14,15,16,31,32,36,51,52,53,54,55,56,57,58,59,60,61,63,64,75,82,83,84,85,103,107,111,126,127,128,129,130,131,132,133,134,135,136,137,138,140,143,148,149,150,153,161,162,164,175,177,178,180,181,182,184,185,186,189,190,191,194,195,],[-25,-26,-27,-28,-29,-30,-31,-32,-33,-34,-79,-80,-24,-78,-38,-39,-40,-41,-42,-43,-44,-45,-46,-47,-49,-50,-63,-44,-35,-36,-37,-52,-57,144,-94,-95,-96,-97,-98,-88,-89,-90,-91,-92,-93,-48,-51,-56,161,-62,-64,-66,-100,-81,175,-85,-82,186,-86,-67,-65,-99,189,190,-83,-70,-84,-87,195,-61,]),'ELSE':([6,8,9,10,11,12,13,14,15,16,31,32,36,51,52,53,54,55,56,57,58,59,60,61,63,64,75,82,83,84,85,103,107,126,127,128,129,130,131,132,133,134,135,136,137,138,140,143,148,149,150,153,161,162,164,175,178,180,181,182,186,189,190,191,195,],[-25,-26,-27,-28,-29,-30,-31,-32,-33,-34,-79,-80,-24,-78,-38,-39,-40,-41,-42,-43,-44,-45,-46,-47,-49,-50,-63,-44,-35,-36,-37,-52,-57,-94,-95,-96,-97,-98,-88,-89,-90,-91,-92,-93,-48,-51,-56,163,-62,-64,-66,-100,-81,176,-85,-82,-86,-67,-65,-99,-83,-70,-84,-87,-61,]),'ELIF':([6,8,9,10,11,12,13,14,15,16,31,32,36,51,52,53,54,55,56,57,58,59,60,61,63,64,75,82,83,84,85,103,107,126,127,128,129,130,131,132,133,134,135,136,137,138,140,143,148,149,150,153,161,164,175,180,181,182,186,189,190,191,195,],[-25,-26,-27,-28,-29,-30,-31,-32,-33,-34,-79,-80,-24,-78,-38,-39,-40,-41,-42,-43,-44,-45,-46,-47,-49,-50,-63,-44,-35,-36,-37,-52,-57,-94,-95,-96,-97,-98,-88,-89,-90,-91,-92,-93,-48,-51,-56,165,-62,-64,-66,-100,-81,165,-82,-67,-65,-99,-83,-70,-84,-87,-61,]),'COLON':([17,18,19,21,22,23,24,25,52,53,54,55,56,57,58,59,60,61,63,64,103,107,109,126,127,128,129,130,131,132,133,134,135,136,137,138,140,147,],[38,39,40,42,43,44,45,46,-38,-39,-40,-41,-42,-43,-44,-45,-46,-47,-49,-50,-52,-57,142,-94,-95,-96,-97,-98,-88,-89,-90,-91,-92,-93,-48,-51,-56,167,]),'EQUALS':([26,122,],[47,155,]),'PIPE':([26,82,],[48,48,]),'NUMBER':([29,30,47,62,65,66,86,90,91,92,93,94,95,96,97,98,99,100,139,141,142,154,155,165,167,183,],[55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,172,55,55,55,]),'STRING':([29,30,38,39,42,44,45,46,47,62,65,66,74,86,90,91,92,93,94,95,96,97,98,99,100,139,141,142,146,154,155,165,167,183,],[56,56,71,71,71,79,80,81,56,56,56,56,114,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,114,56,171,56,56,56,]),'PLACEHOLDER':([29,30,47,62,65,66,86,90,91,92,93,94,95,96,97,98,99,100,139,141,142,154,165,167,183,],[57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,]),'LPAREN':([29,30,47,50,62,65,66,86,90,91,92,93,94,95,96,97,98,99,100,121,139,141,142,154,165,167,183,],[62,62,62,89,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,154,62,62,62,62,62,62,62,]),'TRUE':([29,30,47,62,65,66,86,90,91,92,93,94,95,96,97,98,99,100,139,141,142,154,165,167,183,],[63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,]),'FALSE':([29,30,47,62,65,66,86,90,91,92,93,94,95,96,97,98,99,100,139,141,142,154,165,167,183,],[64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,]),'LBRACE':([29,30,47,62,65,66,86,90,91,92,93,94,95,96,97,98,99,100,139,141,142,154,165,167,183,],[66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,]),'DO':([35,52,53,54,55,56,57,58,59,60,61,63,64,67,103,107,126,127,128,129,130,131,132,133,134,135,136,137,138,140,156,179,192,],[69,-38,-39,-40,-41,-42,-43,-44,-45,-46,-47,-49,-50,110,-52,-57,-94,-95,-96,-97,-98,-88,-89,-90,-91,-92,-93,-48,-51,-56,173,187,193,]),'RBRACKET':([41,52,53,54,55,56,57,58,59,60,61,63,64,65,86,102,103,104,105,107,112,113,114,115,119,120,126,127,128,129,130,131,132,133,134,135,136,137,138,140,158,166,],[75,-38,-39,-40,-41,-42,-43,-44,-45,-46,-47,-49,-50,103,103,138,-52,-53,-55,-57,145,-21,-22,-23,75,153,-94,-95,-96,-97,-98,-88,-89,-90,-91,-92,-93,-48,-51,-56,-54,-20,]),'DATE':([43,],[77,]),'IN':([49,],[88,]),'PLUS':([51,52,53,54,55,56,57,58,59,60,61,63,64,67,82,83,101,103,105,107,109,119,126,127,128,129,130,131,132,133,134,135,136,137,138,140,160,170,179,180,188,],[90,-38,-39,-40,-41,-42,-43,-44,-45,-46,-47,-49,-50,90,-44,90,90,-52,90,-57,90,-44,-94,-95,-96,-97,-98,-88,-89,-90,-91,-92,-93,-48,-51,-56,90,90,90,90,90,]),'MINUS':([51,52,53,54,55,56,57,58,59,60,61,63,64,67,82,83,101,103,105,107,109,119,126,127,128,129,130,131,132,133,134,135,136,137,138,140,160,170,179,180,188,],[91,-38,-39,-40,-41,-42,-43,-44,-45,-46,-47,-49,-50,91,-44,91,91,-52,91,-57,91,-44,-94,-95,-96,-97,-98,-88,-89,-90,-91,-92,-93,-48,-51,-56,91,91,91,91,91,]),'TIMES':([51,52,53,54,55,56,57,58,59,60,61,63,64,67,82,83,101,103,105,107,109,119,126,127,128,129,130,131,132,133,134,135,136,137,138,140,160,170,179,180,188,],[92,-38,-39,-40,-41,-42,-43,-44,-45,-46,-47,-49,-50,92,-44,92,92,-52,92,-57,92,-44,92,92,-96,-97,-98,-88,-89,-90,-91,-92,-93,-48,-51,-56,92,92,92,92,92,]),'DIVIDE':([51,52,53,54,55,56,57,58,59,60,61,63,64,67,82,83,101,103,105,107,109,119,126,127,128,129,130,131,132,133,134,135,136,137,138,140,160,170,179,180,188,],[93,-38,-39,-40,-41,-42,-43,-44,-45,-46,-47,-49,-50,93,-44,93,93,-52,93,-57,93,-44,93,93,-96,-97,-98,-88,-89,-90,-91,-92,-93,-48,-51,-56,93,93,93,93,93,]),'MODULO':([51,52,53,54,55,56,57,58,59,60,61,63,64,67,82,83,101,103,105,107,109,119,126,127,128,129,130,131,132,133,134,135,136,137,138,140,160,170,179,180,188,],[94,-38,-39,-40,-41,-42,-43,-44,-45,-46,-47,-49,-50,94,-44,94,94,-52,94,-57,94,-44,94,94,-96,-97,-98,-88,-89,-90,-91,-92,-93,-48,-51,-56,94,94,94,94,94,]),'RPAREN':([52,53,54,55,56,57,58,59,60,61,63,64,89,101,103,107,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,140,171,172,174,188,],[-38,-39,-40,-41,-42,-43,-44,-45,-46,-47,-49,-50,-72,137,-52,-57,-77,156,-71,-74,-94,-95,-96,-97,-98,-88,-89,-90,-91,-92,-93,-48,-51,-56,-75,-76,-73,192,]),'COMMA':([52,53,54,55,56,57,58,59,60,61,63,64,75,103,104,105,107,108,113,114,115,119,122,125,126,127,128,129,130,131,132,133,134,135,136,137,138,140,150,153,160,170,171,172,180,],[-38,-39,-40,-41,-42,-43,-44,-45,-46,-47,-49,-50,116,-52,139,-55,-57,141,146,-22,-23,-44,-77,157,-94,-95,-96,-97,-98,-88,-89,-90,-91,-92,-93,-48,-51,-56,168,169,-60,183,-75,-76,-67,]),'RBRACE':([52,53,54,55,56,57,58,59,60,61,63,64,66,103,106,107,108,126,127,128,129,130,131,132,133,134,135,136,137,138,140,159,160,],[-38,-39,-40,-41,-42,-43,-44,-45,-46,-47,-49,-50,107,-52,140,-57,-58,-94,-95,-96,-97,-98,-88,-89,-90,-91,-92,-93,-48,-51,-56,-59,-60,]),'GT':([52,55,56,57,58,59,60,61,63,64,82,103,107,119,137,138,140,],[95,-41,-42,-43,-44,-45,-46,-47,-49,-50,-44,-52,-57,-44,-48,-51,-56,]),'LT':([52,55,56,57,58,59,60,61,63,64,82,103,107,119,137,138,140,],[96,-41,-42,-43,-44,-45,-46,-47,-49,-50,-44,-52,-57,-44,-48,-51,-56,]),'GE':([52,55,56,57,58,59,60,61,63,64,82,103,107,119,137,138,140,],[97,-41,-42,-43,-44,-45,-46,-47,-49,-50,-44,-52,-57,-44,-48,-51,-56,]),'LE':([52,55,56,57,58,59,60,61,63,64,82,103,107,119,137,138,140,],[98,-41,-42,-43,-44,-45,-46,-47,-49,-50,-44,-52,-57,-44,-48,-51,-56,]),'EQ':([52,55,56,57,58,59,60,61,63,64,82,103,107,119,137,138,140,],[99,-41,-42,-43,-44,-45,-46,-47,-49,-50,-44,-52,-57,-44,-48,-51,-56,]),'NE':([52,55,56,57,58,59,60,61,63,64,82,103,107,119,137,138,140,],[100,-41,-42,-43,-44,-45,-46,-47,-49,-50,-44,-52,-57,-44,-48,-51,-56,]),'USING':([79,],[117,]),'AS':([81,],[118,]),'RANGE':([88,],[121,]),}
|
11
|
+
_lr_action_items = {'ID':([0,2,4,5,6,7,8,9,10,11,12,13,14,15,16,20,27,28,29,30,31,32,37,38,39,42,47,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,69,70,71,72,73,74,75,76,77,78,79,81,83,84,85,86,87,88,90,91,92,93,94,95,96,97,98,99,100,101,104,108,111,117,118,119,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,146,147,149,150,151,152,153,154,155,158,162,164,166,168,169,170,174,176,177,181,182,183,184,187,188,190,191,194,196,],[26,26,-5,-6,26,-9,-27,-28,-29,-30,-31,-32,-33,-34,-35,41,49,50,58,58,-80,-81,-8,72,72,72,83,-79,-39,-40,-41,-42,-43,-44,-45,-46,-47,-48,58,-50,-51,58,58,26,-10,-19,-20,-11,116,-64,-13,-14,-15,-16,-17,-45,-36,-37,-38,120,121,123,58,58,58,58,58,58,58,58,58,58,58,-53,-58,26,148,152,153,-95,-96,-97,-98,-99,-89,-90,-91,-92,-93,-94,-49,-52,58,-57,58,58,-12,116,-63,-65,-67,-70,-18,-101,58,123,-82,26,58,58,148,148,26,-83,26,-68,-66,-100,58,-84,26,-71,-85,26,-62,]),'LBRACKET':([0,2,4,5,6,7,8,9,10,11,12,13,14,15,16,29,30,31,32,37,40,47,48,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,69,70,71,72,73,75,76,77,78,79,81,83,84,85,86,87,91,92,93,94,95,96,97,98,99,100,101,104,108,111,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,146,149,150,151,152,153,154,155,162,164,166,168,174,176,177,181,182,183,184,187,188,190,191,194,196,],[20,20,-5,-6,20,-9,-27,-28,-29,-30,-31,-32,-33,-34,-35,65,65,-80,-81,-8,74,87,88,-79,-39,-40,-41,-42,-43,-44,-45,-46,-47,-48,65,-50,-51,65,65,20,-10,-19,-20,-11,-64,-13,-14,-15,-16,-17,-45,-36,-37,-38,65,65,65,65,65,65,65,65,65,65,65,65,-53,-58,20,-95,-96,-97,-98,-99,-89,-90,-91,-92,-93,-94,-49,-52,65,-57,65,65,-12,-63,-65,-67,-70,-18,-101,65,-82,20,65,65,20,-83,20,-68,-66,-100,65,-84,20,-71,-85,20,-62,]),'FOR':([0,2,4,5,6,7,8,9,10,11,12,13,14,15,16,31,32,37,51,52,53,54,55,56,57,58,59,60,61,63,64,69,70,71,72,73,75,76,77,78,79,81,83,84,85,86,104,108,111,127,128,129,130,131,132,133,134,135,136,137,138,139,141,146,149,150,151,152,153,154,162,164,174,176,177,181,182,183,187,188,190,191,194,196,],[27,27,-5,-6,27,-9,-27,-28,-29,-30,-31,-32,-33,-34,-35,-80,-81,-8,-79,-39,-40,-41,-42,-43,-44,-45,-46,-47,-48,-50,-51,27,-10,-19,-20,-11,-64,-13,-14,-15,-16,-17,-45,-36,-37,-38,-53,-58,27,-95,-96,-97,-98,-99,-89,-90,-91,-92,-93,-94,-49,-52,-57,-12,-63,-65,-67,-70,-18,-101,-82,27,27,-83,27,-68,-66,-100,-84,27,-71,-85,27,-62,]),'FUNCTION':([0,2,4,5,6,7,8,9,10,11,12,13,14,15,16,31,32,37,51,52,53,54,55,56,57,58,59,60,61,63,64,69,70,71,72,73,75,76,77,78,79,81,83,84,85,86,104,108,111,127,128,129,130,131,132,133,134,135,136,137,138,139,141,146,149,150,151,152,153,154,162,164,174,176,177,181,182,183,187,188,190,191,194,196,],[28,28,-5,-6,28,-9,-27,-28,-29,-30,-31,-32,-33,-34,-35,-80,-81,-8,-79,-39,-40,-41,-42,-43,-44,-45,-46,-47,-48,-50,-51,28,-10,-19,-20,-11,-64,-13,-14,-15,-16,-17,-45,-36,-37,-38,-53,-58,28,-95,-96,-97,-98,-99,-89,-90,-91,-92,-93,-94,-49,-52,-57,-12,-63,-65,-67,-70,-18,-101,-82,28,28,-83,28,-68,-66,-100,-84,28,-71,-85,28,-62,]),'RETURN':([0,2,4,5,6,7,8,9,10,11,12,13,14,15,16,31,32,37,51,52,53,54,55,56,57,58,59,60,61,63,64,69,70,71,72,73,75,76,77,78,79,81,83,84,85,86,104,108,111,127,128,129,130,131,132,133,134,135,136,137,138,139,141,146,149,150,151,152,153,154,162,164,174,176,177,181,182,183,187,188,190,191,194,196,],[29,29,-5,-6,29,-9,-27,-28,-29,-30,-31,-32,-33,-34,-35,-80,-81,-8,-79,-39,-40,-41,-42,-43,-44,-45,-46,-47,-48,-50,-51,29,-10,-19,-20,-11,-64,-13,-14,-15,-16,-17,-45,-36,-37,-38,-53,-58,29,-95,-96,-97,-98,-99,-89,-90,-91,-92,-93,-94,-49,-52,-57,-12,-63,-65,-67,-70,-18,-101,-82,29,29,-83,29,-68,-66,-100,-84,29,-71,-85,29,-62,]),'IF':([0,2,4,5,6,7,8,9,10,11,12,13,14,15,16,31,32,37,51,52,53,54,55,56,57,58,59,60,61,63,64,69,70,71,72,73,75,76,77,78,79,81,83,84,85,86,104,108,111,127,128,129,130,131,132,133,134,135,136,137,138,139,141,146,149,150,151,152,153,154,162,164,174,176,177,181,182,183,187,188,190,191,194,196,],[30,30,-5,-6,30,-9,-27,-28,-29,-30,-31,-32,-33,-34,-35,-80,-81,-8,-79,-39,-40,-41,-42,-43,-44,-45,-46,-47,-48,-50,-51,30,-10,-19,-20,-11,-64,-13,-14,-15,-16,-17,-45,-36,-37,-38,-53,-58,30,-95,-96,-97,-98,-99,-89,-90,-91,-92,-93,-94,-49,-52,-57,-12,-63,-65,-67,-70,-18,-101,-82,30,30,-83,30,-68,-66,-100,-84,30,-71,-85,30,-62,]),'BREAK':([0,2,4,5,6,7,8,9,10,11,12,13,14,15,16,31,32,37,51,52,53,54,55,56,57,58,59,60,61,63,64,69,70,71,72,73,75,76,77,78,79,81,83,84,85,86,104,108,111,127,128,129,130,131,132,133,134,135,136,137,138,139,141,146,149,150,151,152,153,154,162,164,174,176,177,181,182,183,187,188,190,191,194,196,],[31,31,-5,-6,31,-9,-27,-28,-29,-30,-31,-32,-33,-34,-35,-80,-81,-8,-79,-39,-40,-41,-42,-43,-44,-45,-46,-47,-48,-50,-51,31,-10,-19,-20,-11,-64,-13,-14,-15,-16,-17,-45,-36,-37,-38,-53,-58,31,-95,-96,-97,-98,-99,-89,-90,-91,-92,-93,-94,-49,-52,-57,-12,-63,-65,-67,-70,-18,-101,-82,31,31,-83,31,-68,-66,-100,-84,31,-71,-85,31,-62,]),'CONTINUE':([0,2,4,5,6,7,8,9,10,11,12,13,14,15,16,31,32,37,51,52,53,54,55,56,57,58,59,60,61,63,64,69,70,71,72,73,75,76,77,78,79,81,83,84,85,86,104,108,111,127,128,129,130,131,132,133,134,135,136,137,138,139,141,146,149,150,151,152,153,154,162,164,174,176,177,181,182,183,187,188,190,191,194,196,],[32,32,-5,-6,32,-9,-27,-28,-29,-30,-31,-32,-33,-34,-35,-80,-81,-8,-79,-39,-40,-41,-42,-43,-44,-45,-46,-47,-48,-50,-51,32,-10,-19,-20,-11,-64,-13,-14,-15,-16,-17,-45,-36,-37,-38,-53,-58,32,-95,-96,-97,-98,-99,-89,-90,-91,-92,-93,-94,-49,-52,-57,-12,-63,-65,-67,-70,-18,-101,-82,32,32,-83,32,-68,-66,-100,-84,32,-71,-85,32,-62,]),'NAME_KEYWORD':([0,7,70,71,72,73,76,77,78,79,81,146,152,153,],[17,17,-10,-19,-20,-11,-13,-14,-15,-16,-17,-12,-70,-18,]),'DESCRIPTION_KEYWORD':([0,7,70,71,72,73,76,77,78,79,81,146,152,153,],[18,18,-10,-19,-20,-11,-13,-14,-15,-16,-17,-12,-70,-18,]),'TAGS_KEYWORD':([0,7,70,71,72,73,76,77,78,79,81,146,152,153,],[19,19,-10,-19,-20,-11,-13,-14,-15,-16,-17,-12,-70,-18,]),'AUTHOR_KEYWORD':([0,7,70,71,72,73,76,77,78,79,81,146,152,153,],[21,21,-10,-19,-20,-11,-13,-14,-15,-16,-17,-12,-70,-18,]),'DATE_KEYWORD':([0,7,70,71,72,73,76,77,78,79,81,146,152,153,],[22,22,-10,-19,-20,-11,-13,-14,-15,-16,-17,-12,-70,-18,]),'DATA_KEYWORD':([0,7,70,71,72,73,76,77,78,79,81,146,152,153,],[23,23,-10,-19,-20,-11,-13,-14,-15,-16,-17,-12,-70,-18,]),'IMPORT_KEYWORD':([0,7,70,71,72,73,76,77,78,79,81,146,152,153,],[24,24,-10,-19,-20,-11,-13,-14,-15,-16,-17,-12,-70,-18,]),'REMOTE_KEYWORD':([0,7,70,71,72,73,76,77,78,79,81,146,152,153,],[25,25,-10,-19,-20,-11,-13,-14,-15,-16,-17,-12,-70,-18,]),'$end':([1,3,6,8,9,10,11,12,13,14,15,16,31,32,33,34,36,51,52,53,54,55,56,57,58,59,60,61,63,64,68,75,83,84,85,86,104,108,127,128,129,130,131,132,133,134,135,136,137,138,139,141,145,149,150,151,154,162,176,181,182,183,187,190,191,196,],[0,-4,-26,-27,-28,-29,-30,-31,-32,-33,-34,-35,-80,-81,-2,-3,-25,-79,-39,-40,-41,-42,-43,-44,-45,-46,-47,-48,-50,-51,-1,-64,-45,-36,-37,-38,-53,-58,-95,-96,-97,-98,-99,-89,-90,-91,-92,-93,-94,-49,-52,-57,-69,-63,-65,-67,-101,-82,-83,-68,-66,-100,-84,-71,-85,-62,]),'TEARDOWN':([3,6,8,9,10,11,12,13,14,15,16,31,32,33,36,51,52,53,54,55,56,57,58,59,60,61,63,64,75,83,84,85,86,104,108,127,128,129,130,131,132,133,134,135,136,137,138,139,141,149,150,151,154,162,176,181,182,183,187,190,191,196,],[35,-26,-27,-28,-29,-30,-31,-32,-33,-34,-35,-80,-81,35,-25,-79,-39,-40,-41,-42,-43,-44,-45,-46,-47,-48,-50,-51,-64,-45,-36,-37,-38,-53,-58,-95,-96,-97,-98,-99,-89,-90,-91,-92,-93,-94,-49,-52,-57,-63,-65,-67,-101,-82,-83,-68,-66,-100,-84,-71,-85,-62,]),'END':([6,8,9,10,11,12,13,14,15,16,31,32,36,51,52,53,54,55,56,57,58,59,60,61,63,64,75,83,84,85,86,104,108,112,127,128,129,130,131,132,133,134,135,136,137,138,139,141,144,149,150,151,154,162,163,165,176,178,179,181,182,183,185,186,187,190,191,192,195,196,],[-26,-27,-28,-29,-30,-31,-32,-33,-34,-35,-80,-81,-25,-79,-39,-40,-41,-42,-43,-44,-45,-46,-47,-48,-50,-51,-64,-45,-36,-37,-38,-53,-58,145,-95,-96,-97,-98,-99,-89,-90,-91,-92,-93,-94,-49,-52,-57,162,-63,-65,-67,-101,-82,176,-86,-83,187,-87,-68,-66,-100,190,191,-84,-71,-85,-88,196,-62,]),'ELSE':([6,8,9,10,11,12,13,14,15,16,31,32,36,51,52,53,54,55,56,57,58,59,60,61,63,64,75,83,84,85,86,104,108,127,128,129,130,131,132,133,134,135,136,137,138,139,141,144,149,150,151,154,162,163,165,176,179,181,182,183,187,190,191,192,196,],[-26,-27,-28,-29,-30,-31,-32,-33,-34,-35,-80,-81,-25,-79,-39,-40,-41,-42,-43,-44,-45,-46,-47,-48,-50,-51,-64,-45,-36,-37,-38,-53,-58,-95,-96,-97,-98,-99,-89,-90,-91,-92,-93,-94,-49,-52,-57,164,-63,-65,-67,-101,-82,177,-86,-83,-87,-68,-66,-100,-84,-71,-85,-88,-62,]),'ELIF':([6,8,9,10,11,12,13,14,15,16,31,32,36,51,52,53,54,55,56,57,58,59,60,61,63,64,75,83,84,85,86,104,108,127,128,129,130,131,132,133,134,135,136,137,138,139,141,144,149,150,151,154,162,165,176,181,182,183,187,190,191,192,196,],[-26,-27,-28,-29,-30,-31,-32,-33,-34,-35,-80,-81,-25,-79,-39,-40,-41,-42,-43,-44,-45,-46,-47,-48,-50,-51,-64,-45,-36,-37,-38,-53,-58,-95,-96,-97,-98,-99,-89,-90,-91,-92,-93,-94,-49,-52,-57,166,-63,-65,-67,-101,-82,166,-83,-68,-66,-100,-84,-71,-85,-88,-62,]),'COLON':([17,18,19,21,22,23,24,25,52,53,54,55,56,57,58,59,60,61,63,64,104,108,110,127,128,129,130,131,132,133,134,135,136,137,138,139,141,148,],[38,39,40,42,43,44,45,46,-39,-40,-41,-42,-43,-44,-45,-46,-47,-48,-50,-51,-53,-58,143,-95,-96,-97,-98,-99,-89,-90,-91,-92,-93,-94,-49,-52,-57,168,]),'EQUALS':([26,123,],[47,156,]),'PIPE':([26,83,],[48,48,]),'NUMBER':([29,30,47,62,65,66,87,91,92,93,94,95,96,97,98,99,100,101,140,142,143,155,156,166,168,184,],[55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,173,55,55,55,]),'STRING':([29,30,38,39,42,43,44,45,46,47,62,65,66,74,87,91,92,93,94,95,96,97,98,99,100,101,140,142,143,147,155,156,166,168,184,],[56,56,71,71,71,78,80,81,82,56,56,56,56,115,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,115,56,172,56,56,56,]),'PLACEHOLDER':([29,30,47,62,65,66,87,91,92,93,94,95,96,97,98,99,100,101,140,142,143,155,166,168,184,],[57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,]),'LPAREN':([29,30,47,50,62,65,66,87,91,92,93,94,95,96,97,98,99,100,101,122,140,142,143,155,166,168,184,],[62,62,62,90,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,155,62,62,62,62,62,62,62,]),'TRUE':([29,30,47,62,65,66,87,91,92,93,94,95,96,97,98,99,100,101,140,142,143,155,166,168,184,],[63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,]),'FALSE':([29,30,47,62,65,66,87,91,92,93,94,95,96,97,98,99,100,101,140,142,143,155,166,168,184,],[64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,]),'LBRACE':([29,30,47,62,65,66,87,91,92,93,94,95,96,97,98,99,100,101,140,142,143,155,166,168,184,],[66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,]),'DO':([35,52,53,54,55,56,57,58,59,60,61,63,64,67,104,108,127,128,129,130,131,132,133,134,135,136,137,138,139,141,157,180,193,],[69,-39,-40,-41,-42,-43,-44,-45,-46,-47,-48,-50,-51,111,-53,-58,-95,-96,-97,-98,-99,-89,-90,-91,-92,-93,-94,-49,-52,-57,174,188,194,]),'RBRACKET':([41,52,53,54,55,56,57,58,59,60,61,63,64,65,87,103,104,105,106,108,113,114,115,116,120,121,127,128,129,130,131,132,133,134,135,136,137,138,139,141,159,167,],[75,-39,-40,-41,-42,-43,-44,-45,-46,-47,-48,-50,-51,104,104,139,-53,-54,-56,-58,146,-22,-23,-24,75,154,-95,-96,-97,-98,-99,-89,-90,-91,-92,-93,-94,-49,-52,-57,-55,-21,]),'DATE':([43,],[77,]),'IN':([49,],[89,]),'PLUS':([51,52,53,54,55,56,57,58,59,60,61,63,64,67,83,84,102,104,106,108,110,120,127,128,129,130,131,132,133,134,135,136,137,138,139,141,161,171,180,181,189,],[91,-39,-40,-41,-42,-43,-44,-45,-46,-47,-48,-50,-51,91,-45,91,91,-53,91,-58,91,-45,-95,-96,-97,-98,-99,-89,-90,-91,-92,-93,-94,-49,-52,-57,91,91,91,91,91,]),'MINUS':([51,52,53,54,55,56,57,58,59,60,61,63,64,67,83,84,102,104,106,108,110,120,127,128,129,130,131,132,133,134,135,136,137,138,139,141,161,171,180,181,189,],[92,-39,-40,-41,-42,-43,-44,-45,-46,-47,-48,-50,-51,92,-45,92,92,-53,92,-58,92,-45,-95,-96,-97,-98,-99,-89,-90,-91,-92,-93,-94,-49,-52,-57,92,92,92,92,92,]),'TIMES':([51,52,53,54,55,56,57,58,59,60,61,63,64,67,83,84,102,104,106,108,110,120,127,128,129,130,131,132,133,134,135,136,137,138,139,141,161,171,180,181,189,],[93,-39,-40,-41,-42,-43,-44,-45,-46,-47,-48,-50,-51,93,-45,93,93,-53,93,-58,93,-45,93,93,-97,-98,-99,-89,-90,-91,-92,-93,-94,-49,-52,-57,93,93,93,93,93,]),'DIVIDE':([51,52,53,54,55,56,57,58,59,60,61,63,64,67,83,84,102,104,106,108,110,120,127,128,129,130,131,132,133,134,135,136,137,138,139,141,161,171,180,181,189,],[94,-39,-40,-41,-42,-43,-44,-45,-46,-47,-48,-50,-51,94,-45,94,94,-53,94,-58,94,-45,94,94,-97,-98,-99,-89,-90,-91,-92,-93,-94,-49,-52,-57,94,94,94,94,94,]),'MODULO':([51,52,53,54,55,56,57,58,59,60,61,63,64,67,83,84,102,104,106,108,110,120,127,128,129,130,131,132,133,134,135,136,137,138,139,141,161,171,180,181,189,],[95,-39,-40,-41,-42,-43,-44,-45,-46,-47,-48,-50,-51,95,-45,95,95,-53,95,-58,95,-45,95,95,-97,-98,-99,-89,-90,-91,-92,-93,-94,-49,-52,-57,95,95,95,95,95,]),'RPAREN':([52,53,54,55,56,57,58,59,60,61,63,64,90,102,104,108,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,141,172,173,175,189,],[-39,-40,-41,-42,-43,-44,-45,-46,-47,-48,-50,-51,-73,138,-53,-58,-78,157,-72,-75,-95,-96,-97,-98,-99,-89,-90,-91,-92,-93,-94,-49,-52,-57,-76,-77,-74,193,]),'COMMA':([52,53,54,55,56,57,58,59,60,61,63,64,75,104,105,106,108,109,114,115,116,120,123,126,127,128,129,130,131,132,133,134,135,136,137,138,139,141,151,154,161,171,172,173,181,],[-39,-40,-41,-42,-43,-44,-45,-46,-47,-48,-50,-51,117,-53,140,-56,-58,142,147,-23,-24,-45,-78,158,-95,-96,-97,-98,-99,-89,-90,-91,-92,-93,-94,-49,-52,-57,169,170,-61,184,-76,-77,-68,]),'RBRACE':([52,53,54,55,56,57,58,59,60,61,63,64,66,104,107,108,109,127,128,129,130,131,132,133,134,135,136,137,138,139,141,160,161,],[-39,-40,-41,-42,-43,-44,-45,-46,-47,-48,-50,-51,108,-53,141,-58,-59,-95,-96,-97,-98,-99,-89,-90,-91,-92,-93,-94,-49,-52,-57,-60,-61,]),'GT':([52,55,56,57,58,59,60,61,63,64,83,104,108,120,138,139,141,],[96,-42,-43,-44,-45,-46,-47,-48,-50,-51,-45,-53,-58,-45,-49,-52,-57,]),'LT':([52,55,56,57,58,59,60,61,63,64,83,104,108,120,138,139,141,],[97,-42,-43,-44,-45,-46,-47,-48,-50,-51,-45,-53,-58,-45,-49,-52,-57,]),'GE':([52,55,56,57,58,59,60,61,63,64,83,104,108,120,138,139,141,],[98,-42,-43,-44,-45,-46,-47,-48,-50,-51,-45,-53,-58,-45,-49,-52,-57,]),'LE':([52,55,56,57,58,59,60,61,63,64,83,104,108,120,138,139,141,],[99,-42,-43,-44,-45,-46,-47,-48,-50,-51,-45,-53,-58,-45,-49,-52,-57,]),'EQ':([52,55,56,57,58,59,60,61,63,64,83,104,108,120,138,139,141,],[100,-42,-43,-44,-45,-46,-47,-48,-50,-51,-45,-53,-58,-45,-49,-52,-57,]),'NE':([52,55,56,57,58,59,60,61,63,64,83,104,108,120,138,139,141,],[101,-42,-43,-44,-45,-46,-47,-48,-50,-51,-45,-53,-58,-45,-49,-52,-57,]),'USING':([80,],[118,]),'AS':([82,],[119,]),'RANGE':([89,],[122,]),}
|
12
12
|
|
13
13
|
_lr_action = {}
|
14
14
|
for _k, _v in _lr_action_items.items():
|
@@ -17,7 +17,7 @@ for _k, _v in _lr_action_items.items():
|
|
17
17
|
_lr_action[_x][_k] = _y
|
18
18
|
del _lr_action_items
|
19
19
|
|
20
|
-
_lr_goto_items = {'start':([0,],[1,]),'metadata':([0,],[2,]),'statements':([0,2,6,69,
|
20
|
+
_lr_goto_items = {'start':([0,],[1,]),'metadata':([0,],[2,]),'statements':([0,2,6,69,111,164,174,177,188,194,],[3,33,36,112,144,178,185,186,192,195,]),'metadata_items':([0,7,],[4,37,]),'empty':([0,],[5,]),'statement':([0,2,6,69,111,164,174,177,188,194,],[6,6,6,6,6,6,6,6,6,6,]),'metadata_item':([0,7,],[7,7,]),'assignment':([0,2,6,69,111,164,174,177,188,194,],[8,8,8,8,8,8,8,8,8,8,]),'keyword_call':([0,2,6,47,69,111,164,174,177,188,194,],[9,9,9,85,9,9,9,9,9,9,9,]),'remote_keyword_call':([0,2,6,47,69,111,164,174,177,188,194,],[10,10,10,86,10,10,10,10,10,10,10,]),'loop':([0,2,6,69,111,164,174,177,188,194,],[11,11,11,11,11,11,11,11,11,11,]),'custom_keyword':([0,2,6,69,111,164,174,177,188,194,],[12,12,12,12,12,12,12,12,12,12,]),'return_statement':([0,2,6,69,111,164,174,177,188,194,],[13,13,13,13,13,13,13,13,13,13,]),'if_statement':([0,2,6,69,111,164,174,177,188,194,],[14,14,14,14,14,14,14,14,14,14,]),'break_statement':([0,2,6,69,111,164,174,177,188,194,],[15,15,15,15,15,15,15,15,15,15,]),'continue_statement':([0,2,6,69,111,164,174,177,188,194,],[16,16,16,16,16,16,16,16,16,16,]),'teardown':([3,33,],[34,68,]),'expression':([29,30,47,62,65,66,87,91,92,93,94,95,140,142,143,155,166,168,184,],[51,67,84,102,106,110,106,127,128,129,130,131,106,110,161,171,180,181,189,]),'expr_atom':([29,30,47,62,65,66,87,91,92,93,94,95,96,97,98,99,100,101,140,142,143,155,166,168,184,],[52,52,52,52,52,52,52,52,52,52,52,52,132,133,134,135,136,137,52,52,52,52,52,52,52,]),'comparison_expr':([29,30,47,62,65,66,87,91,92,93,94,95,140,142,143,155,166,168,184,],[53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,]),'arithmetic_expr':([29,30,47,62,65,66,87,91,92,93,94,95,140,142,143,155,166,168,184,],[54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,]),'boolean_expr':([29,30,47,62,65,66,87,91,92,93,94,95,96,97,98,99,100,101,140,142,143,155,166,168,184,],[59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,]),'list_expr':([29,30,47,62,65,66,87,91,92,93,94,95,96,97,98,99,100,101,140,142,143,155,166,168,184,],[60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,]),'dict_expr':([29,30,47,62,65,66,87,91,92,93,94,95,96,97,98,99,100,101,140,142,143,155,166,168,184,],[61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,]),'metadata_value':([38,39,42,],[70,73,76,]),'data_source':([44,],[79,]),'list_items':([65,87,140,],[103,103,159,]),'list_item':([65,87,140,],[105,105,105,]),'dict_items':([66,142,],[107,160,]),'dict_item':([66,142,],[109,109,]),'tags':([74,147,],[113,167,]),'tag':([74,147,],[114,114,]),'param_definitions':([90,],[124,]),'param_def_list':([90,158,],[125,175,]),'param_def':([90,158,],[126,126,]),'parameter_list':([117,170,],[149,183,]),'parameter_items':([117,169,170,],[150,182,150,]),'parameter_item':([117,169,170,],[151,151,151,]),'elif_clauses':([144,165,],[163,179,]),'elif_clause':([144,165,],[165,165,]),}
|
21
21
|
|
22
22
|
_lr_goto = {}
|
23
23
|
for _k, _v in _lr_goto_items.items():
|
@@ -41,90 +41,91 @@ _lr_productions = [
|
|
41
41
|
('metadata_item -> TAGS_KEYWORD COLON LBRACKET tags RBRACKET','metadata_item',5,'p_metadata_item','parser.py',67),
|
42
42
|
('metadata_item -> AUTHOR_KEYWORD COLON metadata_value','metadata_item',3,'p_metadata_item','parser.py',68),
|
43
43
|
('metadata_item -> DATE_KEYWORD COLON DATE','metadata_item',3,'p_metadata_item','parser.py',69),
|
44
|
-
('metadata_item ->
|
45
|
-
('metadata_item ->
|
46
|
-
('metadata_item ->
|
47
|
-
('
|
48
|
-
('metadata_value ->
|
49
|
-
('
|
50
|
-
('tags -> tag','tags',
|
51
|
-
('
|
52
|
-
('tag ->
|
53
|
-
('
|
54
|
-
('statements -> statement','statements',
|
55
|
-
('
|
56
|
-
('statement ->
|
57
|
-
('statement ->
|
58
|
-
('statement ->
|
59
|
-
('statement ->
|
60
|
-
('statement ->
|
61
|
-
('statement ->
|
62
|
-
('statement ->
|
63
|
-
('statement ->
|
64
|
-
('
|
65
|
-
('assignment -> ID EQUALS
|
66
|
-
('assignment -> ID EQUALS
|
67
|
-
('
|
68
|
-
('expression ->
|
69
|
-
('expression ->
|
70
|
-
('
|
71
|
-
('expr_atom ->
|
72
|
-
('expr_atom ->
|
73
|
-
('expr_atom ->
|
74
|
-
('expr_atom ->
|
75
|
-
('expr_atom ->
|
76
|
-
('expr_atom ->
|
77
|
-
('expr_atom ->
|
78
|
-
('
|
79
|
-
('boolean_expr ->
|
80
|
-
('
|
81
|
-
('list_expr -> LBRACKET RBRACKET','list_expr',
|
82
|
-
('
|
83
|
-
('list_items -> list_item
|
84
|
-
('
|
85
|
-
('
|
86
|
-
('dict_expr -> LBRACE RBRACE','dict_expr',
|
87
|
-
('
|
88
|
-
('dict_items -> dict_item
|
89
|
-
('
|
90
|
-
('
|
91
|
-
('
|
92
|
-
('keyword_call -> LBRACKET ID RBRACKET','keyword_call',
|
93
|
-
('
|
94
|
-
('
|
95
|
-
('parameter_items -> parameter_item','parameter_items',
|
96
|
-
('
|
97
|
-
('
|
98
|
-
('
|
99
|
-
('
|
100
|
-
('
|
101
|
-
('param_definitions ->
|
102
|
-
('
|
103
|
-
('param_def_list -> param_def','param_def_list',
|
104
|
-
('
|
105
|
-
('param_def -> ID EQUALS
|
106
|
-
('param_def -> ID','param_def',
|
107
|
-
('
|
108
|
-
('
|
109
|
-
('
|
110
|
-
('
|
111
|
-
('if_statement -> IF expression DO statements
|
112
|
-
('if_statement -> IF expression DO statements
|
113
|
-
('if_statement -> IF expression DO statements
|
114
|
-
('
|
115
|
-
('elif_clauses -> elif_clause
|
116
|
-
('
|
117
|
-
('
|
118
|
-
('comparison_expr -> expr_atom
|
119
|
-
('comparison_expr -> expr_atom
|
120
|
-
('comparison_expr -> expr_atom
|
121
|
-
('comparison_expr -> expr_atom
|
122
|
-
('comparison_expr -> expr_atom
|
123
|
-
('
|
124
|
-
('arithmetic_expr -> expression
|
125
|
-
('arithmetic_expr -> expression
|
126
|
-
('arithmetic_expr -> expression
|
127
|
-
('arithmetic_expr -> expression
|
128
|
-
('
|
129
|
-
('remote_keyword_call -> ID PIPE LBRACKET ID RBRACKET','remote_keyword_call',
|
44
|
+
('metadata_item -> DATE_KEYWORD COLON STRING','metadata_item',3,'p_metadata_item','parser.py',70),
|
45
|
+
('metadata_item -> DATA_KEYWORD COLON data_source','metadata_item',3,'p_metadata_item','parser.py',71),
|
46
|
+
('metadata_item -> IMPORT_KEYWORD COLON STRING','metadata_item',3,'p_metadata_item','parser.py',72),
|
47
|
+
('metadata_item -> REMOTE_KEYWORD COLON STRING AS ID','metadata_item',5,'p_metadata_item','parser.py',73),
|
48
|
+
('metadata_value -> STRING','metadata_value',1,'p_metadata_value','parser.py',92),
|
49
|
+
('metadata_value -> ID','metadata_value',1,'p_metadata_value','parser.py',93),
|
50
|
+
('tags -> tag COMMA tags','tags',3,'p_tags','parser.py',98),
|
51
|
+
('tags -> tag','tags',1,'p_tags','parser.py',99),
|
52
|
+
('tag -> STRING','tag',1,'p_tag','parser.py',107),
|
53
|
+
('tag -> ID','tag',1,'p_tag','parser.py',108),
|
54
|
+
('statements -> statement statements','statements',2,'p_statements','parser.py',113),
|
55
|
+
('statements -> statement','statements',1,'p_statements','parser.py',114),
|
56
|
+
('statement -> assignment','statement',1,'p_statement','parser.py',122),
|
57
|
+
('statement -> keyword_call','statement',1,'p_statement','parser.py',123),
|
58
|
+
('statement -> remote_keyword_call','statement',1,'p_statement','parser.py',124),
|
59
|
+
('statement -> loop','statement',1,'p_statement','parser.py',125),
|
60
|
+
('statement -> custom_keyword','statement',1,'p_statement','parser.py',126),
|
61
|
+
('statement -> return_statement','statement',1,'p_statement','parser.py',127),
|
62
|
+
('statement -> if_statement','statement',1,'p_statement','parser.py',128),
|
63
|
+
('statement -> break_statement','statement',1,'p_statement','parser.py',129),
|
64
|
+
('statement -> continue_statement','statement',1,'p_statement','parser.py',130),
|
65
|
+
('assignment -> ID EQUALS expression','assignment',3,'p_assignment','parser.py',135),
|
66
|
+
('assignment -> ID EQUALS keyword_call','assignment',3,'p_assignment','parser.py',136),
|
67
|
+
('assignment -> ID EQUALS remote_keyword_call','assignment',3,'p_assignment','parser.py',137),
|
68
|
+
('expression -> expr_atom','expression',1,'p_expression','parser.py',147),
|
69
|
+
('expression -> comparison_expr','expression',1,'p_expression','parser.py',148),
|
70
|
+
('expression -> arithmetic_expr','expression',1,'p_expression','parser.py',149),
|
71
|
+
('expr_atom -> NUMBER','expr_atom',1,'p_expr_atom','parser.py',158),
|
72
|
+
('expr_atom -> STRING','expr_atom',1,'p_expr_atom','parser.py',159),
|
73
|
+
('expr_atom -> PLACEHOLDER','expr_atom',1,'p_expr_atom','parser.py',160),
|
74
|
+
('expr_atom -> ID','expr_atom',1,'p_expr_atom','parser.py',161),
|
75
|
+
('expr_atom -> boolean_expr','expr_atom',1,'p_expr_atom','parser.py',162),
|
76
|
+
('expr_atom -> list_expr','expr_atom',1,'p_expr_atom','parser.py',163),
|
77
|
+
('expr_atom -> dict_expr','expr_atom',1,'p_expr_atom','parser.py',164),
|
78
|
+
('expr_atom -> LPAREN expression RPAREN','expr_atom',3,'p_expr_atom','parser.py',165),
|
79
|
+
('boolean_expr -> TRUE','boolean_expr',1,'p_boolean_expr','parser.py',176),
|
80
|
+
('boolean_expr -> FALSE','boolean_expr',1,'p_boolean_expr','parser.py',177),
|
81
|
+
('list_expr -> LBRACKET list_items RBRACKET','list_expr',3,'p_list_expr','parser.py',182),
|
82
|
+
('list_expr -> LBRACKET RBRACKET','list_expr',2,'p_list_expr','parser.py',183),
|
83
|
+
('list_items -> list_item','list_items',1,'p_list_items','parser.py',191),
|
84
|
+
('list_items -> list_item COMMA list_items','list_items',3,'p_list_items','parser.py',192),
|
85
|
+
('list_item -> expression','list_item',1,'p_list_item','parser.py',200),
|
86
|
+
('dict_expr -> LBRACE dict_items RBRACE','dict_expr',3,'p_dict_expr','parser.py',205),
|
87
|
+
('dict_expr -> LBRACE RBRACE','dict_expr',2,'p_dict_expr','parser.py',206),
|
88
|
+
('dict_items -> dict_item','dict_items',1,'p_dict_items','parser.py',214),
|
89
|
+
('dict_items -> dict_item COMMA dict_items','dict_items',3,'p_dict_items','parser.py',215),
|
90
|
+
('dict_item -> expression COLON expression','dict_item',3,'p_dict_item','parser.py',223),
|
91
|
+
('loop -> FOR ID IN RANGE LPAREN expression COMMA expression RPAREN DO statements END','loop',12,'p_loop','parser.py',228),
|
92
|
+
('keyword_call -> LBRACKET ID RBRACKET COMMA parameter_list','keyword_call',5,'p_keyword_call','parser.py',233),
|
93
|
+
('keyword_call -> LBRACKET ID RBRACKET','keyword_call',3,'p_keyword_call','parser.py',234),
|
94
|
+
('parameter_list -> parameter_items','parameter_list',1,'p_parameter_list','parser.py',242),
|
95
|
+
('parameter_items -> parameter_item COMMA parameter_items','parameter_items',3,'p_parameter_items','parser.py',247),
|
96
|
+
('parameter_items -> parameter_item','parameter_items',1,'p_parameter_items','parser.py',248),
|
97
|
+
('parameter_item -> ID COLON expression','parameter_item',3,'p_parameter_item','parser.py',256),
|
98
|
+
('teardown -> TEARDOWN DO statements END','teardown',4,'p_teardown','parser.py',261),
|
99
|
+
('data_source -> STRING USING ID','data_source',3,'p_data_source','parser.py',266),
|
100
|
+
('custom_keyword -> FUNCTION ID LPAREN param_definitions RPAREN DO statements END','custom_keyword',8,'p_custom_keyword','parser.py',271),
|
101
|
+
('param_definitions -> param_def_list','param_definitions',1,'p_param_definitions','parser.py',276),
|
102
|
+
('param_definitions -> <empty>','param_definitions',0,'p_param_definitions','parser.py',277),
|
103
|
+
('param_def_list -> param_def COMMA param_def_list','param_def_list',3,'p_param_def_list','parser.py',285),
|
104
|
+
('param_def_list -> param_def','param_def_list',1,'p_param_def_list','parser.py',286),
|
105
|
+
('param_def -> ID EQUALS STRING','param_def',3,'p_param_def','parser.py',294),
|
106
|
+
('param_def -> ID EQUALS NUMBER','param_def',3,'p_param_def','parser.py',295),
|
107
|
+
('param_def -> ID','param_def',1,'p_param_def','parser.py',296),
|
108
|
+
('return_statement -> RETURN expression','return_statement',2,'p_return_statement','parser.py',304),
|
109
|
+
('break_statement -> BREAK','break_statement',1,'p_break_statement','parser.py',309),
|
110
|
+
('continue_statement -> CONTINUE','continue_statement',1,'p_continue_statement','parser.py',314),
|
111
|
+
('if_statement -> IF expression DO statements END','if_statement',5,'p_if_statement','parser.py',319),
|
112
|
+
('if_statement -> IF expression DO statements elif_clauses END','if_statement',6,'p_if_statement','parser.py',320),
|
113
|
+
('if_statement -> IF expression DO statements ELSE statements END','if_statement',7,'p_if_statement','parser.py',321),
|
114
|
+
('if_statement -> IF expression DO statements elif_clauses ELSE statements END','if_statement',8,'p_if_statement','parser.py',322),
|
115
|
+
('elif_clauses -> elif_clause','elif_clauses',1,'p_elif_clauses','parser.py',338),
|
116
|
+
('elif_clauses -> elif_clause elif_clauses','elif_clauses',2,'p_elif_clauses','parser.py',339),
|
117
|
+
('elif_clause -> ELIF expression DO statements','elif_clause',4,'p_elif_clause','parser.py',347),
|
118
|
+
('comparison_expr -> expr_atom GT expr_atom','comparison_expr',3,'p_comparison_expr','parser.py',352),
|
119
|
+
('comparison_expr -> expr_atom LT expr_atom','comparison_expr',3,'p_comparison_expr','parser.py',353),
|
120
|
+
('comparison_expr -> expr_atom GE expr_atom','comparison_expr',3,'p_comparison_expr','parser.py',354),
|
121
|
+
('comparison_expr -> expr_atom LE expr_atom','comparison_expr',3,'p_comparison_expr','parser.py',355),
|
122
|
+
('comparison_expr -> expr_atom EQ expr_atom','comparison_expr',3,'p_comparison_expr','parser.py',356),
|
123
|
+
('comparison_expr -> expr_atom NE expr_atom','comparison_expr',3,'p_comparison_expr','parser.py',357),
|
124
|
+
('arithmetic_expr -> expression PLUS expression','arithmetic_expr',3,'p_arithmetic_expr','parser.py',380),
|
125
|
+
('arithmetic_expr -> expression MINUS expression','arithmetic_expr',3,'p_arithmetic_expr','parser.py',381),
|
126
|
+
('arithmetic_expr -> expression TIMES expression','arithmetic_expr',3,'p_arithmetic_expr','parser.py',382),
|
127
|
+
('arithmetic_expr -> expression DIVIDE expression','arithmetic_expr',3,'p_arithmetic_expr','parser.py',383),
|
128
|
+
('arithmetic_expr -> expression MODULO expression','arithmetic_expr',3,'p_arithmetic_expr','parser.py',384),
|
129
|
+
('remote_keyword_call -> ID PIPE LBRACKET ID RBRACKET COMMA parameter_list','remote_keyword_call',7,'p_remote_keyword_call','parser.py',417),
|
130
|
+
('remote_keyword_call -> ID PIPE LBRACKET ID RBRACKET','remote_keyword_call',5,'p_remote_keyword_call','parser.py',418),
|
130
131
|
]
|
pytest_dsl/core/yaml_loader.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
"""YAML变量加载器模块
|
2
2
|
|
3
3
|
该模块负责处理YAML变量文件的加载和管理,支持从命令行参数加载单个文件或目录。
|
4
|
+
同时支持通过hook机制从外部系统动态加载变量。
|
4
5
|
"""
|
5
6
|
|
6
7
|
import os
|
@@ -29,14 +30,25 @@ def add_yaml_options(parser):
|
|
29
30
|
)
|
30
31
|
|
31
32
|
|
32
|
-
def load_yaml_variables_from_args(yaml_files=None, yaml_vars_dir=None,
|
33
|
+
def load_yaml_variables_from_args(yaml_files=None, yaml_vars_dir=None,
|
34
|
+
project_root=None, environment=None):
|
33
35
|
"""从参数加载YAML变量文件(通用函数)
|
34
36
|
|
35
37
|
Args:
|
36
38
|
yaml_files: YAML文件列表
|
37
39
|
yaml_vars_dir: YAML变量目录路径
|
38
40
|
project_root: 项目根目录(用于默认config目录)
|
41
|
+
environment: 环境名称(用于hook加载)
|
39
42
|
"""
|
43
|
+
# 首先尝试通过hook加载变量
|
44
|
+
hook_variables = _load_variables_through_hooks(
|
45
|
+
project_root=project_root, environment=environment)
|
46
|
+
|
47
|
+
if hook_variables:
|
48
|
+
print(f"通过Hook加载了 {len(hook_variables)} 个变量")
|
49
|
+
# 将hook变量加载到yaml_vars中
|
50
|
+
yaml_vars._variables.update(hook_variables)
|
51
|
+
|
40
52
|
# 加载单个YAML文件
|
41
53
|
if yaml_files:
|
42
54
|
yaml_vars.load_yaml_files(yaml_files)
|
@@ -55,7 +67,8 @@ def load_yaml_variables_from_args(yaml_files=None, yaml_vars_dir=None, project_r
|
|
55
67
|
if loaded_files:
|
56
68
|
# 过滤出当前目录的文件
|
57
69
|
if yaml_vars_dir:
|
58
|
-
dir_files = [f for f in loaded_files if Path(
|
70
|
+
dir_files = [f for f in loaded_files if Path(
|
71
|
+
f).parent == Path(yaml_vars_dir)]
|
59
72
|
if dir_files:
|
60
73
|
print(f"目录中加载的文件: {', '.join(dir_files)}")
|
61
74
|
else:
|
@@ -67,6 +80,103 @@ def load_yaml_variables_from_args(yaml_files=None, yaml_vars_dir=None, project_r
|
|
67
80
|
load_remote_servers_from_yaml()
|
68
81
|
|
69
82
|
|
83
|
+
def _load_variables_through_hooks(project_root=None, environment=None):
|
84
|
+
"""通过hook机制加载变量
|
85
|
+
|
86
|
+
Args:
|
87
|
+
project_root: 项目根目录
|
88
|
+
environment: 环境名称
|
89
|
+
|
90
|
+
Returns:
|
91
|
+
dict: 通过hook加载的变量字典
|
92
|
+
"""
|
93
|
+
try:
|
94
|
+
from .hook_manager import hook_manager
|
95
|
+
|
96
|
+
# 确保hook管理器已初始化
|
97
|
+
hook_manager.initialize()
|
98
|
+
|
99
|
+
# 如果没有已注册的插件,直接返回
|
100
|
+
if not hook_manager.get_plugins():
|
101
|
+
return {}
|
102
|
+
|
103
|
+
# 提取project_id(如果可以从项目根目录推断)
|
104
|
+
project_id = None
|
105
|
+
if project_root:
|
106
|
+
# 可以根据项目结构推断project_id,这里暂时不实现
|
107
|
+
pass
|
108
|
+
|
109
|
+
# 通过hook加载变量
|
110
|
+
hook_variables = {}
|
111
|
+
|
112
|
+
# 调用dsl_load_variables hook
|
113
|
+
try:
|
114
|
+
variable_results = hook_manager.pm.hook.dsl_load_variables(
|
115
|
+
project_id=project_id,
|
116
|
+
environment=environment,
|
117
|
+
filters={}
|
118
|
+
)
|
119
|
+
|
120
|
+
# 合并所有hook返回的变量
|
121
|
+
for result in variable_results:
|
122
|
+
if result and isinstance(result, dict):
|
123
|
+
hook_variables.update(result)
|
124
|
+
|
125
|
+
except Exception as e:
|
126
|
+
print(f"通过Hook加载变量时出现警告: {e}")
|
127
|
+
|
128
|
+
# 列出变量源(用于调试)
|
129
|
+
try:
|
130
|
+
source_results = hook_manager.pm.hook.dsl_list_variable_sources(
|
131
|
+
project_id=project_id
|
132
|
+
)
|
133
|
+
|
134
|
+
sources = []
|
135
|
+
for result in source_results:
|
136
|
+
if result and isinstance(result, list):
|
137
|
+
sources.extend(result)
|
138
|
+
|
139
|
+
if sources:
|
140
|
+
print(f"发现 {len(sources)} 个变量源")
|
141
|
+
for source in sources:
|
142
|
+
source_name = source.get('name', '未知')
|
143
|
+
source_type = source.get('type', '未知')
|
144
|
+
print(f" - {source_name} ({source_type})")
|
145
|
+
|
146
|
+
except Exception as e:
|
147
|
+
print(f"列出变量源时出现警告: {e}")
|
148
|
+
|
149
|
+
# 验证变量(如果有变量的话)
|
150
|
+
if hook_variables:
|
151
|
+
try:
|
152
|
+
validation_results = hook_manager.pm.hook.dsl_validate_variables(
|
153
|
+
variables=hook_variables,
|
154
|
+
project_id=project_id
|
155
|
+
)
|
156
|
+
|
157
|
+
validation_errors = []
|
158
|
+
for result in validation_results:
|
159
|
+
if result and isinstance(result, list):
|
160
|
+
validation_errors.extend(result)
|
161
|
+
|
162
|
+
if validation_errors:
|
163
|
+
print(f"变量验证发现 {len(validation_errors)} 个问题:")
|
164
|
+
for error in validation_errors:
|
165
|
+
print(f" - {error}")
|
166
|
+
|
167
|
+
except Exception as e:
|
168
|
+
print(f"验证变量时出现警告: {e}")
|
169
|
+
|
170
|
+
return hook_variables
|
171
|
+
|
172
|
+
except ImportError:
|
173
|
+
# 如果没有安装pluggy或hook_manager不可用,跳过hook加载
|
174
|
+
return {}
|
175
|
+
except Exception as e:
|
176
|
+
print(f"Hook变量加载失败: {e}")
|
177
|
+
return {}
|
178
|
+
|
179
|
+
|
70
180
|
def load_yaml_variables(config):
|
71
181
|
"""加载YAML变量文件(pytest插件接口)
|
72
182
|
|
@@ -80,60 +190,50 @@ def load_yaml_variables(config):
|
|
80
190
|
yaml_vars_dir = config.getoption('--yaml-vars-dir')
|
81
191
|
project_root = config.rootdir
|
82
192
|
|
193
|
+
# 尝试从环境变量获取环境名称
|
194
|
+
environment = os.environ.get(
|
195
|
+
'PYTEST_DSL_ENVIRONMENT') or os.environ.get('ENVIRONMENT')
|
196
|
+
|
83
197
|
# 调用通用加载函数
|
84
198
|
load_yaml_variables_from_args(
|
85
199
|
yaml_files=yaml_files,
|
86
200
|
yaml_vars_dir=yaml_vars_dir,
|
87
|
-
project_root=project_root
|
201
|
+
project_root=project_root,
|
202
|
+
environment=environment
|
88
203
|
)
|
89
204
|
|
90
205
|
|
91
206
|
def load_remote_servers_from_yaml():
|
92
|
-
"""从YAML
|
93
|
-
|
94
|
-
检查YAML变量中是否包含remote_servers配置,如果有则自动连接这些服务器。
|
95
|
-
"""
|
207
|
+
"""从YAML变量中加载远程服务器配置"""
|
96
208
|
try:
|
209
|
+
from pytest_dsl.remote.keyword_client import remote_keyword_manager
|
210
|
+
|
97
211
|
# 获取远程服务器配置
|
98
|
-
|
99
|
-
if not
|
100
|
-
|
212
|
+
remote_servers = yaml_vars.get_variable('remote_servers')
|
213
|
+
if not remote_servers:
|
101
214
|
return
|
102
215
|
|
103
|
-
print(f"发现 {len(
|
104
|
-
|
105
|
-
# 导入远程关键字管理器
|
106
|
-
from pytest_dsl.remote.keyword_client import remote_keyword_manager
|
216
|
+
print(f"发现 {len(remote_servers)} 个远程服务器配置")
|
107
217
|
|
108
|
-
#
|
109
|
-
for
|
110
|
-
|
218
|
+
# 注册远程服务器
|
219
|
+
for server_config in remote_servers:
|
220
|
+
if isinstance(server_config, dict):
|
111
221
|
url = server_config.get('url')
|
112
|
-
alias = server_config.get('alias'
|
222
|
+
alias = server_config.get('alias')
|
113
223
|
api_key = server_config.get('api_key')
|
114
|
-
sync_config = server_config.get('sync_config')
|
115
|
-
|
116
|
-
if not url:
|
117
|
-
print(f"跳过服务器 {server_name}: 缺少URL配置")
|
118
|
-
continue
|
119
|
-
|
120
|
-
print(f"正在连接远程服务器: {server_name} ({url}) 别名: {alias}")
|
121
|
-
|
122
|
-
# 注册远程服务器
|
123
|
-
success = remote_keyword_manager.register_remote_server(
|
124
|
-
url=url,
|
125
|
-
alias=alias,
|
126
|
-
api_key=api_key,
|
127
|
-
sync_config=sync_config
|
128
|
-
)
|
129
|
-
|
130
|
-
if success:
|
131
|
-
print(f"成功连接到远程服务器: {server_name} ({url})")
|
132
|
-
else:
|
133
|
-
print(f"连接远程服务器失败: {server_name} ({url})")
|
134
|
-
|
135
|
-
except Exception as e:
|
136
|
-
print(f"连接远程服务器 {server_name} 时发生错误: {str(e)}")
|
137
224
|
|
225
|
+
if url and alias:
|
226
|
+
print(f"自动连接远程服务器: {alias} -> {url}")
|
227
|
+
success = remote_keyword_manager.register_remote_server(
|
228
|
+
url, alias, api_key=api_key
|
229
|
+
)
|
230
|
+
if success:
|
231
|
+
print(f"✓ 远程服务器 {alias} 连接成功")
|
232
|
+
else:
|
233
|
+
print(f"✗ 远程服务器 {alias} 连接失败")
|
234
|
+
|
235
|
+
except ImportError:
|
236
|
+
# 如果远程功能不可用,跳过
|
237
|
+
pass
|
138
238
|
except Exception as e:
|
139
|
-
print(f"
|
239
|
+
print(f"自动连接远程服务器时出现警告: {e}")
|