textpow 0.10.1 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +7 -0
- data/Gemfile +10 -0
- data/Gemfile.lock +30 -0
- data/{History.txt → History.rdoc} +10 -0
- data/{README.txt → MIT-LICENSE.txt} +0 -30
- data/README.rdoc +82 -0
- data/Rakefile +42 -49
- data/bin/plist2syntax +0 -0
- data/bin/plist2yaml +0 -0
- data/examples/benchmark_js.rb +13 -0
- data/examples/jquery.js +9046 -0
- data/lib/textpow.rb +43 -3
- data/lib/textpow/debug_processor.rb +35 -35
- data/lib/textpow/recording_processor.rb +13 -0
- data/lib/textpow/score_manager.rb +60 -60
- data/lib/textpow/syntax.rb +303 -262
- data/lib/textpow/syntax/broken/markdown.syntax +519 -0
- data/lib/textpow/syntax/broken/php.syntax +1253 -0
- data/lib/textpow/syntax/buggy/nemerle.syntax +74 -0
- data/lib/textpow/syntax/old/YAML.yaml +160 -0
- data/lib/textpow/syntax/old/txt2tags.yaml +139 -0
- data/lib/textpow/syntax/source.actionscript.syntax +97 -0
- data/lib/textpow/syntax/source.active4d.library.syntax +21 -0
- data/lib/textpow/syntax/source.active4d.syntax +276 -0
- data/lib/textpow/syntax/source.ada.syntax +33 -0
- data/lib/textpow/syntax/source.antlr.syntax +151 -0
- data/lib/textpow/syntax/source.apache-config.mod_perl.syntax +50 -0
- data/lib/textpow/syntax/source.apache-config.syntax +191 -0
- data/lib/textpow/syntax/source.applescript.syntax +384 -0
- data/lib/textpow/syntax/source.asp.syntax +70 -0
- data/lib/textpow/syntax/source.asp.vb.net.syntax +129 -0
- data/lib/textpow/syntax/source.c++.qt.syntax +26 -0
- data/lib/textpow/syntax/source.c++.syntax +186 -0
- data/lib/textpow/syntax/source.c-sharp.syntax +59 -0
- data/lib/textpow/syntax/source.c.ragel.syntax +201 -0
- data/lib/textpow/syntax/source.c.syntax +414 -0
- data/lib/textpow/syntax/source.camlp4.ocaml.syntax +36 -0
- data/lib/textpow/syntax/source.cm.syntax +32 -0
- data/lib/textpow/syntax/source.coffee.syntax +216 -0
- data/lib/textpow/syntax/source.context-free.syntax +176 -0
- data/lib/textpow/syntax/source.css.beta.syntax +1925 -0
- data/lib/textpow/syntax/source.css.syntax +195 -0
- data/lib/textpow/syntax/source.d.syntax +142 -0
- data/lib/textpow/syntax/source.diff.syntax +81 -0
- data/lib/textpow/syntax/source.dot.syntax +47 -0
- data/lib/textpow/syntax/source.dylan.syntax +62 -0
- data/lib/textpow/syntax/source.eiffel.syntax +78 -0
- data/lib/textpow/syntax/source.erlang.syntax +922 -0
- data/lib/textpow/syntax/source.fortran.syntax +141 -0
- data/lib/textpow/syntax/source.fscript.syntax +80 -0
- data/lib/textpow/syntax/source.fxscript.syntax +142 -0
- data/lib/textpow/syntax/source.gri.syntax +83 -0
- data/lib/textpow/syntax/source.groovy.groovy.syntax +191 -0
- data/lib/textpow/syntax/source.haskell.syntax +88 -0
- data/lib/textpow/syntax/source.icalendar.syntax +32 -0
- data/lib/textpow/syntax/source.inform.syntax +48 -0
- data/lib/textpow/syntax/source.ini.syntax +55 -0
- data/lib/textpow/syntax/source.io.syntax +81 -0
- data/lib/textpow/syntax/source.java-props.syntax +20 -0
- data/lib/textpow/syntax/source.java.syntax +211 -0
- data/lib/textpow/syntax/source.js.greasemonkey.syntax +34 -0
- data/lib/textpow/syntax/source.js.jquery.syntax +114 -0
- data/lib/textpow/syntax/source.js.mootools.syntax +572 -0
- data/lib/textpow/syntax/source.js.prototype.bracketed.syntax +140 -0
- data/lib/textpow/syntax/source.js.prototype.syntax +72 -0
- data/lib/textpow/syntax/source.js.syntax +256 -0
- data/lib/textpow/syntax/source.js.yui.syntax +176 -0
- data/lib/textpow/syntax/source.json.syntax +136 -0
- data/lib/textpow/syntax/source.lex.syntax +219 -0
- data/lib/textpow/syntax/source.lighttpd-config.syntax +54 -0
- data/lib/textpow/syntax/source.lilypond.syntax +492 -0
- data/lib/textpow/syntax/source.lisp.syntax +61 -0
- data/lib/textpow/syntax/source.logo.syntax +29 -0
- data/lib/textpow/syntax/source.logtalk.syntax +152 -0
- data/lib/textpow/syntax/source.lua.syntax +86 -0
- data/lib/textpow/syntax/source.makefile.syntax +36 -0
- data/lib/textpow/syntax/source.matlab.syntax +142 -0
- data/lib/textpow/syntax/source.mel.syntax +92 -0
- data/lib/textpow/syntax/source.mips.syntax +66 -0
- data/lib/textpow/syntax/source.ml.syntax +121 -0
- data/lib/textpow/syntax/source.modula-3.syntax +47 -0
- data/lib/textpow/syntax/source.nant-build.syntax +53 -0
- data/lib/textpow/syntax/source.objc++.syntax +18 -0
- data/lib/textpow/syntax/source.objc.syntax +233 -0
- data/lib/textpow/syntax/source.ocaml.syntax +764 -0
- data/lib/textpow/syntax/source.ocamllex.syntax +167 -0
- data/lib/textpow/syntax/source.ocamlyacc.syntax +184 -0
- data/lib/textpow/syntax/source.open-gl.syntax +14 -0
- data/lib/textpow/syntax/source.pascal.syntax +77 -0
- data/lib/textpow/syntax/source.pascal.vectorscript.syntax +57 -0
- data/lib/textpow/syntax/source.perl.syntax +1113 -0
- data/lib/textpow/syntax/source.php.cake.syntax +55 -0
- data/lib/textpow/syntax/source.plist.tm-grammar.syntax +708 -0
- data/lib/textpow/syntax/source.postscript.syntax +114 -0
- data/lib/textpow/syntax/source.processing.syntax +106 -0
- data/lib/textpow/syntax/source.prolog.syntax +40 -0
- data/lib/textpow/syntax/source.python.django.syntax +21 -0
- data/lib/textpow/syntax/source.python.syntax +868 -0
- data/lib/textpow/syntax/source.qmake.syntax +114 -0
- data/lib/textpow/syntax/source.quake-config.syntax +32 -0
- data/lib/textpow/syntax/source.r-console.syntax +16 -0
- data/lib/textpow/syntax/source.r.syntax +81 -0
- data/lib/textpow/syntax/source.regexp.oniguruma.syntax +107 -0
- data/lib/textpow/syntax/source.regexp.python.syntax +109 -0
- data/lib/textpow/syntax/source.regexp.syntax +50 -0
- data/lib/textpow/syntax/source.remind.syntax +253 -0
- data/lib/textpow/syntax/source.rez.syntax +80 -0
- data/lib/textpow/syntax/source.ruby.experimental.syntax +145 -0
- data/lib/textpow/syntax/source.ruby.rails.syntax +88 -0
- data/lib/textpow/syntax/source.ruby.syntax +1035 -0
- data/lib/textpow/syntax/source.s5.syntax +69 -0
- data/lib/textpow/syntax/source.sass.syntax +45 -0
- data/lib/textpow/syntax/source.scheme.syntax +347 -0
- data/lib/textpow/syntax/source.scilab.syntax +41 -0
- data/lib/textpow/syntax/source.scss.syntax +527 -0
- data/lib/textpow/syntax/source.shell.syntax +384 -0
- data/lib/textpow/syntax/source.slate.syntax +149 -0
- data/lib/textpow/syntax/source.smarty.syntax +63 -0
- data/lib/textpow/syntax/source.sql.ruby.syntax +18 -0
- data/lib/textpow/syntax/source.sql.syntax +237 -0
- data/lib/textpow/syntax/source.ssh-config.syntax +33 -0
- data/lib/textpow/syntax/source.strings.syntax +39 -0
- data/lib/textpow/syntax/source.swig.syntax +57 -0
- data/lib/textpow/syntax/source.tcl.macports.syntax +163 -0
- data/lib/textpow/syntax/source.tcl.syntax +152 -0
- data/lib/textpow/syntax/source.yaml.syntax +160 -0
- data/lib/textpow/syntax/text.active4d-ini.syntax +50 -0
- data/lib/textpow/syntax/text.bbcode.syntax +287 -0
- data/lib/textpow/syntax/text.bibtex.syntax +151 -0
- data/lib/textpow/syntax/text.blog.html.syntax +41 -0
- data/lib/textpow/syntax/text.blog.markdown.syntax +42 -0
- data/lib/textpow/syntax/text.blog.syntax +27 -0
- data/lib/textpow/syntax/text.blog.textile.syntax +27 -0
- data/lib/textpow/syntax/text.gtdalt.syntax +143 -0
- data/lib/textpow/syntax/text.haml.syntax +88 -0
- data/lib/textpow/syntax/text.html.asp.net.syntax +424 -0
- data/lib/textpow/syntax/text.html.asp.syntax +27 -0
- data/lib/textpow/syntax/text.html.basic.syntax +362 -0
- data/lib/textpow/syntax/text.html.cfm.syntax +119 -0
- data/lib/textpow/syntax/text.html.django.syntax +36 -0
- data/lib/textpow/syntax/text.html.dokuwiki.syntax +204 -0
- data/lib/textpow/syntax/text.html.doxygen.syntax +43 -0
- data/lib/textpow/syntax/text.html.markdown.multimarkdown.syntax +39 -0
- data/lib/textpow/syntax/text.html.mason.syntax +119 -0
- data/lib/textpow/syntax/text.html.mediawiki.syntax +567 -0
- data/lib/textpow/syntax/text.html.mt.syntax +162 -0
- data/lib/textpow/syntax/text.html.ruby.syntax +40 -0
- data/lib/textpow/syntax/text.html.strict.active4d.syntax +311 -0
- data/lib/textpow/syntax/text.html.tcl.syntax +26 -0
- data/lib/textpow/syntax/text.html.textile.syntax +215 -0
- data/lib/textpow/syntax/text.html.tt.syntax +121 -0
- data/lib/textpow/syntax/text.html.twiki.syntax +241 -0
- data/lib/textpow/syntax/text.html.xhtml.1-strict.syntax +4027 -0
- data/lib/textpow/syntax/text.log.latex.syntax +50 -0
- data/lib/textpow/syntax/text.mail.markdown.syntax +118 -0
- data/lib/textpow/syntax/text.man.syntax +17 -0
- data/lib/textpow/syntax/text.moinmoin.syntax +189 -0
- data/lib/textpow/syntax/text.plain.gtd.syntax +22 -0
- data/lib/textpow/syntax/text.plain.release-notes.syntax +46 -0
- data/lib/textpow/syntax/text.plain.syntax +32 -0
- data/lib/textpow/syntax/text.plist.syntax +635 -0
- data/lib/textpow/syntax/text.pmwiki.syntax +113 -0
- data/lib/textpow/syntax/text.restructuredtext.syntax +250 -0
- data/lib/textpow/syntax/text.setext.syntax +147 -0
- data/lib/textpow/syntax/text.subversion-commit.syntax +36 -0
- data/lib/textpow/syntax/text.tabular.csv.syntax +68 -0
- data/lib/textpow/syntax/text.tabular.tsv.syntax +50 -0
- data/lib/textpow/syntax/text.tex.latex.beamer.syntax +41 -0
- data/lib/textpow/syntax/text.tex.latex.haskell.syntax +24 -0
- data/lib/textpow/syntax/text.tex.latex.memoir.syntax +64 -0
- data/lib/textpow/syntax/text.tex.latex.rd.syntax +91 -0
- data/lib/textpow/syntax/text.tex.latex.sweave.syntax +84 -0
- data/lib/textpow/syntax/text.tex.latex.syntax +566 -0
- data/lib/textpow/syntax/text.tex.math.syntax +49 -0
- data/lib/textpow/syntax/text.tex.syntax +86 -0
- data/lib/textpow/syntax/text.txt2tags.syntax +79 -0
- data/lib/textpow/syntax/text.xml.apple-dist.syntax +77 -0
- data/lib/textpow/syntax/text.xml.strict.syntax +92 -0
- data/lib/textpow/syntax/text.xml.syntax +180 -0
- data/lib/textpow/syntax/text.xml.xsl.syntax +60 -0
- data/lib/textpow/version.rb +3 -0
- data/spec/fixtures/objeck.plist +107 -0
- data/spec/fixtures/utf8.txt +1 -0
- data/spec/spec_helper.rb +2 -0
- data/spec/textpow/score_manager_spec.rb +20 -0
- data/spec/textpow/syntax_files_spec.rb +26 -0
- data/spec/textpow/syntax_spec.rb +225 -0
- data/spec/textpow_spec.rb +57 -0
- data/textpow.gemspec +19 -0
- metadata +246 -68
- data/Manifest.txt +0 -13
- data/mm/manual.mm +0 -266
- data/test/test_textpow.rb +0 -25
@@ -0,0 +1,69 @@
|
|
1
|
+
---
|
2
|
+
name: S5 Slide Show
|
3
|
+
fileTypes:
|
4
|
+
- s5
|
5
|
+
scopeName: source.s5
|
6
|
+
uuid: 84A2047B-4453-418D-B009-A3D3C60F3D1E
|
7
|
+
foldingStartMarker: |-
|
8
|
+
(?x)
|
9
|
+
(<(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|form|dl)\b.*?>
|
10
|
+
|<!--(?!.*-->)
|
11
|
+
|\{\s*($|\?>\s*$|//|/\*(.*\*/\s*$|(?!.*?\*/)))
|
12
|
+
)
|
13
|
+
patterns:
|
14
|
+
- name: meta.header.s5
|
15
|
+
captures:
|
16
|
+
"1":
|
17
|
+
name: keyword.other.s5
|
18
|
+
"2":
|
19
|
+
name: punctuation.separator.key-value.s5
|
20
|
+
"3":
|
21
|
+
name: string.unquoted.s5
|
22
|
+
match: ^([A-Za-z0-9]+)(:)\s*(.*)$\n?
|
23
|
+
- begin: ^(?![A-Za-z0-9]+:)
|
24
|
+
end: ^(?=not)possible$
|
25
|
+
patterns:
|
26
|
+
- begin: (^_{10}$)
|
27
|
+
contentName: text.html.markdown.handout.s5
|
28
|
+
beginCaptures:
|
29
|
+
"1":
|
30
|
+
name: meta.separator.handout.s5
|
31
|
+
end: "(?=^(?:(?:\xE2\x9C\x82-{6})+|^#{10})$)"
|
32
|
+
patterns:
|
33
|
+
- include: text.html.markdown
|
34
|
+
comment: "\n\
|
35
|
+
\t\t\t\t\t\tname = 'meta.separator.handout.s5';\n\
|
36
|
+
\t\t\t\t\t\tmatch = '(^_{10}$)';\n\
|
37
|
+
\t\t\t\t\t"
|
38
|
+
- begin: (^#{10}$)
|
39
|
+
contentName: text.html.markdown.notes.s5
|
40
|
+
beginCaptures:
|
41
|
+
"1":
|
42
|
+
name: meta.separator.notes.s5
|
43
|
+
end: "(?=^(?:(?:\xE2\x9C\x82-{6})+|_{10})$)"
|
44
|
+
patterns:
|
45
|
+
- include: text.html.markdown
|
46
|
+
comment: "\n\
|
47
|
+
\t\t\t\t\t\tname = 'meta.separator.notes.s5';\n\
|
48
|
+
\t\t\t\t\t\tmatch = '(^#{10}$)';\n\
|
49
|
+
\t\t\t\t\t"
|
50
|
+
- begin: "^((\xE2\x9C\x82-{6})+$\\n)"
|
51
|
+
contentName: text.html.markdown.slide.s5
|
52
|
+
beginCaptures:
|
53
|
+
"1":
|
54
|
+
name: meta.separator.slide.s5
|
55
|
+
end: "(?=^(?:(?:\xE2\x9C\x82-{6})+|_{10}|#{10})$)"
|
56
|
+
patterns:
|
57
|
+
- include: text.html.markdown
|
58
|
+
comment: "\n\
|
59
|
+
\t\t\t\t\t\tname = 'meta.separator.slide.s5';\n\
|
60
|
+
\t\t\t\t\t\tmatch = '^((\xE2\x9C\x82-{6})+$\\n)';\n\
|
61
|
+
\t\t\t\t\t"
|
62
|
+
- include: text.html.markdown
|
63
|
+
foldingStopMarker: |-
|
64
|
+
(?x)
|
65
|
+
(</(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|form|dl)>
|
66
|
+
|^\s*-->
|
67
|
+
|(^|\s)\}
|
68
|
+
)
|
69
|
+
keyEquivalent: ^~S
|
@@ -0,0 +1,45 @@
|
|
1
|
+
---
|
2
|
+
name: SASS
|
3
|
+
fileTypes: []
|
4
|
+
|
5
|
+
scopeName: source.sass
|
6
|
+
uuid: 0AB51F6F-7780-4BF2-BEE3-5405ABA6A6B9
|
7
|
+
foldingStartMarker: /\*|^#|^\*|^\b|^\.
|
8
|
+
patterns:
|
9
|
+
- name: keyword.control.untitled
|
10
|
+
match: \b(a|abbr|acronym|address|area|b|base|big|blockquote|body|br|button|caption|cite|code|col|colgroup|dd|del|dfn|div|dl|dt|em|fieldset|form|frame|frameset|(h[1-6])|head|hr|html|i|iframe|img|input|ins|kbd|label|legend|li|link|map|meta|noframes|noscript|object|ol|optgroup|option|p|param|pre|q|samp|script|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|title|tr|tt|ul|var)\b
|
11
|
+
- name: string.quoted.double.sass
|
12
|
+
begin: "\""
|
13
|
+
end: "\""
|
14
|
+
patterns:
|
15
|
+
- name: constant.character.escaped.sass
|
16
|
+
match: \\.
|
17
|
+
- name: entity.other.attribute-name.class.sass
|
18
|
+
match: \.[a-zA-Z0-9_-]+
|
19
|
+
- name: constant.other.rgb-value.sass
|
20
|
+
match: (#)([0-9a-fA-F]{3}|[0-9a-fA-F]{6})\b
|
21
|
+
- name: entity.other.attribute-name.id.sass
|
22
|
+
match: "#[a-zA-Z0-9_-]+"
|
23
|
+
- name: variable.parameter.sass
|
24
|
+
match: "![a-zA-Z0-9_-]+"
|
25
|
+
- name: comment.block.sass
|
26
|
+
begin: /\*
|
27
|
+
end: \*/
|
28
|
+
- name: comment.line.double-slash.sass
|
29
|
+
begin: //
|
30
|
+
end: $\n?
|
31
|
+
- name: constant.numeric.sass
|
32
|
+
match: (-|\+)?\s*[0-9]+(\.[0-9]+)?
|
33
|
+
- name: constant.other.unit.sass
|
34
|
+
match: (?<=[\d])(px|pt|cm|mm|in|em|ex|pc)\b|%
|
35
|
+
- name: variable.parameter.url
|
36
|
+
begin: url
|
37
|
+
end: \)
|
38
|
+
- name: support.type.property-name.sass
|
39
|
+
match: (:)(azimuth|background-attachment|background-color|background-image|background-position|background-repeat|background|border-bottom-color|border-bottom-style|border-bottom-width|border-bottom|border-collapse|border-color|border-left-color|border-left-style|border-left-width|border-left|border-right-color|border-right-style|border-right-width|border-right|border-spacing|border-style|border-top-color|border-top-style|border-top-width|border-top|border-width|border|bottom|caption-side|clear|clip|color|content|counter-increment|counter-reset|cue-after|cue-before|cue|cursor|direction|display|elevation|empty-cells|float|font-family|font-size-adjust|font-size|font-stretch|font-style|font-variant|font-weight|font|height|left|letter-spacing|line-height|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|marker-offset|margin|marks|max-height|max-width|min-height|min-width|-moz-border-radius|orphans|outline-color|outline-style|outline-width|outline|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page|pause-after|pause-before|pause|pitch-range|pitch|play-during|position|quotes|richness|right|size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|stress|table-layout|text-align|text-decoration|text-indent|text-shadow|text-transform|top|unicode-bidi|vertical-align|visibility|voice-family|volume|white-space|widows|width|word-spacing|z-index)\b
|
40
|
+
- name: support.constant.property-value.sass
|
41
|
+
match: \b(absolute|all-scroll|always|auto|baseline|below|bidi-override|block|bold|bolder|both|bottom|break-all|break-word|capitalize|center|char|circle|col-resize|collapse|crosshair|dashed|decimal|default|disabled|disc|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ellipsis|fixed|groove|hand|help|hidden|horizontal|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|inactive|inherit|inline-block|inline|inset|inside|inter-ideograph|inter-word|italic|justify|keep-all|left|lighter|line-edge|line-through|line|list-item|loose|lower-alpha|lower-roman|lowercase|lr-tb|ltr|medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|solid|square|static|strict|super|sw-resize|table-footer-group|table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|transparent|underline|upper-alpha|upper-roman|uppercase|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace)\b
|
42
|
+
- name: support.constant.font-name.sass
|
43
|
+
match: (\b(?i:arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace)\b)
|
44
|
+
foldingStopMarker: \*/|^\s*$
|
45
|
+
keyEquivalent: ^~S
|
@@ -0,0 +1,347 @@
|
|
1
|
+
---
|
2
|
+
name: Scheme
|
3
|
+
fileTypes:
|
4
|
+
- scm
|
5
|
+
- sch
|
6
|
+
scopeName: source.scheme
|
7
|
+
repository:
|
8
|
+
illegal:
|
9
|
+
name: invalid.illegal.parenthesis.scheme
|
10
|
+
match: "[()]"
|
11
|
+
quote-sexp:
|
12
|
+
begin: (?<=\()\s*(quote)\b\s*
|
13
|
+
contentName: string.other.quote.scheme
|
14
|
+
beginCaptures:
|
15
|
+
"1":
|
16
|
+
name: keyword.control.quote.scheme
|
17
|
+
end: (?=[\s)])|(?<=\n)
|
18
|
+
patterns:
|
19
|
+
- include: "#quoted"
|
20
|
+
comment: "\n\
|
21
|
+
\t\t\t\tSomething quoted with (quote \xC2\xABthing\xC2\xBB). In this case \xC2\xABthing\xC2\xBB\n\
|
22
|
+
\t\t\t\twill not be evaluated, so we are considering it a string.\n\
|
23
|
+
\t\t\t"
|
24
|
+
quote:
|
25
|
+
patterns:
|
26
|
+
- name: constant.other.symbol.scheme
|
27
|
+
captures:
|
28
|
+
"1":
|
29
|
+
name: punctuation.section.quoted.symbol.scheme
|
30
|
+
match: "(?x)\n\
|
31
|
+
\t\t\t\t\t\t(')\\s*\n\
|
32
|
+
\t\t\t\t\t\t([[:alnum:]][[:alnum:]!$%&*+-./:<=>?@^_~]*)\n\
|
33
|
+
\t\t\t\t\t"
|
34
|
+
- name: constant.other.empty-list.schem
|
35
|
+
captures:
|
36
|
+
"1":
|
37
|
+
name: punctuation.section.quoted.empty-list.scheme
|
38
|
+
"2":
|
39
|
+
name: meta.expression.scheme
|
40
|
+
"3":
|
41
|
+
name: punctuation.section.expression.begin.scheme
|
42
|
+
"4":
|
43
|
+
name: punctuation.section.expression.end.scheme
|
44
|
+
match: "(?x)\n\
|
45
|
+
\t\t\t\t\t\t(')\\s*\n\
|
46
|
+
\t\t\t\t\t\t((\\()\\s*(\\)))\n\
|
47
|
+
\t\t\t\t\t"
|
48
|
+
- name: string.other.quoted-object.scheme
|
49
|
+
begin: (')\s*
|
50
|
+
beginCaptures:
|
51
|
+
"1":
|
52
|
+
name: punctuation.section.quoted.scheme
|
53
|
+
end: (?=[\s()])|(?<=\n)
|
54
|
+
patterns:
|
55
|
+
- include: "#quoted"
|
56
|
+
comment: quoted double-quoted string or s-expression
|
57
|
+
comment: "\n\
|
58
|
+
\t\t\t\tWe need to be able to quote any kind of item, which creates\n\
|
59
|
+
\t\t\t\ta tiny bit of complexity in our grammar. It is hopefully\n\
|
60
|
+
\t\t\t\tnot overwhelming complexity.\n\
|
61
|
+
\t\t\t\t\n\
|
62
|
+
\t\t\t\tNote: the first two matches are special cases. quoted\n\
|
63
|
+
\t\t\t\tsymbols, and quoted empty lists are considered constant.other\n\
|
64
|
+
\t\t\t\t\n\
|
65
|
+
\t\t\t"
|
66
|
+
language-functions:
|
67
|
+
patterns:
|
68
|
+
- name: keyword.control.scheme
|
69
|
+
match: |-
|
70
|
+
(?x)
|
71
|
+
(?<=(\s|\()) # preceded by space or (
|
72
|
+
( do|or|and|else|quasiquote|begin|if|case|set!|
|
73
|
+
cond|let|unquote|define|let\*|unquote-splicing|delay|
|
74
|
+
letrec)
|
75
|
+
(?=(\s|\())
|
76
|
+
- name: support.function.boolean-test.scheme
|
77
|
+
match: "(?x)\n\
|
78
|
+
\t\t\t\t\t\t(?<=(\\s|\\()) # preceded by space or (\n\
|
79
|
+
\t\t\t\t\t\t( char-alphabetic|char-lower-case|char-numeric|\n\
|
80
|
+
\t\t\t\t\t\t char-ready|char-upper-case|char-whitespace|\n\
|
81
|
+
\t\t\t\t\t\t (?:char|string)(?:-ci)?(?:=|<=?|>=?)|\n\
|
82
|
+
\t\t\t\t\t\t atom|boolean|bound-identifier=|char|complex|\n\
|
83
|
+
\t\t\t\t\t\t identifier|integer|symbol|free-identifier=|inexact|\n\
|
84
|
+
\t\t\t\t\t\t eof-object|exact|list|(?:input|output)-port|pair|\n\
|
85
|
+
\t\t\t\t\t\t real|rational|zero|vector|negative|odd|null|string|\n\
|
86
|
+
\t\t\t\t\t\t eq|equal|eqv|even|number|positive|procedure\n\
|
87
|
+
\t\t\t\t\t\t)\n\
|
88
|
+
\t\t\t\t\t\t(\\?)\t\t# name ends with ? sign\n\
|
89
|
+
\t\t\t\t\t\t(?=(\\s|\\()) # followed by space or (\n\
|
90
|
+
\t\t\t\t\t"
|
91
|
+
comment: "\n\
|
92
|
+
\t\t\t\t\t\tThese functions run a test, and return a boolean\n\
|
93
|
+
\t\t\t\t\t\tanswer.\n\
|
94
|
+
\t\t\t\t\t"
|
95
|
+
- name: support.function.convert-type.scheme
|
96
|
+
match: "(?x)\n\
|
97
|
+
\t\t\t\t\t\t(?<=(\\s|\\()) # preceded by space or (\n\
|
98
|
+
\t\t\t\t\t\t( char->integer|exact->inexact|inexact->exact|\n\
|
99
|
+
\t\t\t\t\t\t integer->char|symbol->string|list->vector|\n\
|
100
|
+
\t\t\t\t\t\t list->string|identifier->symbol|vector->list|\n\
|
101
|
+
\t\t\t\t\t\t string->list|string->number|string->symbol|\n\
|
102
|
+
\t\t\t\t\t\t number->string\n\
|
103
|
+
\t\t\t\t\t\t)\n\
|
104
|
+
\t\t\t\t\t\t(?=(\\s|\\()) # followed by space or (\t\t\t\t\t\n\
|
105
|
+
\t\t\t\t\t"
|
106
|
+
comment: "\n\
|
107
|
+
\t\t\t\t\t\tThese functions change one type into another.\n\
|
108
|
+
\t\t\t\t\t"
|
109
|
+
- name: support.function.with-side-effects.scheme
|
110
|
+
match: "(?x)\n\
|
111
|
+
\t\t\t\t\t\t(?<=(\\s|\\()) # preceded by space or (\n\
|
112
|
+
\t\t\t\t\t\t( set-(?:car|cdr)|\t\t\t\t # set car/cdr\n\
|
113
|
+
\t\t\t\t\t\t (?:vector|string)-(?:fill|set) # fill/set string/vector\n\
|
114
|
+
\t\t\t\t\t\t)\n\
|
115
|
+
\t\t\t\t\t\t(!)\t\t\t# name ends with ! sign\n\
|
116
|
+
\t\t\t\t\t\t(?=(\\s|\\()) # followed by space or (\n\
|
117
|
+
\t\t\t\t\t"
|
118
|
+
comment: "\n\
|
119
|
+
\t\t\t\t\t\tThese functions are potentially dangerous because\n\
|
120
|
+
\t\t\t\t\t\tthey have side-effects which could affect other\n\
|
121
|
+
\t\t\t\t\t\tparts of the program.\n\
|
122
|
+
\t\t\t\t\t"
|
123
|
+
- name: support.function.arithmetic-operators.scheme
|
124
|
+
match: "(?x)\n\
|
125
|
+
\t\t\t\t\t\t(?<=(\\s|\\()) # preceded by space or (\n\
|
126
|
+
\t\t\t\t\t\t( >=?|<=?|=|[*/+-])\n\
|
127
|
+
\t\t\t\t\t\t(?=(\\s|\\()) # followed by space or (\n\
|
128
|
+
\t\t\t\t\t\t"
|
129
|
+
comment: "\n\
|
130
|
+
\t\t\t\t\t\t+, -, *, /, =, >, etc. \n\
|
131
|
+
\t\t\t\t\t"
|
132
|
+
- name: support.function.general.scheme
|
133
|
+
match: "(?x)\n\
|
134
|
+
\t\t\t\t\t\t(?<=(\\s|\\()) # preceded by space or (\n\
|
135
|
+
\t\t\t\t\t\t( append|apply|approximate|\n\
|
136
|
+
\t\t\t\t\t\t call-with-current-continuation|call/cc|catch|\n\
|
137
|
+
\t\t\t\t\t\t construct-identifier|define-syntax|display|foo|\n\
|
138
|
+
\t\t\t\t\t\t for-each|force|cd|gen-counter|gen-loser|\n\
|
139
|
+
\t\t\t\t\t\t generate-identifier|last-pair|length|let-syntax|\n\
|
140
|
+
\t\t\t\t\t\t letrec-syntax|list|list-ref|list-tail|load|log|\n\
|
141
|
+
\t\t\t\t\t\t macro|magnitude|map|map-streams|max|member|memq|\n\
|
142
|
+
\t\t\t\t\t\t memv|min|newline|nil|not|peek-char|rationalize|\n\
|
143
|
+
\t\t\t\t\t\t read|read-char|return|reverse|sequence|substring|\n\
|
144
|
+
\t\t\t\t\t\t syntax|syntax-rules|transcript-off|transcript-on|\n\
|
145
|
+
\t\t\t\t\t\t truncate|unwrap-syntax|values-list|write|write-char|\n\
|
146
|
+
\t\t\t\t\t\t \n\
|
147
|
+
\t\t\t\t\t\t # cons, car, cdr, etc\n\
|
148
|
+
\t\t\t\t\t\t cons|c(a|d){1,4}r| \n \n\
|
149
|
+
\t\t\t\t\t\t # unary math operators\n\
|
150
|
+
\t\t\t\t\t\t abs|acos|angle|asin|assoc|assq|assv|atan|ceiling|\n\
|
151
|
+
\t\t\t\t\t\t cos|floor|round|sin|sqrt|tan|\n\
|
152
|
+
\t\t\t\t\t\t (?:real|imag)-part|numerator|denominator\n \n\
|
153
|
+
\t\t\t\t\t\t # other math operators\n\
|
154
|
+
\t\t\t\t\t\t modulo|exp|expt|remainder|quotient|lcm|\n \n\
|
155
|
+
\t\t\t\t\t\t # ports / files\n\
|
156
|
+
\t\t\t\t\t\t call-with-(?:input|output)-file|\n\
|
157
|
+
\t\t\t\t\t\t (?:close|current)-(?:input|output)-port|\n\
|
158
|
+
\t\t\t\t\t\t with-(?:input|output)-from-file|\n\
|
159
|
+
\t\t\t\t\t\t open-(?:input|output)-file|\n\
|
160
|
+
\t\t\t\t\t\t \n\
|
161
|
+
\t\t\t\t\t\t # char-\xC2\xABfoo\xC2\xBB\n\
|
162
|
+
\t\t\t\t\t\t char-(?:downcase|upcase|ready)|\n\
|
163
|
+
\t\t\t\t\t\t \n\
|
164
|
+
\t\t\t\t\t\t # make-\xC2\xABfoo\xC2\xBB\n\
|
165
|
+
\t\t\t\t\t\t make-(?:polar|promise|rectangular|string|vector)\n\
|
166
|
+
\t\t\t\t\t\t \n\
|
167
|
+
\t\t\t\t\t\t # string-\xC2\xABfoo\xC2\xBB, vector-\xC2\xABfoo\xC2\xBB\n\
|
168
|
+
\t\t\t\t\t\t string(?:-(?:append|copy|length|ref))?|\n\
|
169
|
+
\t\t\t\t\t\t vector(?:-length|-ref)\n\
|
170
|
+
\t\t\t\t\t\t)\n\
|
171
|
+
\t\t\t\t\t\t(?=(\\s|\\()) # followed by space or (\n\
|
172
|
+
\t\t\t\t\t"
|
173
|
+
quoted:
|
174
|
+
patterns:
|
175
|
+
- include: "#string"
|
176
|
+
- name: meta.expression.scheme
|
177
|
+
endCaptures:
|
178
|
+
"1":
|
179
|
+
name: punctuation.section.expression.end.scheme
|
180
|
+
begin: (\()
|
181
|
+
beginCaptures:
|
182
|
+
"1":
|
183
|
+
name: punctuation.section.expression.begin.scheme
|
184
|
+
end: (\))
|
185
|
+
patterns:
|
186
|
+
- include: "#quoted"
|
187
|
+
- include: "#quote"
|
188
|
+
- include: "#illegal"
|
189
|
+
constants:
|
190
|
+
patterns:
|
191
|
+
- name: constant.language.boolean.scheme
|
192
|
+
match: "#[t|f]"
|
193
|
+
- name: constant.numeric.scheme
|
194
|
+
match: (?<=[\(\s])(#e|#i)?[0-9][0-9.]*
|
195
|
+
- name: constant.numeric.scheme
|
196
|
+
match: (?<=[\(\s])(#x)[0-9a-fA-F]+
|
197
|
+
- name: constant.numeric.scheme
|
198
|
+
match: (?<=[\(\s])(#o)[0-7]+
|
199
|
+
- name: constant.numeric.scheme
|
200
|
+
match: (?<=[\(\s])(#b)[01]+
|
201
|
+
comment:
|
202
|
+
name: comment.line.semicolon.scheme
|
203
|
+
captures:
|
204
|
+
"1":
|
205
|
+
name: punctuation.definition.comment.semicolon.scheme
|
206
|
+
match: (;).*$\n?
|
207
|
+
string:
|
208
|
+
name: string.quoted.double.scheme
|
209
|
+
endCaptures:
|
210
|
+
"1":
|
211
|
+
name: punctuation.definition.string.end.scheme
|
212
|
+
begin: (")
|
213
|
+
beginCaptures:
|
214
|
+
"1":
|
215
|
+
name: punctuation.definition.string.begin.scheme
|
216
|
+
end: (")
|
217
|
+
patterns:
|
218
|
+
- name: constant.character.escape.scheme
|
219
|
+
match: \\.
|
220
|
+
sexp:
|
221
|
+
name: meta.expression.scheme
|
222
|
+
endCaptures:
|
223
|
+
"1":
|
224
|
+
name: punctuation.section.expression.end.scheme
|
225
|
+
"2":
|
226
|
+
name: meta.after-expression.scheme
|
227
|
+
begin: (\()
|
228
|
+
beginCaptures:
|
229
|
+
"1":
|
230
|
+
name: punctuation.section.expression.begin.scheme
|
231
|
+
end: (\))(\n)?
|
232
|
+
patterns:
|
233
|
+
- include: "#comment"
|
234
|
+
- name: meta.declaration.procedure.scheme
|
235
|
+
captures:
|
236
|
+
"1":
|
237
|
+
name: keyword.control.scheme
|
238
|
+
"2":
|
239
|
+
name: entity.name.function.scheme
|
240
|
+
"3":
|
241
|
+
name: variable.parameter.function.scheme
|
242
|
+
begin: "(?x)\n\
|
243
|
+
\t\t\t\t\t\t(?<=\\() # preceded by (\n\
|
244
|
+
\t\t\t\t\t\t(define)\\s+ # define\n\
|
245
|
+
\t\t\t\t\t\t\\( # list of parameters\n\
|
246
|
+
\t\t\t\t\t\t ([[:alnum:]][[:alnum:]!$%&*+-./:<=>?@^_~]*)\n\
|
247
|
+
\t\t\t\t\t\t ((\\s+\n\
|
248
|
+
\t\t\t\t\t\t ([[:alnum:]][[:alnum:]!$%&*+-./:<=>?@^_~]*|[._])\n\
|
249
|
+
\t\t\t\t\t\t )*\n\
|
250
|
+
\t\t\t\t\t\t )\\s*\n\
|
251
|
+
\t\t\t\t\t\t\\)\n\
|
252
|
+
\t\t\t\t\t"
|
253
|
+
end: (?=\))
|
254
|
+
patterns:
|
255
|
+
- include: "#comment"
|
256
|
+
- include: "#sexp"
|
257
|
+
- include: "#illegal"
|
258
|
+
- name: meta.declaration.procedure.scheme
|
259
|
+
captures:
|
260
|
+
"1":
|
261
|
+
name: keyword.control.scheme
|
262
|
+
"2":
|
263
|
+
name: variable.parameter.scheme
|
264
|
+
begin: "(?x)\n\
|
265
|
+
\t\t\t\t\t\t(?<=\\() # preceded by (\n\
|
266
|
+
\t\t\t\t\t\t(lambda)\\s+\n\
|
267
|
+
\t\t\t\t\t\t(\\() # opening paren\n\
|
268
|
+
\t\t\t\t\t\t((?:\n\
|
269
|
+
\t\t\t\t\t\t ([[:alnum:]][[:alnum:]!$%&*+-./:<=>?@^_~]*|[._])\n\
|
270
|
+
\t\t\t\t\t\t \\s*\n\
|
271
|
+
\t\t\t\t\t\t)*)\n\
|
272
|
+
\t\t\t\t\t\t(\\)) # closing paren\n\
|
273
|
+
\t\t\t\t\t"
|
274
|
+
end: (?=\))
|
275
|
+
patterns:
|
276
|
+
- include: "#comment"
|
277
|
+
- include: "#sexp"
|
278
|
+
- include: "#illegal"
|
279
|
+
comment: "\n\
|
280
|
+
\t\t\t\t\t\tNot sure this one is quite correct. That \\s* is\n\
|
281
|
+
\t\t\t\t\t\tparticularly troubling\n\
|
282
|
+
\t\t\t\t\t"
|
283
|
+
- name: meta.declaration.variable.scheme
|
284
|
+
captures:
|
285
|
+
"1":
|
286
|
+
name: keyword.control.scheme
|
287
|
+
"2":
|
288
|
+
name: variable.other.scheme
|
289
|
+
begin: (?<=\()(define)\s([[:alnum:]][[:alnum:]!$%&*+-./:<=>?@^_~]*)\s*.*?
|
290
|
+
end: (?=\))
|
291
|
+
patterns:
|
292
|
+
- include: "#comment"
|
293
|
+
- include: "#sexp"
|
294
|
+
- include: "#illegal"
|
295
|
+
- include: "#quote-sexp"
|
296
|
+
- include: "#quote"
|
297
|
+
- include: "#language-functions"
|
298
|
+
- include: "#string"
|
299
|
+
- include: "#constants"
|
300
|
+
- name: constant.character.named.scheme
|
301
|
+
match: (?<=[\(\s])(#\\)(space|newline|tab)(?=[\s\)])
|
302
|
+
- name: constant.character.hex-literal.scheme
|
303
|
+
match: (?<=[\(\s])(#\\)x[0-9A-F]{2,4}(?=[\s\)])
|
304
|
+
- name: constant.character.escape.scheme
|
305
|
+
match: (?<=[\(\s])(#\\).(?=[\s\)])
|
306
|
+
- name: punctuation.separator.cons.scheme
|
307
|
+
match: (?<=[ ()])\.(?=[ ()])
|
308
|
+
comment: "\n\
|
309
|
+
\t\t\t\t\t\tthe . in (a . b) which conses together two elements\n\
|
310
|
+
\t\t\t\t\t\ta and b. (a b c) == (a . (b . (c . nil)))\n\
|
311
|
+
\t\t\t\t\t"
|
312
|
+
- include: "#sexp"
|
313
|
+
- include: "#illegal"
|
314
|
+
uuid: 3EC2CFD0-909C-4692-AC29-1A60ADBC161E
|
315
|
+
foldingStartMarker: |-
|
316
|
+
(?x)^ [ \t]* \(
|
317
|
+
(?<par>
|
318
|
+
( [^()\n]++ | \( \g<par> \)? )*+
|
319
|
+
)
|
320
|
+
$
|
321
|
+
patterns:
|
322
|
+
- include: "#comment"
|
323
|
+
- include: "#sexp"
|
324
|
+
- include: "#string"
|
325
|
+
- include: "#language-functions"
|
326
|
+
- include: "#quote"
|
327
|
+
- include: "#illegal"
|
328
|
+
foldingStopMarker: |-
|
329
|
+
(?x)^ [ \t]*
|
330
|
+
(?<par>
|
331
|
+
( [^()\n]++ | \( \g<par> \) )*+
|
332
|
+
)
|
333
|
+
( \) [ \t]*+ ) ++
|
334
|
+
$
|
335
|
+
keyEquivalent: ^~S
|
336
|
+
comment: "\n\
|
337
|
+
\t\tThe foldings do not currently work the way I want them to. This\n\
|
338
|
+
\t\tmay be a limitation of the way they are applied rather than the\n\
|
339
|
+
\t\tregexps in use. Nonetheless, the foldings will end on the last\n\
|
340
|
+
\t\tidentically indented blank line following an s-expression. Not\n\
|
341
|
+
\t\tideal perhaps, but it works. Also, the #illegal pattern never\n\
|
342
|
+
\t\tmatches an unpaired ( as being illegal. Why?! -- Rob Rix\n\
|
343
|
+
\t\t\n\
|
344
|
+
\t\tOk, hopefully this grammar works better on quoted stuff now. It\n\
|
345
|
+
\t\tmay break for fancy macros, but should generally work pretty\n\
|
346
|
+
\t\tsmoothly. -- Jacob Rus\n\
|
347
|
+
\t"
|