Removed useless rules, added support for do() syntax

This commit is contained in:
baboso 2014-06-04 18:03:55 -04:00
commit a519520ae7
2 changed files with 8 additions and 18 deletions

View file

@ -63,8 +63,8 @@ for i from 1 to n
pitch = noprogress To Pitch (ac): 0, 75, 15, "no",
...0.03, 0.45, 0.01, 0.35, 0.14, 600
# Old-style command with assignment
minimum = Get minimum... 0 0 "Hertz" Parabolic
# do-style command with assignment
minimum = do("Get minimum...", 0, 0, "Hertz", "Parabolic")
# New-style multi-line command call with broken strings
table = Create Table with column names: "table", 0,
@ -76,7 +76,8 @@ for i from 1 to n
# Picture window commands
selectObject: sound
Select inner viewport: 1, 6, 0.5, 1.5
# do-style command
do("Select inner viewport...", 1, 6, 0.5, 1.5)
Black
Draw... 0 0 0 0 "no" Curve
Draw inner box

View file

@ -15,8 +15,6 @@ var PraatHighlightRules = function() {
"assert"
);
// var buildinConstants = ("ARGV|ENV|INC|SIG");
var predefinedVariables = (
"macintosh|windows|unix|" +
"praatVersion|praatVersion\\$" +
@ -91,18 +89,6 @@ var PraatHighlightRules = function() {
"ResultsMFC|EEG|ERPTier|ERP|KNN|FeatureWeights"
);
var keywordMapper = this.createKeywordMapper({
"keyword": keywords,
// "constant.language": buildinConstants,
"support.function": functions
}, "identifier");
var inlineIf = this.createKeywordMapper({
"keyword": "(if|then|else|fi)",
// "constant.language": buildinConstants,
"support.function": functions
}, "identifier");
// regexp must not have capturing parentheses. Use (?:) instead.
// regexps are ordered -> the first match is used
@ -120,6 +106,9 @@ var PraatHighlightRules = function() {
}, {
token : ["text", "keyword", "text", "keyword"],
regex : /^(\s*)(?:(demo)(\s+))?(10|12|14|16|24)$/
}, {
token : ["text", "support.function", "text"],
regex : /(\s*)(do\$?)(\s*:\s*|\s*\(\s*)/
}, {
// Is this rule necessary?
// token : ["text", "keyword"],
@ -151,7 +140,7 @@ var PraatHighlightRules = function() {
regex : /"[^"]*$/,
next : "brokenstring"
}, {
token : ["text", "keyword", "text", "entity.name.section"], // multi line string start
token : ["text", "keyword", "text", "entity.name.section"],
regex : /(^\s*)(\bform\b)(\s+)(.*)/,
next : "form"
}, {