X-Git-Url: https://scm.cri.ensmp.fr/git/Faustine.git/blobdiff_plain/c7f552fd8888da2f0d8cfb228fe0f28d3df3a12c..b4b6f2ea75b9f0f3ca918f5b84016610bf7a4d4f:/interpretor/preprocessor/faust-0.9.47mr3/syntax-highlighting/codepress/faust.js diff --git a/interpretor/preprocessor/faust-0.9.47mr3/syntax-highlighting/codepress/faust.js b/interpretor/preprocessor/faust-0.9.47mr3/syntax-highlighting/codepress/faust.js new file mode 100755 index 0000000..498801f --- /dev/null +++ b/interpretor/preprocessor/faust-0.9.47mr3/syntax-highlighting/codepress/faust.js @@ -0,0 +1,69 @@ +/* + * CodePress regular expressions for Faust syntax highlighting (derived from Java) + */ + +// Faust +Language.syntax = [ + { input : /\"(.*?)(\"|
|<\/P>)/g, output : '"$1$2'}, // strings double quote + { input : /\b(component|library|environment|mem|prefix|int|float|rdtable|rwtable|select2|select3|ffunction|fconstant|fvariable|button|checkbox|vslider|hslider|nentry|vbargraph|hbargraph|attach|acos|asin|atan|atan2|cos|sin|tan|exp|log|log10|pow|sqrt|abs|min|max|fmod|remainder|floor|ceil|rint)\b/g, output : '$1'}, + { input : /\b(process|with|case|seq|par|sum|prod|import|vgroup|hgroup|tgroup|declare)\b/g, output : '$1'}, + { input : /(<:|:>|,|:)/g, output : '$1'}, + { input : /(~)/g, output : '$1'}, + { input : /([^:]|^)\/\/(.*?)(//$2$3'}, // comments // + { input : /\/\*(.*?)\*\//g, output : '/*$1*/' } // comments /* */ +] + + + +Language.snippets = [ + // program and definitions + { input : 'pr', output : 'process = $0;' }, + { input : 'im', output : 'import("$0.lib");' }, + { input : 'co', output : 'component("$0.dsp")' }, + { input : 'li', output : 'library("$0.dsp")' }, + { input : 'en', output : 'environment {$0}' }, + { input : 'wi', output : 'with {$0}' }, + + // pattern matching + { input : 'ca', output : 'case {$0}' }, + { input : 'ru', output : '($0) => ...;' }, + + // declaration + { input : 'de', output : 'declare $0 \t"";' }, + { input : 'dn', output : 'declare name "$0";' }, + { input : 'da', output : 'declare author "$0";' }, + { input : 'dl', output : 'declare license "$0";' }, + { input : 'dv', output : 'declare version "$0";' }, + + // user interface + { input : 'bu', output : 'button("$0")' }, + { input : 'ch', output : 'checkbox("$0")' }, + + { input : 'hs', output : 'hslider("$0", 50, 0, 100, 0.1)' }, + { input : 'vs', output : 'vslider("$0", 50, 0, 100, 0.1)' }, + { input : 'ne', output : 'nentry ("$0", 50, 0, 100, 0.1)' }, + + { input : 'hb', output : 'hbargraph("$0", 0, 100)' }, + { input : 'vb', output : 'vbargraph("$0", 0, 100)' }, + + { input : 'vg', output : 'vgroup("$0", ...)' }, + { input : 'hg', output : 'hgroup("$0", ...)' }, + { input : 'tg', output : 'tgroup("$0", ...)' }, + + // iterations + { input : 'pa', output : 'par(i, $0, ...)' }, + { input : 'su', output : 'sum(i, $0, ...)' }, + { input : 'se', output : 'seq(i, $0, ...)' }, + { input : 'mu', output : 'prod(i, $0, ...)' }, + +] + +Language.complete = [ + { input : '\'',output : '\'$0\'' }, + { input : '"', output : '"$0"' }, + { input : '(', output : '\($0\)' }, + { input : '[', output : '\[$0\]' }, + { input : '{', output : '{\n\t$0\n}' } +] + +Language.shortcuts = []