path: root/mi/match.c
AgeCommit message (Collapse)Author
2020-05-05Remove unneeded checkMura Li
2020-05-05Use /**/ instead of //Mura Li
2020-05-05Simplify equality computationMura Li
2020-05-05Support or-patterns with wildcard variablesMura Li
2020-05-05Fix missing link of linked listMura Li
2020-05-05Fix wrong order of recursive callsMura Li
Also, improve slightly the error messages.
2020-05-05Support or-patternmural
2019-10-30Fix build on 9front.Ori Bernstein
2019-10-29Merge decision tree nodes when possibleMura Li
(Tested on Linux/AMD64) Sample count: 506 Dtree Refcnt avg: 5.38 95th percentile: 3.00 maximum: 100 Dtree Size avg: 5.23 95th percentile: 3.00 maximum: 84 Dtree Height avg: 1.39 95th percentile: 1.00 maximum: 12 References: Mikael Pettersson. A term pattern-match compiler inspired by finite automata theory. (p.6 "Step 3: Optimizing the DFA")
2019-10-22Make the 9front C compiler happy: return at end of function.Ori Bernstein
2019-10-23Add a new match compiler implementationMura Li
References: "When Do Match-Compilation Heuristics Matter?" by Kevin Scott and Norman Ramsey Stats: Sample count: 506 Dtree Size avg: 5.38 95th percentile: 3.00 maximum: 100 Dtree Height avg: 1.39 95th percentile: 1.00 maximum: 12 Sample generation: $ MATCH_STATS=1 make bootstrap && mbld -R support/matchstats.myr ./match.csv
2019-02-26Accept that `file` isn't a node.Ori Bernstein
Shrink node sizes, simplify code a bit.
2018-08-17Revert "Fix overlapping match statements (thanks Mako)"Ori Bernstein
This reverts commit beab0276a94c684f938ae5ea3d2c29c3dc331386.
2018-08-11We don't need early breaks.Ori Bernstein
2018-07-09Add match tree debug option.Ori Bernstein
2018-07-08Fix overlapping match statements (thanks Mako)Ori Bernstein
We were overly aggressive in unifying wildcards.
2017-12-05Error correctly when a const has no init.Ori Bernstein
This happens with externs.
2017-12-05Shift the match frontier correctly.Ori Bernstein
Fixes #159
2017-07-09Style(9)-ify.Ori Bernstein
2017-07-08Break up overly long statements.Ori Bernstein
A monster function declaration and if condition.
2017-07-08Allow matching of empty structs and arraysS. Gilles
2016-08-21Fix handling of pointers in match.Ori Bernstein
2016-08-13Don't generate loops in trees.Ori Bernstein
We only want to append to last if we're actaully expanding the match frontier. It's a bug to add it if it's unused.
2016-04-04Fix matching.Ori Bernstein
TODO: understand why. The appending of the start state shoudl be a bug.
2016-02-22Extract util functions into separate dir from parse/Ori Bernstein
2016-01-30Error on unmatchable types.Ori Bernstein
2016-01-29Functions act as basic types.Ori Bernstein
Fixes #65
2016-01-24Only walk pointer patterns that walk pointers.Ori Bernstein
2016-01-24Handle the other branch for pointers.Ori Bernstein
2016-01-24Add pointer match syntax.Ori Bernstein
2016-01-09Don't attach wildcards *AFTER* accept nodes.Ori Bernstein
2015-12-18Don't introduce loops in the match trie.Ori Bernstein
2015-12-15Fix wildcards for void.Ori Bernstein
Void acts like a primitive here.
2015-12-15Allow matching a single void.Ori Bernstein
Void has 1 constructor, not 0.
2015-12-14Initial support for void as an expression.Ori Bernstein
2015-12-13Initialize ret() to 0.Ori Bernstein
Fix scan-build warning.
2015-12-13Don't generate useless assignments.Ori Bernstein
We never generate them...
2015-12-13Fix a couple of segfaults.Ori Bernstein
We should actually use valid values when generating errors.
2015-11-17MEGAPATCH: Tabification.Ori Bernstein
Tabs > spaces. By 4 spaces, to be precise. Let's use them.
2015-11-06Fix patterns with multiple sequential wildcardsOri Bernstein
(a, b) was an invalid pattern, since we would never generate the jump to the pattern check for b.
2015-11-06Rewrite pattern matching code.Ori Bernstein
Much cleaner, and more efficient.
2015-11-06Shuffle around functions.Ori Bernstein
Move some code into the frontend so the middle end can call it.
2015-11-06We only need to load a value once.Ori Bernstein
2015-11-06Working pattern matching.Ori Bernstein
2015-11-06Pass the basic tests. we still fail complex ones.Ori Bernstein
2015-11-06Fix decision trees for structs.Ori Bernstein
2015-11-05Remove more debug spew.Ori Bernstein
2015-11-05Shut up debug spew.Ori Bernstein
2015-10-19Make improved pattern matching work for unions.Ori Bernstein
2015-10-19Work towards better match statements.Ori Bernstein
Generate decision trees from mi/match.c. Still slightly broken, so not enabled.