github.com/elliott5/community@v0.14.1-0.20160709191136-823126fb026a/app/public/codemirror/mode/mscgen/msgenny_test.js (about) 1 // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 // Distributed under an MIT license: http://codemirror.net/LICENSE 3 4 (function() { 5 var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-msgenny"); 6 function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "msgenny"); } 7 8 MT("comments", 9 "[comment // a single line comment]", 10 "[comment # another single line comment /* and */ ignored here]", 11 "[comment /* A multi-line comment even though it contains]", 12 "[comment msc keywords and \"quoted text\"*/]"); 13 14 MT("strings", 15 "[string \"// a string\"]", 16 "[string \"a string running over]", 17 "[string two lines\"]", 18 "[string \"with \\\"escaped quote\"]" 19 ); 20 21 MT("xù/ msgenny keywords classify as 'keyword'", 22 "[keyword watermark]", 23 "[keyword alt]","[keyword loop]","[keyword opt]","[keyword ref]","[keyword else]","[keyword break]","[keyword par]","[keyword seq]","[keyword assert]" 24 ); 25 26 MT("mscgen options classify as keyword", 27 "[keyword hscale]", "[keyword width]", "[keyword arcgradient]", "[keyword wordwraparcs]" 28 ); 29 30 MT("mscgen arcs classify as keyword", 31 "[keyword note]","[keyword abox]","[keyword rbox]","[keyword box]", 32 "[keyword |||...---]", "[keyword ..--==::]", 33 "[keyword ->]", "[keyword <-]", "[keyword <->]", 34 "[keyword =>]", "[keyword <=]", "[keyword <=>]", 35 "[keyword =>>]", "[keyword <<=]", "[keyword <<=>>]", 36 "[keyword >>]", "[keyword <<]", "[keyword <<>>]", 37 "[keyword -x]", "[keyword x-]", "[keyword -X]", "[keyword X-]", 38 "[keyword :>]", "[keyword <:]", "[keyword <:>]" 39 ); 40 41 MT("within an attribute list, mscgen/ xù attributes classify as base", 42 "[base [[label]", 43 "[base idurl id url]", 44 "[base linecolor linecolour textcolor textcolour textbgcolor textbgcolour]", 45 "[base arclinecolor arclinecolour arctextcolor arctextcolour arctextbgcolor arctextbgcolour]", 46 "[base arcskip]]]" 47 ); 48 49 MT("outside an attribute list, mscgen/ xù attributes classify as base", 50 "[base label]", 51 "[base idurl id url]", 52 "[base linecolor linecolour textcolor textcolour textbgcolor textbgcolour]", 53 "[base arclinecolor arclinecolour arctextcolor arctextcolour arctextbgcolor arctextbgcolour]", 54 "[base arcskip]" 55 ); 56 57 MT("a typical program", 58 "[comment # typical msgenny program]", 59 "[keyword wordwraparcs][operator =][string \"true\"][base , ][keyword hscale][operator =][string \"0.8\"][base , ][keyword arcgradient][operator =][base 30;]", 60 "[base a : ][string \"Entity A\"][base ,]", 61 "[base b : Entity B,]", 62 "[base c : Entity C;]", 63 "[base a ][keyword =>>][base b: ][string \"Hello entity B\"][base ;]", 64 "[base a ][keyword alt][base c][bracket {]", 65 "[base a ][keyword <<][base b: ][string \"Here's an answer dude!\"][base ;]", 66 "[keyword ---][base : ][string \"sorry, won't march - comm glitch\"]", 67 "[base a ][keyword x-][base b: ][string \"Here's an answer dude! (won't arrive...)\"][base ;]", 68 "[bracket }]", 69 "[base c ][keyword :>][base *: What about me?;]" 70 ); 71 })();