Selaa lähdekoodia

Adding a syntax highlighter for the test-case format.

tags/v0.2
Ben Kurtovic 11 vuotta sitten
vanhempi
commit
24c55aeeb1
4 muutettua tiedostoa jossa 131 lisäystä ja 1 poistoa
  1. +130
    -0
      tests/MWPFHTestCase.tmlanguage
  2. +1
    -1
      tests/_test_tokenizer.py
  3. +0
    -0
      tests/tokenizer/templates.mwtest
  4. +0
    -0
      tests/tokenizer/text.mwtest

+ 130
- 0
tests/MWPFHTestCase.tmlanguage Näytä tiedosto

@@ -0,0 +1,130 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>mwtest</string>
</array>
<key>name</key>
<string>MWParserFromHell Test Case</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>---</string>
<key>name</key>
<string>markup.heading.divider.mwpfh</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.other.name.mwpfh</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>variable.other.name.mwpfh</string>
</dict>
</dict>
<key>match</key>
<string>(name:)\s*(\w*)</string>
<key>name</key>
<string>meta.name.mwpfh</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.other.label.mwpfh</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>comment.line.other.label.mwpfh</string>
</dict>
</dict>
<key>match</key>
<string>(label:)\s*(.*)</string>
<key>name</key>
<string>meta.label.mwpfh</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.other.input.mwpfh</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>string.quoted.double.input.mwpfh</string>
</dict>
</dict>
<key>match</key>
<string>(input:)\s*(.*)</string>
<key>name</key>
<string>meta.input.mwpfh</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.other.output.mwpfh</string>
</dict>
</dict>
<key>match</key>
<string>(output:)</string>
<key>name</key>
<string>meta.output.mwpfh</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>support.language.token.mwpfh</string>
</dict>
</dict>
<key>match</key>
<string>(\w+)\s*\(</string>
<key>name</key>
<string>meta.name.token.mwpfh</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>variable.parameter.token.mwpfh</string>
</dict>
</dict>
<key>match</key>
<string>(\w+)\s*(=)</string>
<key>name</key>
<string>meta.name.parameter.token.mwpfh</string>
</dict>
<dict>
<key>match</key>
<string>".*?"</string>
<key>name</key>
<string>string.quoted.double.mwpfh</string>
</dict>
</array>
<key>scopeName</key>
<string>text.mwpfh</string>
<key>uuid</key>
<string>cd3e2ffa-a57d-4c40-954f-1a2e87ffd638</string>
</dict>
</plist>

+ 1
- 1
tests/_test_tokenizer.py Näytä tiedosto

@@ -107,7 +107,7 @@ class TokenizerTestCase(object):
def build(cls):
"""Load and install all tests from the 'tokenizer' directory."""
directory = path.join(path.dirname(__file__), "tokenizer")
extension = ".test"
extension = ".mwtest"
for filename in listdir(directory):
if not filename.endswith(extension):
continue


tests/tokenizer/templates.test → tests/tokenizer/templates.mwtest Näytä tiedosto


tests/tokenizer/text.test → tests/tokenizer/text.mwtest Näytä tiedosto


Ladataan…
Peruuta
Tallenna