Skip to content

Commit 4559f07

Browse files
committed
Added TM notes
1 parent 7896b59 commit 4559f07

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

client/src/syntaxes/vba.tmLanguage.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,47 @@ fileTypes:
88
patterns:
99
- include: "#fileStructure"
1010

11+
12+
# --- Notes ------------------------------------------------------------------------------------
13+
# * TextMate will only evaluate a single line at a time. For syntax spanning multiple lines,
14+
# a begin/end rule is the only option.
15+
# * TextMate will always fail gracefully. You can misspell a key or name, write an invalid
16+
# regex pattern, or summon Beetlejuice. It will still run, it just won't work as expected.
17+
#
18+
# --- Match Rules ------------------------------------------------------------------------------
19+
# * Match rules contain a match key.
20+
# * Matches are always consumed but can be passed down to captures key.
21+
# * Patterns, begin, end, beginCaptures, and endCaptures keys will be ignored.
22+
# * Repository key contains more rules but you can only call down the tree or to a top level.
23+
24+
# --- Begin/End Rules --------------------------------------------------------------------------
25+
# * Begin/end rules contain a begin key and (usually) an end key.
26+
# * Rules missing an end key will match to the end of the document (or capture - see tips).
27+
# * Similar to match/captures, you can pair begin/beginCaptures and end/endCaptures.
28+
# * Repository key is ignored and rules within are not accessible from anywhere.
29+
30+
# --- Empty Rules ------------------------------------------------------------------------------
31+
# * Empty rules are used to organise rule flow with a patterns key, and optionally, repository.
32+
# * They will never consume any content as they have no regex.
33+
# * These rules cannot assign scope, so the name key wil be ignored. This may help to organise
34+
# * your grammar, but can make it more difficult to test and debug.
35+
36+
# --- Tips and Tricks --------------------------------------------------------------------------
37+
# * It can be advantageous to match without consuming anything, e.g., multi-level begin/end
38+
# rules. You can cascade ends with (?=.) to match anything without consuming.
39+
# Similarly, you may wish to end at [':\n] but consuming will cause comments to fail.
40+
# * You can strategically consume content to skip it matching elsewhere, e.g., line continuation
41+
# on a comment. Begin on ' and end on \n. If you consume the continuation _\s*\n then the
42+
# comment will continue until the next line that doesn't have the continuation pattern.
43+
# * Begin/End rules run until ended or until they reach the end of their scope of operation.
44+
# This means passing a capture group from (begin|end)?capture down to a begin/end will _always
45+
# end at the end of the what was captured!_. This cannot be more than to the end of the line.
46+
#
47+
# "Put conventional logic aside and enjoy. Well... I say, 'enjoy.'"
48+
# - Garth Marenghi
49+
# ----------------------------------------------------------------------------------------------
50+
51+
1152
repository:
1253
fileStructure:
1354
patterns:

0 commit comments

Comments
 (0)