Goose  Diff

Differences From Artifact [e9312eb753]:

  • File bs/ir/match.h — part of check-in [afb316dee6] at 2018-11-11 20:11:57 on branch trunk —
    • Remove Or term, they just complicate term/term pattern matching because they can generate multiple solutions and aren't actually useful.
    • Implemented Match for term/term.
    (user: achavasse size: 1956)

To Artifact [dfc4f01f99]:

  • File bs/ir/match.h — part of check-in [9b2d8524f9] at 2018-11-11 21:37:40 on branch trunk — Implemented term/trie pattern matching. (user: achavasse size: 1963)

51
52
53
54
55
56
57
58

59
60
61
62
51
52
53
54
55
56
57

58
59
60
61
62







-
+




            ptr< unordered_map< StringId, any > > m_pVars;
            size_t m_complexity = 0;    // The number of container terms in the matched pattern
    };

    extern optional< MatchSolution > Match( const Term& expression, const Term& pattern );

    template< typename U >
    static Generator< pair< MatchSolution, U > > Match( const Term& expression, const Trie< U >& patterns );
    static Generator< pair< MatchSolution, const U& > > Match( const Term& expression, const Trie< U >& patterns );
    extern Generator< MatchSolution > Match( const Term& expression, const Trie<>& patterns );
}

#endif