From 4904f74dbdcc21a0a58852f55194a81864ebf8cf Mon Sep 17 00:00:00 2001 From: baboso Date: Tue, 8 Jul 2014 15:18:57 -0400 Subject: [PATCH] Minor changes to Praat syntax files --- demo/kitchen-sink/docs/praat.praat | 16 +++++++++ lib/ace/mode/praat_highlight_rules.js | 51 ++++++++++++++------------- lib/ace/snippets/praat.js | 7 ++++ lib/ace/snippets/praat.snippets | 0 4 files changed, 49 insertions(+), 25 deletions(-) create mode 100644 lib/ace/snippets/praat.js create mode 100644 lib/ace/snippets/praat.snippets diff --git a/demo/kitchen-sink/docs/praat.praat b/demo/kitchen-sink/docs/praat.praat index c5dde785..3700ae6f 100644 --- a/demo/kitchen-sink/docs/praat.praat +++ b/demo/kitchen-sink/docs/praat.praat @@ -59,6 +59,22 @@ for i from 1 to n selectObject(sound[i]) selectObject: sound + # Pause commands + beginPause("Viewing " + sound$) + if i > 1 + button = endPause("Stop", "Previous", + ...if i = total_sounds then "Finish" else "Next" fi, + ...3, 1) + else + button = endPause("Stop", + ...if i = total_sounds then "Finish" else "Next" fi, + ...2, 1) + endif + editor_name$ = if total_textgrids then "TextGrid " else "Sound " fi + name$ + nocheck editor 'editor_name$' + nocheck Close + nocheck endeditor + # New-style standalone command call Rename: "SomeName" diff --git a/lib/ace/mode/praat_highlight_rules.js b/lib/ace/mode/praat_highlight_rules.js index 9cf98bcb..8b826487 100644 --- a/lib/ace/mode/praat_highlight_rules.js +++ b/lib/ace/mode/praat_highlight_rules.js @@ -74,27 +74,28 @@ var PraatHighlightRules = function() { ); var objectTypes = ( - "Collection|Strings|ManPages|SortedSetOfString|Sound|Matrix|Polygon|" + - "PointProcess|ParamCurve|Spectrum|Ltas|Spectrogram|Formant|" + - "Excitation|Cochleagram|VocalTract|FormantPoint|FormantTier|" + - "FormantGrid|Label|Tier|Autosegment|Intensity|Pitch|Harmonicity|" + - "Transition|RealPoint|RealTier|PitchTier|IntensityTier|DurationTier|" + - "AmplitudeTier|SpectrumTier|Manipulation|TextPoint|TextInterval|" + - "TextTier|IntervalTier|TextGrid|LongSound|WordList|SpellingChecker|" + - "Movie|Corpus|TableOfReal|Distributions|PairDistribution|Table|" + - "LinearRegression|LogisticRegression|Art|Artword|Speaker|Activation|" + - "BarkFilter|Categories|Cepstrum|CCA|ChebyshevSeries|" + - "ClassificationTable|Confusion|Correlation|Covariance|Discriminant|" + - "DTW|Eigen|Excitations|FormantFilter|Index|KlattTable|Permutation|" + - "ISpline|LegendreSeries|MelFilter|MSpline|Pattern|PCA|Polynomial|" + - "Roots|SimpleString|StringsIndex|SpeechSynthesizer|SPINET|SSCP|SVD|" + - "AffineTransform|Procrustes|ContingencyTable|Dissimilarity|" + - "Similarity|Configuration|Distance|Salience|ScalarProduct|Weight|" + - "KlattGrid|HMM|HMM_State|HMM_Observation|HMM_ObservationSequence|" + - "HMM_StateSequence|GaussianMixture|Diagonalizer|MixingMatrix|" + - "CrossCorrelationTable|CrossCorrelationTables|Network|OTGrammar|" + - "OTHistory|OTMulti|FFNet|Cepstrumc|LPC|LFCC|MFCC|ExperimentMFC|" + - "ResultsMFC|EEG|ERPTier|ERP|KNN|FeatureWeights" + "Activation|AffineTransform|AmplitudeTier|Art|Artword|Autosegment|" + + "BarkFilter|CCA|Categories|Cepstrum|Cepstrumc|ChebyshevSeries|" + + "ClassificationTable|Cochleagram|Collection|Configuration|" + + "Confusion|ContingencyTable|Corpus|Correlation|Covariance|" + + "CrossCorrelationTable|CrossCorrelationTables|DTW|Diagonalizer|" + + "Discriminant|Dissimilarity|Distance|Distributions|DurationTier|" + + "EEG|ERP|ERPTier|Eigen|Excitation|Excitations|ExperimentMFC|FFNet|" + + "FeatureWeights|Formant|FormantFilter|FormantGrid|FormantPoint|" + + "FormantTier|GaussianMixture|HMM|HMM_Observation|" + + "HMM_ObservationSequence|HMM_State|HMM_StateSequence|Harmonicity|" + + "ISpline|Index|Intensity|IntensityTier|IntervalTier|KNN|KlattGrid|" + + "KlattTable|LFCC|LPC|Label|LegendreSeries|LinearRegression|" + + "LogisticRegression|LongSound|Ltas|MFCC|MSpline|ManPages|" + + "Manipulation|Matrix|MelFilter|MixingMatrix|Movie|Network|" + + "OTGrammar|OTHistory|OTMulti|PCA|PairDistribution|ParamCurve|" + + "Pattern|Permutation|Pitch|PitchTier|PointProcess|Polygon|" + + "Polynomial|Procrustes|RealPoint|RealTier|ResultsMFC|Roots|SPINET|" + + "SSCP|SVD|Salience|ScalarProduct|Similarity|SimpleString|" + + "SortedSetOfString|Sound|Speaker|Spectrogram|Spectrum|SpectrumTier|" + + "SpeechSynthesizer|SpellingChecker|Strings|StringsIndex|Table|" + + "TableOfReal|TextGrid|TextInterval|TextPoint|TextTier|Tier|" + + "Transition|VocalTract|Weight|WordList" ); // regexp must not have capturing parentheses. Use (?:) instead. @@ -103,6 +104,10 @@ var PraatHighlightRules = function() { this.$rules = { "start" : [ { + // Interpolated strings + token : "string.interpolated", + regex : /'((?:[a-z][a-zA-Z0-9_]*)(?:\$|#|:[0-9]+)?)'/ + }, { // stopwatch token : ["text", "text", "keyword.operator", "text", "keyword"], regex : /(^\s*)(?:([a-z][a-zA-Z0-9_]*\$?\s+)(=)(\s+))?(stopwatch)/ @@ -156,10 +161,6 @@ var PraatHighlightRules = function() { token : "keyword", regex : "(\\b(?:" + keywords + ")\\b)" }, { - // Interpolated strings - token : "string.interpolated", - regex : /'((?:[a-z][a-zA-Z0-9_]*)(?:\$|#|:[0-9]+)?)'/ - }, { // Generic strings token : "string", regex : /"[^"]*"/ diff --git a/lib/ace/snippets/praat.js b/lib/ace/snippets/praat.js new file mode 100644 index 00000000..18afa87f --- /dev/null +++ b/lib/ace/snippets/praat.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./praat.snippets"); +exports.scope = "praat"; + +}); diff --git a/lib/ace/snippets/praat.snippets b/lib/ace/snippets/praat.snippets new file mode 100644 index 00000000..e69de29b