#NEWLINE# def test_match_rule_complex( ) : #NEWLINE# #INDENT# '\n    Test match rule that has complex expressions.\n    ' #NEWLINE# grammar = "\n    Rule: ('one' /\\d+/)* 'foo'+ |'two'|'three';\n    " #NEWLINE# meta = metamodel_from_str ( grammar ) #NEWLINE# assert meta #NEWLINE# assert ( meta [ 'Rule' ] . _tx_type is RULE_MATCH ) #NEWLINE# model = meta . model_from_str ( 'one 45 one 78 foo foo foo' ) #NEWLINE# assert model #NEWLINE# assert ( meta . __class__ == text ) #NEWLINE# assert ( model == 'one45one78foofoofoo' )