def test13(): format = optimize.optimize(Expression.Any("A") + \ Expression.Any("B") + \ Expression.Any("C") + \ ((Expression.Any("D") + \ Expression.Any("E")) + \ Expression.Any("F"))) assert format.string == "ABCDEF"
def test16(): format = optimize.optimize(Str("A") + Expression.Literal("B")) assert format.string == "AB"
def test14(): format = optimize.optimize(Str("A") + Expression.Any("B", invert=1)) assert isinstance(format, Expression.Seq)
def test12(): format = optimize.optimize(Str("A") + Expression.Any("B")) assert format.string == "AB"
def test18(): format = optimize.optimize( Group(None, Group(None, Str("A") + Str("B")) + Str("C")) + \ Group(None, Str("D") + Expression.Any("E") + \ Group(None, Str("FG") + Str("H")) + Group(None, Str("I")))) assert format.string == "ABCDEFGHI"
blank_space + Str( "reactions" ) + ToEol() ) branch_metabolite = Group( "branch_metabolite", optional_blank_space + Rep1(AnyBut(white_space)) + blank_space + RepN(Digits() + blank_space, 3) + Rep1(Any("ir")) + ToEol()) non_branch_metabolite = Group( "non_branch_metabolite", optional_blank_space + Rep1(AnyBut(white_space)) + blank_space + RepN(Digits() + blank_space, 3) + Rep1(Any("ir")) + ToEol()) branch_metabolite_block = Group( "branch_metabolite_block", \ metabolite_roles_heading + metabolite_role_cols + Rep( branch_metabolite ) ) non_branch_metabolite_block = Group( "non_branch_metabolite_block", \ metabolite_roles_heading + metabolite_role_cols + Rep( non_branch_metabolite ) ) end_stoichiometric = Group( "end_stochiometric", \ Rep( Expression.Assert( not_balanced_tag, 1 ) + Expression.Assert( kernel_tag, 1 ) + ToEol() ) ) end_not_balanced = Group( "end_not_balanced", \ Rep( Expression.Assert( kernel_tag, 1 ) + ToEol() ) ) end_kernel = Group( "end_kernel", \ Rep( Expression.Assert( subsets_tag, 1 ) + ToEol() ) ) end_subsets = Group( "end_subsets", \ Rep( Expression.Assert( reduced_system_tag, 1 ) + ToEol() ) ) end_reduced_system = Group( "end_reduced_system", \ Rep( Expression.Assert( convex_basis_tag, 1 ) + ToEol() ) ) end_convex_basis = Group( "end_convex_basis", \ Rep( Expression.Assert( conservation_relations_tag, 1 ) + ToEol() ) ) end_conservation_relations = Group( "end_conservation_relations", \ Rep( Expression.Assert( elementary_modes_tag, 1 ) + ToEol() ) ) end_elementary_modes = Group("end_elementary_modes", Rep(ToEol())) # Rep1( AnyBut( '.') ) + Str( "." ) )