-
-
Notifications
You must be signed in to change notification settings - Fork 15
Add a gogrep talk link into a readme? #44
Comments
Hm. I worry that the material would go stale, and confuse people more than anything. But maybe that won't be so bad if we add a date right next to the link. We also don't need to mess with PDFs; https://talks.godoc.org/github.com/mvdan/talks/2018/gogrep.slide should suffice. I get that it stinks on mobile, but we can also link the original plaintext version. |
I am trying to understand how gogrep matches AST nodes when invoked as That command seems to match any statement initializing a composite literal (maps, struct, array, slice), which makes sense. For example, that command matches the following statements:
What is less obvious is that
In the above code, it would be reasonable to assume Another behavior that would be worth documenting is how exactly
In the following scenarios:
The question is which AST nodes are |
The matching could be more aggressive; it's always been a fine balance between "matches too much" and "matches too little". This is also why I added an "aggressive" option to the pattern syntax, but I honestly don't like it all that much either. |
I'm just starting to read the code. Is aggressive supposed to be an option like like regex greedy vs reluctant vs possessive? BTW, I found it is very helpful to add this line after https://github.com/mvdan/gogrep/blob/master/main.go#L162: ast.Fprint(m.out, m.fset, n, nil) It helps to understand the details of the matching results. You can quickly look at how any matching piece of code is modeled in AST. Maybe add a |
I think the documentation could be slightly improved with gogrep-related materials, like https://github.com/mvdan/talks/blob/master/2018/gogrep.slide
It gives a pretty good introduction for people who are new to a concept of ast-based code matching.
That
.slide
can be compiled into PDF, uploaded to a speakerdeck and that speakerdeck link can be added to a README.Does it make sense? :)
The text was updated successfully, but these errors were encountered: