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

View file

@ -15,8 +15,6 @@ var PraatHighlightRules = function() {
"assert" "assert"
); );
// var buildinConstants = ("ARGV|ENV|INC|SIG");
var predefinedVariables = ( var predefinedVariables = (
"macintosh|windows|unix|" + "macintosh|windows|unix|" +
"praatVersion|praatVersion\\$" + "praatVersion|praatVersion\\$" +
@ -91,18 +89,6 @@ var PraatHighlightRules = function() {
"ResultsMFC|EEG|ERPTier|ERP|KNN|FeatureWeights" "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. // regexp must not have capturing parentheses. Use (?:) instead.
// regexps are ordered -> the first match is used // regexps are ordered -> the first match is used
@ -120,6 +106,9 @@ var PraatHighlightRules = function() {
}, { }, {
token : ["text", "keyword", "text", "keyword"], token : ["text", "keyword", "text", "keyword"],
regex : /^(\s*)(?:(demo)(\s+))?(10|12|14|16|24)$/ 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? // Is this rule necessary?
// token : ["text", "keyword"], // token : ["text", "keyword"],
@ -151,7 +140,7 @@ var PraatHighlightRules = function() {
regex : /"[^"]*$/, regex : /"[^"]*$/,
next : "brokenstring" 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+)(.*)/, regex : /(^\s*)(\bform\b)(\s+)(.*)/,
next : "form" next : "form"
}, { }, {