Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
trs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Taddeüs Kroes
trs
Commits
bf906321
Commit
bf906321
authored
13 years ago
by
Sander Mathijs van Veen
Browse files
Options
Downloads
Patches
Plain Diff
Added tree matching files.
parent
4b7e9fe6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/match.py
+13
-0
13 additions, 0 deletions
src/match.py
tests/test_match.py
+18
-0
18 additions, 0 deletions
tests/test_match.py
with
31 additions
and
0 deletions
src/match.py
0 → 100644
+
13
−
0
View file @
bf906321
from
node
import
Node
,
Leaf
from
parser
import
Parser
from
external.graph_drawing.graph
import
generate_graph
from
external.graph_drawing.line
import
generate_line
patterns
=
{
#'': L('')
}
def
matches
(
exp
,
pattern
):
pass
This diff is collapsed.
Click to expand it.
tests/test_match.py
0 → 100644
+
18
−
0
View file @
bf906321
import
unittest
from
src.node
import
ExpressionNode
as
N
,
ExpressionLeaf
as
L
from
src.match
import
patterns
,
matches
from
src.parser
import
Parser
from
tests.parser
import
ParserWrapper
class
TestMatch
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
parser
=
ParserWrapper
(
Parser
)
def
test_constant
(
self
):
pass
def
assert_matches
(
self
,
exp
,
pattern_name
):
self
.
assertTrue
(
matches
(
self
.
parser
.
run
([
exp
]),
patterns
[
pattern_name
]))
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment