mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-09 02:27:05 +02:00
Format code
This commit is contained in:
@@ -70,14 +70,15 @@
|
||||
}
|
||||
*/
|
||||
var parser = (function () {
|
||||
var o = function (k, v, o, l) { for (o = o || {}, l = k.length; l--; o[k[l]] = v);return o }, $V0 = [6, 8, 10, 11, 12, 13, 14], $V1 = [1, 9], $V2 = [1, 10], $V3 = [1, 11], $V4 = [1, 12]
|
||||
var parser = {trace: function trace () { },
|
||||
var o = function (k, v, o, l) { for (o = o || {}, l = k.length; l--; o[k[l]] = v); return o }, $V0 = [6, 8, 10, 11, 12, 13, 14], $V1 = [1, 9], $V2 = [1, 10], $V3 = [1, 11], $V4 = [1, 12]
|
||||
var parser = {
|
||||
trace: function trace () { },
|
||||
yy: {},
|
||||
symbols_: {'error': 2, 'start': 3, 'gantt': 4, 'document': 5, 'EOF': 6, 'line': 7, 'SPACE': 8, 'statement': 9, 'NL': 10, 'dateFormat': 11, 'title': 12, 'section': 13, 'taskTxt': 14, 'taskData': 15, '$accept': 0, '$end': 1},
|
||||
terminals_: {2: 'error', 4: 'gantt', 6: 'EOF', 8: 'SPACE', 10: 'NL', 11: 'dateFormat', 12: 'title', 13: 'section', 14: 'taskTxt', 15: 'taskData'},
|
||||
symbols_: { 'error': 2, 'start': 3, 'gantt': 4, 'document': 5, 'EOF': 6, 'line': 7, 'SPACE': 8, 'statement': 9, 'NL': 10, 'dateFormat': 11, 'title': 12, 'section': 13, 'taskTxt': 14, 'taskData': 15, '$accept': 0, '$end': 1 },
|
||||
terminals_: { 2: 'error', 4: 'gantt', 6: 'EOF', 8: 'SPACE', 10: 'NL', 11: 'dateFormat', 12: 'title', 13: 'section', 14: 'taskTxt', 15: 'taskData' },
|
||||
productions_: [0, [3, 3], [5, 0], [5, 2], [7, 2], [7, 1], [7, 1], [7, 1], [9, 1], [9, 1], [9, 1], [9, 2]],
|
||||
performAction: function anonymous (yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
|
||||
/* this == yyval */
|
||||
/* this == yyval */
|
||||
|
||||
var $0 = $$.length - 1
|
||||
switch (yystate) {
|
||||
@@ -110,7 +111,7 @@ var parser = (function () {
|
||||
break
|
||||
}
|
||||
},
|
||||
table: [{3: 1, 4: [1, 2]}, {1: [3]}, o($V0, [2, 2], {5: 3}), {6: [1, 4], 7: 5, 8: [1, 6], 9: 7, 10: [1, 8], 11: $V1, 12: $V2, 13: $V3, 14: $V4}, o($V0, [2, 7], {1: [2, 1]}), o($V0, [2, 3]), {9: 13, 11: $V1, 12: $V2, 13: $V3, 14: $V4}, o($V0, [2, 5]), o($V0, [2, 6]), o($V0, [2, 8]), o($V0, [2, 9]), o($V0, [2, 10]), {15: [1, 14]}, o($V0, [2, 4]), o($V0, [2, 11])],
|
||||
table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, o($V0, [2, 2], { 5: 3 }), { 6: [1, 4], 7: 5, 8: [1, 6], 9: 7, 10: [1, 8], 11: $V1, 12: $V2, 13: $V3, 14: $V4 }, o($V0, [2, 7], { 1: [2, 1] }), o($V0, [2, 3]), { 9: 13, 11: $V1, 12: $V2, 13: $V3, 14: $V4 }, o($V0, [2, 5]), o($V0, [2, 6]), o($V0, [2, 8]), o($V0, [2, 9]), o($V0, [2, 10]), { 15: [1, 14] }, o($V0, [2, 4]), o($V0, [2, 11])],
|
||||
defaultActions: {},
|
||||
parseError: function parseError (str, hash) {
|
||||
if (hash.recoverable) {
|
||||
@@ -261,8 +262,9 @@ var parser = (function () {
|
||||
}
|
||||
}
|
||||
return true
|
||||
}}
|
||||
/* generated by jison-lex 0.3.4 */
|
||||
}
|
||||
}
|
||||
/* generated by jison-lex 0.3.4 */
|
||||
var lexer = (function () {
|
||||
var lexer = ({
|
||||
|
||||
@@ -276,7 +278,7 @@ var parser = (function () {
|
||||
}
|
||||
},
|
||||
|
||||
// resets the lexer, sets new input
|
||||
// resets the lexer, sets new input
|
||||
setInput: function (input, yy) {
|
||||
this.yy = yy || this.yy || {}
|
||||
this._input = input
|
||||
@@ -297,7 +299,7 @@ var parser = (function () {
|
||||
return this
|
||||
},
|
||||
|
||||
// consumes and returns one char from the input
|
||||
// consumes and returns one char from the input
|
||||
input: function () {
|
||||
var ch = this._input[0]
|
||||
this.yytext += ch
|
||||
@@ -320,7 +322,7 @@ var parser = (function () {
|
||||
return ch
|
||||
},
|
||||
|
||||
// unshifts one char (or a string) into the input
|
||||
// unshifts one char (or a string) into the input
|
||||
unput: function (ch) {
|
||||
var len = ch.length
|
||||
var lines = ch.split(/(?:\r\n?|\n)/g)
|
||||
@@ -355,13 +357,13 @@ var parser = (function () {
|
||||
return this
|
||||
},
|
||||
|
||||
// When called from action, caches matched text and appends it on next action
|
||||
// When called from action, caches matched text and appends it on next action
|
||||
more: function () {
|
||||
this._more = true
|
||||
return this
|
||||
},
|
||||
|
||||
// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
|
||||
// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
|
||||
reject: function () {
|
||||
if (this.options.backtrack_lexer) {
|
||||
this._backtrack = true
|
||||
@@ -375,18 +377,18 @@ var parser = (function () {
|
||||
return this
|
||||
},
|
||||
|
||||
// retain first n characters of the match
|
||||
// retain first n characters of the match
|
||||
less: function (n) {
|
||||
this.unput(this.match.slice(n))
|
||||
},
|
||||
|
||||
// displays already matched input, i.e. for error messages
|
||||
// displays already matched input, i.e. for error messages
|
||||
pastInput: function () {
|
||||
var past = this.matched.substr(0, this.matched.length - this.match.length)
|
||||
return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, '')
|
||||
},
|
||||
|
||||
// displays upcoming input, i.e. for error messages
|
||||
// displays upcoming input, i.e. for error messages
|
||||
upcomingInput: function () {
|
||||
var next = this.match
|
||||
if (next.length < 20) {
|
||||
@@ -395,14 +397,14 @@ var parser = (function () {
|
||||
return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, '')
|
||||
},
|
||||
|
||||
// displays the character position where the lexing error occurred, i.e. for error messages
|
||||
// displays the character position where the lexing error occurred, i.e. for error messages
|
||||
showPosition: function () {
|
||||
var pre = this.pastInput()
|
||||
var c = new Array(pre.length + 1).join('-')
|
||||
return pre + this.upcomingInput() + '\n' + c + '^'
|
||||
},
|
||||
|
||||
// test the lexed token: return FALSE when not a match, otherwise return token
|
||||
// test the lexed token: return FALSE when not a match, otherwise return token
|
||||
test_match: function (match, indexed_rule) {
|
||||
var token,
|
||||
lines,
|
||||
@@ -474,7 +476,7 @@ var parser = (function () {
|
||||
return false
|
||||
},
|
||||
|
||||
// return next match in input
|
||||
// return next match in input
|
||||
next: function () {
|
||||
if (this.done) {
|
||||
return this.EOF
|
||||
@@ -532,7 +534,7 @@ var parser = (function () {
|
||||
}
|
||||
},
|
||||
|
||||
// return next match that has a token
|
||||
// return next match that has a token
|
||||
lex: function lex () {
|
||||
var r = this.next()
|
||||
if (r) {
|
||||
@@ -542,12 +544,12 @@ var parser = (function () {
|
||||
}
|
||||
},
|
||||
|
||||
// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
|
||||
// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
|
||||
begin: function begin (condition) {
|
||||
this.conditionStack.push(condition)
|
||||
},
|
||||
|
||||
// pop the previously active lexer condition state off the condition stack
|
||||
// pop the previously active lexer condition state off the condition stack
|
||||
popState: function popState () {
|
||||
var n = this.conditionStack.length - 1
|
||||
if (n > 0) {
|
||||
@@ -557,7 +559,7 @@ var parser = (function () {
|
||||
}
|
||||
},
|
||||
|
||||
// produce the lexer rule set which is active for the currently active lexer condition state
|
||||
// produce the lexer rule set which is active for the currently active lexer condition state
|
||||
_currentRules: function _currentRules () {
|
||||
if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
|
||||
return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules
|
||||
@@ -566,7 +568,7 @@ var parser = (function () {
|
||||
}
|
||||
},
|
||||
|
||||
// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
|
||||
// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
|
||||
topState: function topState (n) {
|
||||
n = this.conditionStack.length - 1 - Math.abs(n || 0)
|
||||
if (n >= 0) {
|
||||
@@ -576,22 +578,22 @@ var parser = (function () {
|
||||
}
|
||||
},
|
||||
|
||||
// alias for begin(condition)
|
||||
// alias for begin(condition)
|
||||
pushState: function pushState (condition) {
|
||||
this.begin(condition)
|
||||
},
|
||||
|
||||
// return the number of states currently on the stack
|
||||
// return the number of states currently on the stack
|
||||
stateStackSize: function stateStackSize () {
|
||||
return this.conditionStack.length
|
||||
},
|
||||
options: {'case-insensitive': true},
|
||||
options: { 'case-insensitive': true },
|
||||
performAction: function anonymous (yy, yy_, $avoiding_name_collisions, YY_START) {
|
||||
// Pre-lexer code can go here
|
||||
|
||||
var YYSTATE = YY_START
|
||||
switch ($avoiding_name_collisions) {
|
||||
case 0:return 10
|
||||
case 0: return 10
|
||||
break
|
||||
case 1:/* skip whitespace */
|
||||
break
|
||||
@@ -599,30 +601,30 @@ var parser = (function () {
|
||||
break
|
||||
case 3:/* skip comments */
|
||||
break
|
||||
case 4:return 4
|
||||
case 4: return 4
|
||||
break
|
||||
case 5:return 11
|
||||
case 5: return 11
|
||||
break
|
||||
case 6:return 'date'
|
||||
case 6: return 'date'
|
||||
break
|
||||
case 7:return 12
|
||||
case 7: return 12
|
||||
break
|
||||
case 8:return 13
|
||||
case 8: return 13
|
||||
break
|
||||
case 9:return 14
|
||||
case 9: return 14
|
||||
break
|
||||
case 10:return 15
|
||||
case 10: return 15
|
||||
break
|
||||
case 11:return ':'
|
||||
case 11: return ':'
|
||||
break
|
||||
case 12:return 6
|
||||
case 12: return 6
|
||||
break
|
||||
case 13:return 'INVALID'
|
||||
case 13: return 'INVALID'
|
||||
break
|
||||
}
|
||||
},
|
||||
rules: [/^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:#[^\n]*)/i, /^(?:%[^\n]*)/i, /^(?:gantt\b)/i, /^(?:dateFormat\s[^#\n;]+)/i, /^(?:\d\d\d\d-\d\d-\d\d\b)/i, /^(?:title\s[^#\n;]+)/i, /^(?:section\s[^#:\n;]+)/i, /^(?:[^#:\n;]+)/i, /^(?::[^#\n;]+)/i, /^(?::)/i, /^(?:$)/i, /^(?:.)/i],
|
||||
conditions: {'INITIAL': {'rules': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13], 'inclusive': true}}
|
||||
conditions: { 'INITIAL': { 'rules': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13], 'inclusive': true } }
|
||||
})
|
||||
return lexer
|
||||
})()
|
||||
|
Reference in New Issue
Block a user