Adding experimental new grammars

This commit is contained in:
knsv
2014-12-04 17:58:05 +01:00
parent 2a0a2a2269
commit 4c564ebe9e
10 changed files with 1660 additions and 132 deletions

View File

@@ -2,10 +2,20 @@
* Created by knut on 14-11-23.
*/
module.exports.detectType = function(text){
if(text.match(/^\s*sequenceDiagram/)){
console.log('Detected sequenceDiagram syntax');
return "sequenceDiagram";
}
if(text.match(/^\s*sequence/)){
//console.log('Detected sequence syntax');
return "sequence";
}
else{
return "graph";
if(text.match(/^\s*digraph/)) {
console.log('Detected flow syntax');
return "dotGraph";
}
return "graph";
}