Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pa 1 #7

Merged
merged 2 commits into from
Jan 6, 2016
Merged

Pa 1 #7

merged 2 commits into from
Jan 6, 2016

Conversation

usernamealreadyis
Copy link

Matching Order

Sometimes you want to make sure that individual parts of your query get executed in the right order. This is important for example if you use references in your query and need to make sure that the branches of the tree where those references are generated get visited before the branches that use them. Basically that means some parts of your code check have to be evaluated first. For example if you need to know the name of a certain object before checking whether this object gets used in the body of a function definition. For this, you can use the match_first special argument, which accepts a list of strings and makes sure that the corresponding key/value pairs in the match query will get checked in the order you provided. This is important if you work with references and want to make sure that the branch which stores the reference will get executed before the branch that makes use of it. An example:

$ : {match_first: [foo]}
foo:
  $store:
    node_type: functiondef
  name: my_function
bar:
  $ref: {name : my_function}

@usernamealreadyis usernamealreadyis added this to the about:us milestone Jan 6, 2016
usernamealreadyis added a commit that referenced this pull request Jan 6, 2016
@usernamealreadyis usernamealreadyis merged commit 40921a0 into pa Jan 6, 2016
@GistIcon GistIcon locked and limited conversation to collaborators Jan 6, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants