Skip to content

Commit

Permalink
ast: Update rule index to support glob.match
Browse files Browse the repository at this point in the history
These changes update the rule index to support glob.match calls. The
changes update the build step to transform glob.match(pattern,
delimiter, match) calls into ref/value pairs like equality
expressions. In addition, the build step creates a mapper function
that transforms resolved values into lookup values during traversal.

As part of these changes, the build operation has been refactored so
that most of the process is encapsulated by a new refindices struct
that's separate from the actual rule index/trie. Hopefully this makes
the code easier to follow.

The index build step for glob.match only recognizes statements where
the match operand was given as a reference (and then was rewritten by
the earlier step in the compiler.) If this is too brittle we could
revisit the build step and close over all intermediate assignments.

Fixes #1496

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
  • Loading branch information
tsandall committed Jun 26, 2019
1 parent 3aff107 commit 096670b
Show file tree
Hide file tree
Showing 3 changed files with 409 additions and 118 deletions.
Loading

0 comments on commit 096670b

Please sign in to comment.