]> git.madduck.net Git - etc/vim.git/blob - blib2to3/PatternGrammar.txt

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Fix an embarrassing UnboundLocalError
[etc/vim.git] / blib2to3 / PatternGrammar.txt
1 # Copyright 2006 Google, Inc. All Rights Reserved.
2 # Licensed to PSF under a Contributor Agreement.
3
4 # A grammar to describe tree matching patterns.
5 # Not shown here:
6 # - 'TOKEN' stands for any token (leaf node)
7 # - 'any' stands for any node (leaf or interior)
8 # With 'any' we can still specify the sub-structure.
9
10 # The start symbol is 'Matcher'.
11
12 Matcher: Alternatives ENDMARKER
13
14 Alternatives: Alternative ('|' Alternative)*
15
16 Alternative: (Unit | NegatedUnit)+
17
18 Unit: [NAME '='] ( STRING [Repeater]
19                  | NAME [Details] [Repeater]
20                  | '(' Alternatives ')' [Repeater]
21                  | '[' Alternatives ']'
22                  )
23
24 NegatedUnit: 'not' (STRING | NAME [Details] | '(' Alternatives ')')
25
26 Repeater: '*' | '+' | '{' NUMBER [',' NUMBER] '}'
27
28 Details: '<' Alternatives '>'