diff --git a/demo/kitchen-sink/docs/praat.praat b/demo/kitchen-sink/docs/praat.praat index 48a649a2..f15e4058 100644 --- a/demo/kitchen-sink/docs/praat.praat +++ b/demo/kitchen-sink/docs/praat.praat @@ -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 diff --git a/lib/ace/mode/praat_highlight_rules.js b/lib/ace/mode/praat_highlight_rules.js index 9ba554ec..1e53b94c 100644 --- a/lib/ace/mode/praat_highlight_rules.js +++ b/lib/ace/mode/praat_highlight_rules.js @@ -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" }, {