@k-l-lambda/lilylet 0.1.48 → 0.1.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/lib/abc/abc.d.ts +102 -0
  2. package/lib/abc/abc.js +25 -0
  3. package/lib/abc/grammar.jison.js +1203 -0
  4. package/lib/abc/parser.d.ts +3 -0
  5. package/lib/abc/parser.js +6 -0
  6. package/lib/abcDecoder.d.ts +1 -0
  7. package/lib/abcDecoder.js +1 -0
  8. package/lib/grammar.jison.js +1 -1303
  9. package/lib/index.d.ts +1 -8
  10. package/lib/index.js +1 -10
  11. package/lib/lilylet/abcDecoder.d.ts +25 -0
  12. package/lib/lilylet/abcDecoder.js +1007 -0
  13. package/lib/lilylet/grammar.jison.js +1308 -0
  14. package/lib/lilylet/index.d.ts +10 -0
  15. package/lib/lilylet/index.js +10 -0
  16. package/lib/lilylet/lilypondDecoder.d.ts +29 -0
  17. package/lib/lilylet/lilypondDecoder.js +1053 -0
  18. package/lib/lilylet/lilypondEncoder.d.ts +34 -0
  19. package/lib/lilylet/lilypondEncoder.js +759 -0
  20. package/lib/lilylet/meiEncoder.d.ts +8 -0
  21. package/lib/lilylet/meiEncoder.js +1808 -0
  22. package/lib/lilylet/musicXmlDecoder.d.ts +20 -0
  23. package/lib/lilylet/musicXmlDecoder.js +1195 -0
  24. package/lib/lilylet/musicXmlEncoder.d.ts +15 -0
  25. package/lib/lilylet/musicXmlEncoder.js +701 -0
  26. package/lib/lilylet/musicXmlTypes.d.ts +199 -0
  27. package/lib/lilylet/musicXmlTypes.js +7 -0
  28. package/lib/lilylet/musicXmlUtils.d.ts +92 -0
  29. package/lib/lilylet/musicXmlUtils.js +469 -0
  30. package/lib/lilylet/parser.d.ts +3 -0
  31. package/lib/lilylet/parser.js +151 -0
  32. package/lib/lilylet/serializer.d.ts +11 -0
  33. package/lib/lilylet/serializer.js +653 -0
  34. package/lib/lilylet/types.d.ts +245 -0
  35. package/lib/lilylet/types.js +99 -0
  36. package/lib/lilypondDecoder.d.ts +1 -29
  37. package/lib/lilypondDecoder.js +1 -1006
  38. package/lib/lilypondEncoder.d.ts +1 -34
  39. package/lib/lilypondEncoder.js +1 -759
  40. package/lib/meiEncoder.d.ts +1 -8
  41. package/lib/meiEncoder.js +1 -1545
  42. package/lib/musicXmlDecoder.d.ts +1 -20
  43. package/lib/musicXmlDecoder.js +1 -1151
  44. package/lib/musicXmlEncoder.d.ts +1 -15
  45. package/lib/musicXmlEncoder.js +1 -666
  46. package/lib/musicXmlTypes.d.ts +1 -199
  47. package/lib/musicXmlTypes.js +1 -7
  48. package/lib/musicXmlUtils.d.ts +1 -81
  49. package/lib/musicXmlUtils.js +1 -435
  50. package/lib/parser.d.ts +1 -3
  51. package/lib/parser.js +1 -151
  52. package/lib/serializer.d.ts +1 -11
  53. package/lib/serializer.js +1 -650
  54. package/lib/types.d.ts +1 -244
  55. package/lib/types.js +1 -99
  56. package/package.json +2 -1
  57. package/source/abc/abc.jison +692 -0
  58. package/source/abc/abc.ts +176 -0
  59. package/source/abc/grammar.jison.js +1203 -0
  60. package/source/abc/parser.ts +12 -0
  61. package/source/lilylet/abcDecoder.ts +1121 -0
  62. package/source/lilylet/grammar.jison.js +170 -165
  63. package/source/lilylet/index.ts +4 -3
  64. package/source/lilylet/lilylet.jison +2 -0
  65. package/source/lilylet/lilypondDecoder.ts +92 -42
  66. package/source/lilylet/meiEncoder.ts +280 -0
  67. package/source/lilylet/musicXmlDecoder.ts +74 -27
  68. package/source/lilylet/musicXmlEncoder.ts +201 -146
  69. package/source/lilylet/musicXmlUtils.ts +46 -4
  70. package/source/lilylet/serializer.ts +3 -0
  71. package/source/lilylet/types.ts +1 -0
@@ -1,1303 +1 @@
1
- /* parser generated by jison 0.4.18 */
2
- /*
3
- Returns a Parser object of the following structure:
4
-
5
- Parser: {
6
- yy: {}
7
- }
8
-
9
- Parser.prototype: {
10
- yy: {},
11
- trace: function(),
12
- symbols_: {associative list: name ==> number},
13
- terminals_: {associative list: number ==> name},
14
- productions_: [...],
15
- performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
16
- table: [...],
17
- defaultActions: {...},
18
- parseError: function(str, hash),
19
- parse: function(input),
20
-
21
- lexer: {
22
- EOF: 1,
23
- parseError: function(str, hash),
24
- setInput: function(input),
25
- input: function(),
26
- unput: function(str),
27
- more: function(),
28
- less: function(n),
29
- pastInput: function(),
30
- upcomingInput: function(),
31
- showPosition: function(),
32
- test_match: function(regex_match_array, rule_index),
33
- next: function(),
34
- lex: function(),
35
- begin: function(condition),
36
- popState: function(),
37
- _currentRules: function(),
38
- topState: function(),
39
- pushState: function(condition),
40
-
41
- options: {
42
- ranges: boolean (optional: true ==> token location info will include a .range[] member)
43
- flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
44
- backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)
45
- },
46
-
47
- performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
48
- rules: [...],
49
- conditions: {associative list: name ==> set},
50
- }
51
- }
52
-
53
-
54
- token location info (@$, _$, etc.): {
55
- first_line: n,
56
- last_line: n,
57
- first_column: n,
58
- last_column: n,
59
- range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
60
- }
61
-
62
-
63
- the parseError function receives a 'hash' object with these members for lexer and parser errors: {
64
- text: (matched text)
65
- token: (the produced terminal token, if any)
66
- line: (yylineno)
67
- }
68
- while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
69
- loc: (yylloc)
70
- expected: (string describing the set of expected tokens)
71
- recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
72
- }
73
- */
74
- Object.defineProperty(globalThis, "__lilyletGrammar__", { value: (function(){
75
- var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[5,22,25,28,40,41,42,47,50,57,58,68,69,74,76,77,78,80,81,84,85,86,87,90,91],$V1=[2,29],$V2=[1,9],$V3=[1,10],$V4=[1,11],$V5=[1,12],$V6=[1,13],$V7=[1,14],$V8=[1,15],$V9=[1,16],$Va=[1,26],$Vb=[1,27],$Vc=[5,9,11,14,15,16,17,18,19,20,22,25,28,40,41,42,47,50,57,58,68,69,74,76,77,78,80,81,84,85,86,87,90,91],$Vd=[5,9,22,25,28,40,41,42,47,50,57,58,68,69,74,76,77,78,80,81,84,85,86,87,90,91],$Ve=[5,22],$Vf=[5,22,25],$Vg=[1,37],$Vh=[5,22,25,28],$Vi=[1,65],$Vj=[1,66],$Vk=[1,67],$Vl=[1,68],$Vm=[1,69],$Vn=[1,70],$Vo=[1,51],$Vp=[1,52],$Vq=[1,71],$Vr=[1,72],$Vs=[1,73],$Vt=[1,80],$Vu=[1,81],$Vv=[1,74],$Vw=[1,75],$Vx=[1,76],$Vy=[1,77],$Vz=[1,78],$VA=[1,79],$VB=[1,62],$VC=[1,63],$VD=[1,64],$VE=[2,22],$VF=[5,9,22,25,28,40,41,42,47,50,57,58,68,69,74,76,77,78,80,81,84,85,86,87,89,90,91],$VG=[5,9,13,22,25,28,40,41,42,47,49,50,56,57,58,68,69,74,76,77,78,80,81,83,84,85,86,87,89,90,91,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],$VH=[2,99],$VI=[1,97],$VJ=[5,9,13,22,25,28,40,41,42,47,49,50,54,56,57,58,68,69,74,76,77,78,80,81,83,84,85,86,87,89,90,91,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],$VK=[5,9,22,25,28,40,41,47,50,57,58,68,69,74,76,77,78,80,81,84,85,86,87,89,90,91],$VL=[1,182],$VM=[1,188],$VN=[1,150],$VO=[1,185],$VP=[1,151],$VQ=[1,149],$VR=[1,184],$VS=[1,143],$VT=[1,144],$VU=[1,145],$VV=[1,146],$VW=[1,147],$VX=[1,148],$VY=[1,154],$VZ=[1,153],$V_=[1,152],$V$=[1,155],$V01=[1,156],$V11=[1,157],$V21=[1,158],$V31=[1,159],$V41=[1,160],$V51=[1,161],$V61=[1,162],$V71=[1,163],$V81=[1,164],$V91=[1,165],$Va1=[1,166],$Vb1=[1,167],$Vc1=[1,168],$Vd1=[1,169],$Ve1=[1,170],$Vf1=[1,171],$Vg1=[1,172],$Vh1=[1,173],$Vi1=[1,174],$Vj1=[1,175],$Vk1=[1,176],$Vl1=[1,177],$Vm1=[1,178],$Vn1=[1,179],$Vo1=[1,180],$Vp1=[1,181],$Vq1=[1,183],$Vr1=[1,186],$Vs1=[1,187],$Vt1=[5,9,13,22,25,28,40,41,42,47,49,50,54,56,57,58,68,69,74,76,77,78,79,80,81,83,84,85,86,87,89,90,91,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],$Vu1=[9,40,41,42,47,50,57,58,68,69,74,76,77,78,80,81,84,85,86,87,89,90,91],$Vv1=[49,50],$Vw1=[5,9,13,22,25,28,40,41,42,47,49,50,52,53,54,56,57,58,68,69,74,76,77,78,80,81,83,84,85,86,87,89,90,91,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148];
76
- var parser = {trace: function trace () { },
77
- yy: {},
78
- symbols_: {"error":2,"document":3,"content":4,"EOF":5,"headers":6,"measures":7,"newlines":8,"NEWLINE":9,"header":10,"HEADER_TITLE":11,"STRING":12,"]":13,"HEADER_SUBTITLE":14,"HEADER_COMPOSER":15,"HEADER_ARRANGER":16,"HEADER_LYRICIST":17,"HEADER_OPUS":18,"HEADER_INSTRUMENT":19,"HEADER_GENRE":20,"measure_content":21,"|":22,"parts":23,"part_voices":24,"PART_SEP":25,"part_start":26,"voice_events":27,"VOICE_SEP":28,"event":29,"note_event":30,"rest_event":31,"context_event":32,"grace_event":33,"tuplet_event":34,"tremolo_event":35,"pitch_reset_event":36,"barline_event":37,"harmony_event":38,"markup_event":39,"CMD_BAR":40,"CMD_CHORDS":41,"CMD_MARKUP":42,"chord":43,"duration":44,"post_events":45,"pitch":46,"<":47,"pitches":48,">":49,"PITCH":50,"octave":51,"OCT_UP":52,"OCT_DOWN":53,"NUMBER":54,"dots":55,".":56,"REST_CHAR":57,"SPACE_CHAR":58,"clef_cmd":59,"key_cmd":60,"time_cmd":61,"tempo_cmd":62,"staff_cmd":63,"ottava_cmd":64,"stem_cmd":65,"numeric_time_sig_cmd":66,"default_time_sig_cmd":67,"CMD_CLEF":68,"CMD_KEY":69,"pitch_name":70,"mode":71,"MODE_MAJOR":72,"MODE_MINOR":73,"CMD_TIME":74,"/":75,"CMD_NUMERIC_TIME_SIG":76,"CMD_DEFAULT_TIME_SIG":77,"CMD_TEMPO":78,"=":79,"CMD_STAFF":80,"CMD_OTTAVA":81,"#":82,"-":83,"CMD_STEMUP":84,"CMD_STEMDOWN":85,"CMD_STEMNEUTRAL":86,"CMD_GRACE":87,"{":88,"}":89,"CMD_TIMES":90,"CMD_REPEAT":91,"TREMOLO":92,"post_event":93,"articulation_mark":94,"ornament_mark":95,"dynamic_mark":96,"hairpin_mark":97,"pedal_mark":98,"tie_mark":99,"slur_mark":100,"beam_mark":101,"tremolo_mark":102,"direction_mark":103,"rest_mark":104,"fingering_mark":105,"fingering_number":106,"navigation_mark":107,"markup_mark":108,"CMD_REST":109,"ART_STACCATO":110,"ART_STACCATISSIMO":111,"ART_TENUTO":112,"ART_MARCATO":113,"ART_ACCENT":114,"ART_PORTATO":115,"_":116,"^":117,"!":118,"ORN_TRILL":119,"ORN_TURN":120,"ORN_MORDENT":121,"ORN_PRALL":122,"ORN_FERMATA":123,"ORN_SHORTFERMATA":124,"ORN_ARPEGGIO":125,"DYN_PPP":126,"DYN_PP":127,"DYN_P":128,"DYN_MP":129,"DYN_MF":130,"DYN_F":131,"DYN_FF":132,"DYN_FFF":133,"DYN_SFZ":134,"DYN_RFZ":135,"DYN_SF":136,"CMD_CRESC_BEGIN":137,"CMD_DIM_BEGIN":138,"CMD_DYNAMICS_END":139,"CMD_SUSTAINON":140,"CMD_SUSTAINOFF":141,"~":142,"(":143,")":144,"[":145,":":146,"CMD_CODA":147,"CMD_SEGNO":148,"$accept":0,"$end":1},
79
- terminals_: {2:"error",5:"EOF",9:"NEWLINE",11:"HEADER_TITLE",12:"STRING",13:"]",14:"HEADER_SUBTITLE",15:"HEADER_COMPOSER",16:"HEADER_ARRANGER",17:"HEADER_LYRICIST",18:"HEADER_OPUS",19:"HEADER_INSTRUMENT",20:"HEADER_GENRE",22:"|",25:"PART_SEP",28:"VOICE_SEP",40:"CMD_BAR",41:"CMD_CHORDS",42:"CMD_MARKUP",47:"<",49:">",50:"PITCH",52:"OCT_UP",53:"OCT_DOWN",54:"NUMBER",56:".",57:"REST_CHAR",58:"SPACE_CHAR",68:"CMD_CLEF",69:"CMD_KEY",72:"MODE_MAJOR",73:"MODE_MINOR",74:"CMD_TIME",75:"/",76:"CMD_NUMERIC_TIME_SIG",77:"CMD_DEFAULT_TIME_SIG",78:"CMD_TEMPO",79:"=",80:"CMD_STAFF",81:"CMD_OTTAVA",82:"#",83:"-",84:"CMD_STEMUP",85:"CMD_STEMDOWN",86:"CMD_STEMNEUTRAL",87:"CMD_GRACE",88:"{",89:"}",90:"CMD_TIMES",91:"CMD_REPEAT",92:"TREMOLO",109:"CMD_REST",110:"ART_STACCATO",111:"ART_STACCATISSIMO",112:"ART_TENUTO",113:"ART_MARCATO",114:"ART_ACCENT",115:"ART_PORTATO",116:"_",117:"^",118:"!",119:"ORN_TRILL",120:"ORN_TURN",121:"ORN_MORDENT",122:"ORN_PRALL",123:"ORN_FERMATA",124:"ORN_SHORTFERMATA",125:"ORN_ARPEGGIO",126:"DYN_PPP",127:"DYN_PP",128:"DYN_P",129:"DYN_MP",130:"DYN_MF",131:"DYN_F",132:"DYN_FF",133:"DYN_FFF",134:"DYN_SFZ",135:"DYN_RFZ",136:"DYN_SF",137:"CMD_CRESC_BEGIN",138:"CMD_DIM_BEGIN",139:"CMD_DYNAMICS_END",140:"CMD_SUSTAINON",141:"CMD_SUSTAINOFF",142:"~",143:"(",144:")",145:"[",146:":",147:"CMD_CODA",148:"CMD_SEGNO"},
80
- productions_: [0,[3,2],[4,2],[4,3],[4,2],[4,1],[8,1],[8,2],[6,1],[6,2],[6,2],[6,3],[10,3],[10,3],[10,3],[10,3],[10,3],[10,3],[10,3],[10,3],[7,1],[7,3],[7,2],[21,1],[23,1],[23,4],[26,0],[24,1],[24,3],[27,0],[27,2],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[37,2],[38,2],[39,2],[36,1],[30,3],[30,3],[30,2],[30,2],[43,3],[48,1],[48,2],[46,2],[46,1],[51,1],[51,1],[51,2],[51,2],[44,2],[55,0],[55,2],[31,3],[31,3],[31,2],[31,2],[32,1],[32,1],[32,1],[32,1],[32,1],[32,1],[32,1],[32,1],[32,1],[59,2],[60,3],[70,1],[71,1],[71,1],[61,4],[66,1],[67,1],[62,5],[62,2],[62,4],[63,2],[64,3],[64,4],[64,1],[65,1],[65,1],[65,1],[33,4],[33,2],[33,2],[34,7],[35,9],[35,8],[35,7],[45,0],[45,2],[93,1],[93,1],[93,1],[93,1],[93,1],[93,1],[93,1],[93,1],[93,1],[93,1],[93,1],[93,1],[93,1],[93,1],[93,1],[104,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,2],[94,2],[94,2],[94,2],[94,2],[94,2],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[95,1],[95,1],[95,1],[95,1],[95,1],[95,1],[95,1],[96,1],[96,1],[96,1],[96,1],[96,1],[96,1],[96,1],[96,1],[96,1],[96,1],[96,1],[97,1],[97,1],[97,1],[98,1],[98,1],[99,1],[100,1],[100,1],[101,1],[101,1],[102,2],[103,2],[103,2],[105,2],[106,1],[107,1],[107,1],[108,2]],
81
- performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
82
- /* this == yyval */
83
-
84
- var $0 = $$.length - 1;
85
- switch (yystate) {
86
- case 1:
87
- return { metadata: $$[$0-1].metadata, measures: $$[$0-1].measures };
88
- break;
89
- case 2:
90
- this.$ = ({ metadata: $$[$0-1], measures: $$[$0] });
91
- break;
92
- case 3:
93
- this.$ = ({ metadata: $$[$0-2], measures: $$[$0] });
94
- break;
95
- case 4: case 5:
96
- this.$ = ({ metadata: undefined, measures: $$[$0] });
97
- break;
98
- case 8:
99
- this.$ = $$[$0];
100
- break;
101
- case 9:
102
- this.$ = ({ ...$$[$0-1], ...$$[$0] });
103
- break;
104
- case 10: case 49:
105
- this.$ = $$[$0-1];
106
- break;
107
- case 11:
108
- this.$ = ({ ...$$[$0-2], ...$$[$0] });
109
- break;
110
- case 12:
111
- this.$ = ({ title: $$[$0-1].slice(1, -1) });
112
- break;
113
- case 13:
114
- this.$ = ({ subtitle: $$[$0-1].slice(1, -1) });
115
- break;
116
- case 14:
117
- this.$ = ({ composer: $$[$0-1].slice(1, -1) });
118
- break;
119
- case 15:
120
- this.$ = ({ arranger: $$[$0-1].slice(1, -1) });
121
- break;
122
- case 16:
123
- this.$ = ({ lyricist: $$[$0-1].slice(1, -1) });
124
- break;
125
- case 17:
126
- this.$ = ({ opus: $$[$0-1].slice(1, -1) });
127
- break;
128
- case 18:
129
- this.$ = ({ instrument: $$[$0-1].slice(1, -1) });
130
- break;
131
- case 19:
132
- this.$ = ({ genre: $$[$0-1].slice(1, -1) });
133
- break;
134
- case 20: case 50:
135
- this.$ = [$$[$0]];
136
- break;
137
- case 21:
138
- this.$ = $$[$0-2].concat([$$[$0]]);
139
- break;
140
- case 22:
141
- this.$ = $$[$0-1];
142
- break;
143
- case 23:
144
- this.$ = measure($$[$0], currentKey, currentTimeSig);
145
- break;
146
- case 24:
147
- this.$ = [part($$[$0])];
148
- break;
149
- case 25:
150
- this.$ = $$[$0-3].concat([part($$[$0])]);
151
- break;
152
- case 26:
153
- currentStaff = 1; currentOttava = 0;
154
- break;
155
- case 27:
156
- this.$ = [voice(currentStaff, $$[$0])];
157
- break;
158
- case 28:
159
- this.$ = $$[$0-2].concat([voice(currentStaff, $$[$0])]);
160
- break;
161
- case 29: case 99:
162
- this.$ = [];
163
- break;
164
- case 30:
165
- this.$ = $$[$0] === null ? $$[$0-1] : $$[$0-1].concat(Array.isArray($$[$0]) ? $$[$0] : [$$[$0]]);
166
- break;
167
- case 41:
168
- this.$ = barlineEvent($$[$0].slice(1, -1));
169
- break;
170
- case 42:
171
- this.$ = harmonyEvent($$[$0].slice(1, -1));
172
- break;
173
- case 43:
174
- this.$ = markupEvent($$[$0].slice(1, -1));
175
- break;
176
- case 44:
177
-
178
- // On newline, reset ottava to 0 if it's non-zero (like pitch base resets)
179
- if (currentOttava !== 0) {
180
- const ottavaReset = contextChange({ ottava: 0 });
181
- currentOttava = 0;
182
- this.$ = [ottavaReset, { type: 'pitchReset' }];
183
- } else {
184
- this.$ = { type: 'pitchReset' };
185
- }
186
-
187
- break;
188
- case 45: case 46:
189
- currentDuration = $$[$0-1]; this.$ = noteEvent($$[$0-2], $$[$0-1], $$[$0]);
190
- break;
191
- case 47: case 48:
192
- this.$ = noteEvent($$[$0-1], currentDuration, $$[$0]);
193
- break;
194
- case 51: case 100:
195
- this.$ = $$[$0-1].concat([$$[$0]]);
196
- break;
197
- case 52:
198
- this.$ = parsePitch($$[$0-1], $$[$0]);
199
- break;
200
- case 53:
201
- this.$ = parsePitch($$[$0], 0);
202
- break;
203
- case 54:
204
- this.$ = 1;
205
- break;
206
- case 55:
207
- this.$ = -1;
208
- break;
209
- case 56:
210
- this.$ = $$[$0-1] + 1;
211
- break;
212
- case 57:
213
- this.$ = $$[$0-1] - 1;
214
- break;
215
- case 58:
216
- this.$ = duration(Number($$[$0-1]), $$[$0]);
217
- break;
218
- case 59:
219
- this.$ = 0;
220
- break;
221
- case 60:
222
- this.$ = $$[$0-1] + 1;
223
- break;
224
- case 61:
225
- currentDuration = $$[$0-1]; this.$ = restEvent($$[$0-1], { fullMeasure: $$[$0-2] === 'R' });
226
- break;
227
- case 62:
228
- currentDuration = $$[$0-1]; this.$ = restEvent($$[$0-1], { invisible: true });
229
- break;
230
- case 63:
231
- this.$ = restEvent(currentDuration, { fullMeasure: $$[$0-1] === 'R' });
232
- break;
233
- case 64:
234
- this.$ = restEvent(currentDuration, { invisible: true });
235
- break;
236
- case 65:
237
- this.$ = contextChange({ clef: $$[$0] });
238
- break;
239
- case 66:
240
- this.$ = contextChange({ key: $$[$0] });
241
- break;
242
- case 67:
243
- this.$ = contextChange({ time: $$[$0] });
244
- break;
245
- case 68:
246
- this.$ = contextChange({ tempo: $$[$0] });
247
- break;
248
- case 69:
249
- this.$ = contextChange({ staff: $$[$0] });
250
- break;
251
- case 70:
252
- this.$ = contextChange({ ottava: $$[$0] });
253
- break;
254
- case 71:
255
- this.$ = contextChange({ stemDirection: $$[$0] });
256
- break;
257
- case 72: case 73:
258
- this.$ = null;
259
- break;
260
- case 74:
261
- this.$ = $$[$0].slice(1, -1);
262
- break;
263
- case 75:
264
- currentKey = keySignature($$[$0-1].phonet, $$[$0-1].accidental, $$[$0]); this.$ = currentKey;
265
- break;
266
- case 76:
267
- this.$ = parsePitchName($$[$0]);
268
- break;
269
- case 77:
270
- this.$ = 'major';
271
- break;
272
- case 78:
273
- this.$ = 'minor';
274
- break;
275
- case 79:
276
-
277
- const num = Number($$[$0-2]);
278
- const den = Number($$[$0]);
279
- const timeSig = fraction(num, den);
280
- // Add symbol for 4/4 (common) and 2/2 (cut) unless numericTimeSignature is set
281
- if (!numericTimeSignature) {
282
- if (num === 4 && den === 4) {
283
- timeSig.symbol = 'common';
284
- } else if (num === 2 && den === 2) {
285
- timeSig.symbol = 'cut';
286
- }
287
- }
288
- currentTimeSig = timeSig;
289
- this.$ = currentTimeSig;
290
-
291
- break;
292
- case 80:
293
- numericTimeSignature = true; this.$ = null;
294
- break;
295
- case 81:
296
- numericTimeSignature = false; this.$ = null;
297
- break;
298
- case 82:
299
- this.$ = ({ text: $$[$0-3].slice(1, -1), beat: $$[$0-2], bpm: Number($$[$0]) });
300
- break;
301
- case 83:
302
- this.$ = ({ text: $$[$0].slice(1, -1) });
303
- break;
304
- case 84:
305
- this.$ = ({ beat: $$[$0-2], bpm: Number($$[$0]) });
306
- break;
307
- case 85:
308
- currentStaff = Number($$[$0].slice(1, -1)); this.$ = currentStaff;
309
- break;
310
- case 86:
311
- currentOttava = Number($$[$0]); this.$ = currentOttava;
312
- break;
313
- case 87:
314
- currentOttava = -Number($$[$0]); this.$ = currentOttava;
315
- break;
316
- case 88:
317
- currentOttava = 0; this.$ = 0;
318
- break;
319
- case 89:
320
- this.$ = 'up';
321
- break;
322
- case 90:
323
- this.$ = 'down';
324
- break;
325
- case 91:
326
- this.$ = 'auto';
327
- break;
328
- case 92:
329
- this.$ = ($$[$0-1].filter(e => e.type === 'note' || e.type === 'rest').map(e => ({ ...e, grace: true })));
330
- break;
331
- case 93: case 94:
332
- this.$ = ({ ...$$[$0], grace: true });
333
- break;
334
- case 95:
335
- this.$ = tupletEvent(fraction(Number($$[$0-5]), Number($$[$0-3])), $$[$0-1].filter(e => e.type === 'note' || e.type === 'rest'));
336
- break;
337
- case 96:
338
- currentDuration = $$[$0-3]; this.$ = tremoloEvent([$$[$0-4]], [$$[$0-2]], Number($$[$0-6]), $$[$0-3].division);
339
- break;
340
- case 97:
341
- currentDuration = $$[$0-2]; this.$ = tremoloEvent([$$[$0-3]], [$$[$0-1]], Number($$[$0-5]), $$[$0-2].division);
342
- break;
343
- case 98:
344
- this.$ = tremoloEvent([$$[$0-2]], [$$[$0-1]], Number($$[$0-4]), currentDuration.division);
345
- break;
346
- case 116:
347
- this.$ = ({ pitchedRest: true });
348
- break;
349
- case 117: case 123: case 130:
350
- this.$ = articulation('staccato');
351
- break;
352
- case 118: case 127: case 132:
353
- this.$ = articulation('staccatissimo');
354
- break;
355
- case 119: case 128: case 131:
356
- this.$ = articulation('tenuto');
357
- break;
358
- case 120: case 125: case 133:
359
- this.$ = articulation('marcato');
360
- break;
361
- case 121: case 126: case 129:
362
- this.$ = articulation('accent');
363
- break;
364
- case 122: case 124: case 134:
365
- this.$ = articulation('portato');
366
- break;
367
- case 135:
368
- this.$ = ornament('trill');
369
- break;
370
- case 136:
371
- this.$ = ornament('turn');
372
- break;
373
- case 137:
374
- this.$ = ornament('mordent');
375
- break;
376
- case 138:
377
- this.$ = ornament('prall');
378
- break;
379
- case 139:
380
- this.$ = ornament('fermata');
381
- break;
382
- case 140:
383
- this.$ = ornament('shortFermata');
384
- break;
385
- case 141:
386
- this.$ = ornament('arpeggio');
387
- break;
388
- case 142:
389
- this.$ = dynamic('ppp');
390
- break;
391
- case 143:
392
- this.$ = dynamic('pp');
393
- break;
394
- case 144:
395
- this.$ = dynamic('p');
396
- break;
397
- case 145:
398
- this.$ = dynamic('mp');
399
- break;
400
- case 146:
401
- this.$ = dynamic('mf');
402
- break;
403
- case 147:
404
- this.$ = dynamic('f');
405
- break;
406
- case 148:
407
- this.$ = dynamic('ff');
408
- break;
409
- case 149:
410
- this.$ = dynamic('fff');
411
- break;
412
- case 150: case 152:
413
- this.$ = dynamic('sfz');
414
- break;
415
- case 151:
416
- this.$ = dynamic('rfz');
417
- break;
418
- case 153:
419
- this.$ = hairpin('crescendoStart');
420
- break;
421
- case 154:
422
- this.$ = hairpin('diminuendoStart');
423
- break;
424
- case 155:
425
- this.$ = hairpin('crescendoEnd');
426
- break;
427
- case 156:
428
- this.$ = pedal('sustainOn');
429
- break;
430
- case 157:
431
- this.$ = pedal('sustainOff');
432
- break;
433
- case 158:
434
- this.$ = tie(true);
435
- break;
436
- case 159:
437
- this.$ = slur(true);
438
- break;
439
- case 160:
440
- this.$ = slur(false);
441
- break;
442
- case 161:
443
- this.$ = beam(true);
444
- break;
445
- case 162:
446
- this.$ = beam(false);
447
- break;
448
- case 163:
449
- this.$ = ({ tremolo: Number($$[$0]) });
450
- break;
451
- case 164:
452
- this.$ = ({ ...$$[$0], placement: 'above' });
453
- break;
454
- case 165:
455
- this.$ = ({ ...$$[$0], placement: 'below' });
456
- break;
457
- case 166: case 167:
458
- const n = Number($$[$0]); if (n >= 1 && n <= 5) this.$ = fingering(n); else this.$ = null;
459
- break;
460
- case 168:
461
- this.$ = navigation('coda');
462
- break;
463
- case 169:
464
- this.$ = navigation('segno');
465
- break;
466
- case 170:
467
- this.$ = markupMark($$[$0].slice(1, -1));
468
- break;
469
- }
470
- },
471
- table: [o($V0,$V1,{3:1,4:2,6:3,8:4,7:5,10:6,21:8,23:17,24:18,27:19,9:[1,7],11:$V2,14:$V3,15:$V4,16:$V5,17:$V6,18:$V7,19:$V8,20:$V9}),{1:[3]},{5:[1,20]},o($V0,$V1,{21:8,23:17,24:18,27:19,7:21,8:22,10:23,9:[1,24],11:$V2,14:$V3,15:$V4,16:$V5,17:$V6,18:$V7,19:$V8,20:$V9}),o($V0,$V1,{21:8,23:17,24:18,27:19,7:25,9:$Va}),{5:[2,5],22:$Vb},o($Vc,[2,8]),o($Vd,[2,6]),o($Ve,[2,20]),{12:[1,28]},{12:[1,29]},{12:[1,30]},{12:[1,31]},{12:[1,32]},{12:[1,33]},{12:[1,34]},{12:[1,35]},o($Ve,[2,23],{25:[1,36]}),o($Vf,[2,24],{28:$Vg}),o($Vh,[2,27],{29:38,30:39,31:40,32:41,33:42,34:43,35:44,36:45,37:46,38:47,39:48,43:49,46:50,59:53,60:54,61:55,62:56,63:57,64:58,65:59,66:60,67:61,9:$Vi,40:$Vj,41:$Vk,42:$Vl,47:$Vm,50:$Vn,57:$Vo,58:$Vp,68:$Vq,69:$Vr,74:$Vs,76:$Vt,77:$Vu,78:$Vv,80:$Vw,81:$Vx,84:$Vy,85:$Vz,86:$VA,87:$VB,90:$VC,91:$VD}),{1:[2,1]},{5:[2,2],22:$Vb},o($V0,$V1,{21:8,23:17,24:18,27:19,7:82,9:$Va}),o($Vc,[2,9]),o($Vd,[2,10],{10:83,11:$V2,14:$V3,15:$V4,16:$V5,17:$V6,18:$V7,19:$V8,20:$V9}),{5:[2,4],22:$Vb},o($Vd,[2,7]),o([9,25,28,40,41,42,47,50,57,58,68,69,74,76,77,78,80,81,84,85,86,87,90,91],$V1,{23:17,24:18,27:19,21:84,5:$VE,22:$VE}),{13:[1,85]},{13:[1,86]},{13:[1,87]},{13:[1,88]},{13:[1,89]},{13:[1,90]},{13:[1,91]},{13:[1,92]},o($Vd,[2,26],{26:93}),o($Vd,$V1,{27:94}),o($VF,[2,30]),o($VF,[2,31]),o($VF,[2,32]),o($VF,[2,33]),o($VF,[2,34]),o($VF,[2,35]),o($VF,[2,36]),o($VF,[2,37]),o($VF,[2,38]),o($VF,[2,39]),o($VF,[2,40]),o($VG,$VH,{44:95,45:96,54:$VI}),o($VG,$VH,{44:98,45:99,54:$VI}),o($VG,$VH,{44:100,45:101,54:$VI}),o($VG,$VH,{44:102,45:103,54:$VI}),o($VF,[2,65]),o($VF,[2,66]),o($VF,[2,67]),o($VF,[2,68]),o($VF,[2,69]),o($VF,[2,70]),o($VF,[2,71]),o($VF,[2,72]),o($VF,[2,73]),{30:105,31:106,43:49,46:50,47:$Vm,50:$Vn,57:$Vo,58:$Vp,88:[1,104]},{54:[1,107]},{92:[1,108]},o($VF,[2,44]),{12:[1,109]},{12:[1,110]},{12:[1,111]},{46:113,48:112,50:$Vn},o($VJ,[2,53],{51:114,52:[1,115],53:[1,116]}),{12:[1,117]},{50:[1,119],70:118},{54:[1,120]},{12:[1,121],44:122,54:$VI},{12:[1,123]},o($VF,[2,88],{82:[1,124]}),o($VF,[2,89]),o($VF,[2,90]),o($VF,[2,91]),o($VF,[2,80]),o($VF,[2,81]),{5:[2,3],22:$Vb},o($Vc,[2,11]),o($Ve,[2,21]),o($Vc,[2,12]),o($Vc,[2,13]),o($Vc,[2,14]),o($Vc,[2,15]),o($Vc,[2,16]),o($Vc,[2,17]),o($Vc,[2,18]),o($Vc,[2,19]),o($Vd,$V1,{27:19,24:125}),o($Vh,[2,28],{29:38,30:39,31:40,32:41,33:42,34:43,35:44,36:45,37:46,38:47,39:48,43:49,46:50,59:53,60:54,61:55,62:56,63:57,64:58,65:59,66:60,67:61,9:$Vi,40:$Vj,41:$Vk,42:$Vl,47:$Vm,50:$Vn,57:$Vo,58:$Vp,68:$Vq,69:$Vr,74:$Vs,76:$Vt,77:$Vu,78:$Vv,80:$Vw,81:$Vx,84:$Vy,85:$Vz,86:$VA,87:$VB,90:$VC,91:$VD}),o($VJ,$VH,{45:126}),o($VK,[2,47],{93:127,94:128,95:129,96:130,97:131,98:132,99:133,100:134,101:135,102:136,103:137,104:138,105:139,106:140,107:141,108:142,13:$VL,42:$VM,49:$VN,54:$VO,56:$VP,83:$VQ,109:$VR,110:$VS,111:$VT,112:$VU,113:$VV,114:$VW,115:$VX,116:$VY,117:$VZ,118:$V_,119:$V$,120:$V01,121:$V11,122:$V21,123:$V31,124:$V41,125:$V51,126:$V61,127:$V71,128:$V81,129:$V91,130:$Va1,131:$Vb1,132:$Vc1,133:$Vd1,134:$Ve1,135:$Vf1,136:$Vg1,137:$Vh1,138:$Vi1,139:$Vj1,140:$Vk1,141:$Vl1,142:$Vm1,143:$Vn1,144:$Vo1,145:$Vp1,146:$Vq1,147:$Vr1,148:$Vs1}),o($Vt1,[2,59],{55:189}),o($VJ,$VH,{45:190}),o($VK,[2,48],{93:127,94:128,95:129,96:130,97:131,98:132,99:133,100:134,101:135,102:136,103:137,104:138,105:139,106:140,107:141,108:142,13:$VL,42:$VM,49:$VN,54:$VO,56:$VP,83:$VQ,109:$VR,110:$VS,111:$VT,112:$VU,113:$VV,114:$VW,115:$VX,116:$VY,117:$VZ,118:$V_,119:$V$,120:$V01,121:$V11,122:$V21,123:$V31,124:$V41,125:$V51,126:$V61,127:$V71,128:$V81,129:$V91,130:$Va1,131:$Vb1,132:$Vc1,133:$Vd1,134:$Ve1,135:$Vf1,136:$Vg1,137:$Vh1,138:$Vi1,139:$Vj1,140:$Vk1,141:$Vl1,142:$Vm1,143:$Vn1,144:$Vo1,145:$Vp1,146:$Vq1,147:$Vr1,148:$Vs1}),o($VJ,$VH,{45:191}),o($VK,[2,63],{93:127,94:128,95:129,96:130,97:131,98:132,99:133,100:134,101:135,102:136,103:137,104:138,105:139,106:140,107:141,108:142,13:$VL,42:$VM,49:$VN,54:$VO,56:$VP,83:$VQ,109:$VR,110:$VS,111:$VT,112:$VU,113:$VV,114:$VW,115:$VX,116:$VY,117:$VZ,118:$V_,119:$V$,120:$V01,121:$V11,122:$V21,123:$V31,124:$V41,125:$V51,126:$V61,127:$V71,128:$V81,129:$V91,130:$Va1,131:$Vb1,132:$Vc1,133:$Vd1,134:$Ve1,135:$Vf1,136:$Vg1,137:$Vh1,138:$Vi1,139:$Vj1,140:$Vk1,141:$Vl1,142:$Vm1,143:$Vn1,144:$Vo1,145:$Vp1,146:$Vq1,147:$Vr1,148:$Vs1}),o($VJ,$VH,{45:192}),o($VK,[2,64],{93:127,94:128,95:129,96:130,97:131,98:132,99:133,100:134,101:135,102:136,103:137,104:138,105:139,106:140,107:141,108:142,13:$VL,42:$VM,49:$VN,54:$VO,56:$VP,83:$VQ,109:$VR,110:$VS,111:$VT,112:$VU,113:$VV,114:$VW,115:$VX,116:$VY,117:$VZ,118:$V_,119:$V$,120:$V01,121:$V11,122:$V21,123:$V31,124:$V41,125:$V51,126:$V61,127:$V71,128:$V81,129:$V91,130:$Va1,131:$Vb1,132:$Vc1,133:$Vd1,134:$Ve1,135:$Vf1,136:$Vg1,137:$Vh1,138:$Vi1,139:$Vj1,140:$Vk1,141:$Vl1,142:$Vm1,143:$Vn1,144:$Vo1,145:$Vp1,146:$Vq1,147:$Vr1,148:$Vs1}),o($Vu1,$V1,{27:193}),o($VF,[2,93]),o($VF,[2,94]),{75:[1,194]},{54:[1,195]},o($VF,[2,41]),o($VF,[2,42]),o($VF,[2,43]),{46:197,49:[1,196],50:$Vn},o($Vv1,[2,50]),o($VJ,[2,52],{52:[1,198],53:[1,199]}),o($Vw1,[2,54]),o($Vw1,[2,55]),o($VF,[2,74]),{71:200,72:[1,201],73:[1,202]},o([72,73],[2,76]),{75:[1,203]},o($VF,[2,83],{44:204,54:$VI}),{79:[1,205]},o($VF,[2,85]),{54:[1,206],83:[1,207]},o($Vf,[2,25],{28:$Vg}),o($VK,[2,45],{93:127,94:128,95:129,96:130,97:131,98:132,99:133,100:134,101:135,102:136,103:137,104:138,105:139,106:140,107:141,108:142,13:$VL,42:$VM,49:$VN,54:$VO,56:$VP,83:$VQ,109:$VR,110:$VS,111:$VT,112:$VU,113:$VV,114:$VW,115:$VX,116:$VY,117:$VZ,118:$V_,119:$V$,120:$V01,121:$V11,122:$V21,123:$V31,124:$V41,125:$V51,126:$V61,127:$V71,128:$V81,129:$V91,130:$Va1,131:$Vb1,132:$Vc1,133:$Vd1,134:$Ve1,135:$Vf1,136:$Vg1,137:$Vh1,138:$Vi1,139:$Vj1,140:$Vk1,141:$Vl1,142:$Vm1,143:$Vn1,144:$Vo1,145:$Vp1,146:$Vq1,147:$Vr1,148:$Vs1}),o($VJ,[2,100]),o($VJ,[2,101]),o($VJ,[2,102]),o($VJ,[2,103]),o($VJ,[2,104]),o($VJ,[2,105]),o($VJ,[2,106]),o($VJ,[2,107]),o($VJ,[2,108]),o($VJ,[2,109]),o($VJ,[2,110]),o($VJ,[2,111]),o($VJ,[2,112]),o($VJ,[2,113]),o($VJ,[2,114]),o($VJ,[2,115]),o($VJ,[2,117]),o($VJ,[2,118]),o($VJ,[2,119]),o($VJ,[2,120]),o($VJ,[2,121]),o($VJ,[2,122]),o([5,9,13,22,25,28,40,41,42,47,50,57,58,68,69,74,76,77,78,80,81,84,85,86,87,89,90,91,109,110,111,112,113,114,115,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[2,131],{49:[1,211],54:[1,214],56:[1,208],83:[1,213],116:[1,209],117:[1,210],118:[1,212]}),o($VJ,[2,129]),o($VJ,[2,130]),o($VJ,[2,132]),o($VK,[2,133],{94:128,95:129,96:130,97:131,98:132,99:133,100:134,101:135,102:136,103:137,104:138,105:139,106:140,107:141,108:142,93:215,13:$VL,42:$VM,49:$VN,54:$VO,56:$VP,83:$VQ,109:$VR,110:$VS,111:$VT,112:$VU,113:$VV,114:$VW,115:$VX,116:$VY,117:$VZ,118:$V_,119:$V$,120:$V01,121:$V11,122:$V21,123:$V31,124:$V41,125:$V51,126:$V61,127:$V71,128:$V81,129:$V91,130:$Va1,131:$Vb1,132:$Vc1,133:$Vd1,134:$Ve1,135:$Vf1,136:$Vg1,137:$Vh1,138:$Vi1,139:$Vj1,140:$Vk1,141:$Vl1,142:$Vm1,143:$Vn1,144:$Vo1,145:$Vp1,146:$Vq1,147:$Vr1,148:$Vs1}),o($VK,[2,134],{94:128,95:129,96:130,97:131,98:132,99:133,100:134,101:135,102:136,103:137,104:138,105:139,106:140,107:141,108:142,93:216,13:$VL,42:$VM,49:$VN,54:$VO,56:$VP,83:$VQ,109:$VR,110:$VS,111:$VT,112:$VU,113:$VV,114:$VW,115:$VX,116:$VY,117:$VZ,118:$V_,119:$V$,120:$V01,121:$V11,122:$V21,123:$V31,124:$V41,125:$V51,126:$V61,127:$V71,128:$V81,129:$V91,130:$Va1,131:$Vb1,132:$Vc1,133:$Vd1,134:$Ve1,135:$Vf1,136:$Vg1,137:$Vh1,138:$Vi1,139:$Vj1,140:$Vk1,141:$Vl1,142:$Vm1,143:$Vn1,144:$Vo1,145:$Vp1,146:$Vq1,147:$Vr1,148:$Vs1}),o($VJ,[2,135]),o($VJ,[2,136]),o($VJ,[2,137]),o($VJ,[2,138]),o($VJ,[2,139]),o($VJ,[2,140]),o($VJ,[2,141]),o($VJ,[2,142]),o($VJ,[2,143]),o($VJ,[2,144]),o($VJ,[2,145]),o($VJ,[2,146]),o($VJ,[2,147]),o($VJ,[2,148]),o($VJ,[2,149]),o($VJ,[2,150]),o($VJ,[2,151]),o($VJ,[2,152]),o($VJ,[2,153]),o($VJ,[2,154]),o($VJ,[2,155]),o($VJ,[2,156]),o($VJ,[2,157]),o($VJ,[2,158]),o($VJ,[2,159]),o($VJ,[2,160]),o($VJ,[2,161]),o($VJ,[2,162]),{54:[1,217]},o($VJ,[2,116]),o($VJ,[2,167]),o($VJ,[2,168]),o($VJ,[2,169]),{12:[1,218]},o([5,9,13,22,25,28,40,41,42,47,49,50,54,57,58,68,69,74,76,77,78,79,80,81,83,84,85,86,87,89,90,91,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[2,58],{56:[1,219]}),o($VK,[2,46],{93:127,94:128,95:129,96:130,97:131,98:132,99:133,100:134,101:135,102:136,103:137,104:138,105:139,106:140,107:141,108:142,13:$VL,42:$VM,49:$VN,54:$VO,56:$VP,83:$VQ,109:$VR,110:$VS,111:$VT,112:$VU,113:$VV,114:$VW,115:$VX,116:$VY,117:$VZ,118:$V_,119:$V$,120:$V01,121:$V11,122:$V21,123:$V31,124:$V41,125:$V51,126:$V61,127:$V71,128:$V81,129:$V91,130:$Va1,131:$Vb1,132:$Vc1,133:$Vd1,134:$Ve1,135:$Vf1,136:$Vg1,137:$Vh1,138:$Vi1,139:$Vj1,140:$Vk1,141:$Vl1,142:$Vm1,143:$Vn1,144:$Vo1,145:$Vp1,146:$Vq1,147:$Vr1,148:$Vs1}),o($VK,[2,61],{93:127,94:128,95:129,96:130,97:131,98:132,99:133,100:134,101:135,102:136,103:137,104:138,105:139,106:140,107:141,108:142,13:$VL,42:$VM,49:$VN,54:$VO,56:$VP,83:$VQ,109:$VR,110:$VS,111:$VT,112:$VU,113:$VV,114:$VW,115:$VX,116:$VY,117:$VZ,118:$V_,119:$V$,120:$V01,121:$V11,122:$V21,123:$V31,124:$V41,125:$V51,126:$V61,127:$V71,128:$V81,129:$V91,130:$Va1,131:$Vb1,132:$Vc1,133:$Vd1,134:$Ve1,135:$Vf1,136:$Vg1,137:$Vh1,138:$Vi1,139:$Vj1,140:$Vk1,141:$Vl1,142:$Vm1,143:$Vn1,144:$Vo1,145:$Vp1,146:$Vq1,147:$Vr1,148:$Vs1}),o($VK,[2,62],{93:127,94:128,95:129,96:130,97:131,98:132,99:133,100:134,101:135,102:136,103:137,104:138,105:139,106:140,107:141,108:142,13:$VL,42:$VM,49:$VN,54:$VO,56:$VP,83:$VQ,109:$VR,110:$VS,111:$VT,112:$VU,113:$VV,114:$VW,115:$VX,116:$VY,117:$VZ,118:$V_,119:$V$,120:$V01,121:$V11,122:$V21,123:$V31,124:$V41,125:$V51,126:$V61,127:$V71,128:$V81,129:$V91,130:$Va1,131:$Vb1,132:$Vc1,133:$Vd1,134:$Ve1,135:$Vf1,136:$Vg1,137:$Vh1,138:$Vi1,139:$Vj1,140:$Vk1,141:$Vl1,142:$Vm1,143:$Vn1,144:$Vo1,145:$Vp1,146:$Vq1,147:$Vr1,148:$Vs1}),{9:$Vi,29:38,30:39,31:40,32:41,33:42,34:43,35:44,36:45,37:46,38:47,39:48,40:$Vj,41:$Vk,42:$Vl,43:49,46:50,47:$Vm,50:$Vn,57:$Vo,58:$Vp,59:53,60:54,61:55,62:56,63:57,64:58,65:59,66:60,67:61,68:$Vq,69:$Vr,74:$Vs,76:$Vt,77:$Vu,78:$Vv,80:$Vw,81:$Vx,84:$Vy,85:$Vz,86:$VA,87:$VB,89:[1,220],90:$VC,91:$VD},{54:[1,221]},{88:[1,222]},o($VJ,[2,49]),o($Vv1,[2,51]),o($Vw1,[2,56]),o($Vw1,[2,57]),o($VF,[2,75]),o($VF,[2,77]),o($VF,[2,78]),{54:[1,223]},{79:[1,224]},{54:[1,225]},o($VF,[2,86]),{54:[1,226]},o($VJ,[2,123]),o($VJ,[2,124]),o($VJ,[2,125]),o($VJ,[2,126]),o($VJ,[2,127]),o($VJ,[2,128]),o($VJ,[2,166]),o($VJ,[2,164]),o($VJ,[2,165]),o($VJ,[2,163]),o($VJ,[2,170]),o($Vt1,[2,60]),o($VF,[2,92]),{88:[1,227]},{46:228,50:$Vn},o($VF,[2,79]),{54:[1,229]},o($VF,[2,84]),o($VF,[2,87]),o($Vu1,$V1,{27:230}),{44:231,46:232,50:$Vn,54:$VI},o($VF,[2,82]),{9:$Vi,29:38,30:39,31:40,32:41,33:42,34:43,35:44,36:45,37:46,38:47,39:48,40:$Vj,41:$Vk,42:$Vl,43:49,46:50,47:$Vm,50:$Vn,57:$Vo,58:$Vp,59:53,60:54,61:55,62:56,63:57,64:58,65:59,66:60,67:61,68:$Vq,69:$Vr,74:$Vs,76:$Vt,77:$Vu,78:$Vv,80:$Vw,81:$Vx,84:$Vy,85:$Vz,86:$VA,87:$VB,89:[1,233],90:$VC,91:$VD},{46:234,50:$Vn},{89:[1,235]},o($VF,[2,95]),{44:236,54:$VI,89:[1,237]},o($VF,[2,98]),{89:[1,238]},o($VF,[2,97]),o($VF,[2,96])],
472
- defaultActions: {20:[2,1]},
473
- parseError: function parseError (str, hash) {
474
- if (hash.recoverable) {
475
- this.trace(str);
476
- } else {
477
- var error = new Error(str);
478
- error.hash = hash;
479
- throw error;
480
- }
481
- },
482
- parse: function parse(input) {
483
- var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
484
- var args = lstack.slice.call(arguments, 1);
485
- var lexer = Object.create(this.lexer);
486
- var sharedState = { yy: {} };
487
- for (var k in this.yy) {
488
- if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
489
- sharedState.yy[k] = this.yy[k];
490
- }
491
- }
492
- lexer.setInput(input, sharedState.yy);
493
- sharedState.yy.lexer = lexer;
494
- sharedState.yy.parser = this;
495
- if (typeof lexer.yylloc == 'undefined') {
496
- lexer.yylloc = {};
497
- }
498
- var yyloc = lexer.yylloc;
499
- lstack.push(yyloc);
500
- var ranges = lexer.options && lexer.options.ranges;
501
- if (typeof sharedState.yy.parseError === 'function') {
502
- this.parseError = sharedState.yy.parseError;
503
- } else {
504
- this.parseError = Object.getPrototypeOf(this).parseError;
505
- }
506
- function popStack(n) {
507
- stack.length = stack.length - 2 * n;
508
- vstack.length = vstack.length - n;
509
- lstack.length = lstack.length - n;
510
- }
511
- _token_stack:
512
- var lex = function () {
513
- var token;
514
- token = lexer.lex() || EOF;
515
- if (typeof token !== 'number') {
516
- token = self.symbols_[token] || token;
517
- }
518
- return token;
519
- };
520
- var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
521
- while (true) {
522
- state = stack[stack.length - 1];
523
- if (this.defaultActions[state]) {
524
- action = this.defaultActions[state];
525
- } else {
526
- if (symbol === null || typeof symbol == 'undefined') {
527
- symbol = lex();
528
- }
529
- action = table[state] && table[state][symbol];
530
- }
531
- if (typeof action === 'undefined' || !action.length || !action[0]) {
532
- var errStr = '';
533
- expected = [];
534
- for (p in table[state]) {
535
- if (this.terminals_[p] && p > TERROR) {
536
- expected.push('\'' + this.terminals_[p] + '\'');
537
- }
538
- }
539
- if (lexer.showPosition) {
540
- errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
541
- } else {
542
- errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
543
- }
544
- this.parseError(errStr, {
545
- text: lexer.match,
546
- token: this.terminals_[symbol] || symbol,
547
- line: lexer.yylineno,
548
- loc: yyloc,
549
- expected: expected
550
- });
551
- }
552
- if (action[0] instanceof Array && action.length > 1) {
553
- throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
554
- }
555
- switch (action[0]) {
556
- case 1:
557
- stack.push(symbol);
558
- vstack.push(lexer.yytext);
559
- lstack.push(lexer.yylloc);
560
- stack.push(action[1]);
561
- symbol = null;
562
- if (!preErrorSymbol) {
563
- yyleng = lexer.yyleng;
564
- yytext = lexer.yytext;
565
- yylineno = lexer.yylineno;
566
- yyloc = lexer.yylloc;
567
- if (recovering > 0) {
568
- recovering--;
569
- }
570
- } else {
571
- symbol = preErrorSymbol;
572
- preErrorSymbol = null;
573
- }
574
- break;
575
- case 2:
576
- len = this.productions_[action[1]][1];
577
- yyval.$ = vstack[vstack.length - len];
578
- yyval._$ = {
579
- first_line: lstack[lstack.length - (len || 1)].first_line,
580
- last_line: lstack[lstack.length - 1].last_line,
581
- first_column: lstack[lstack.length - (len || 1)].first_column,
582
- last_column: lstack[lstack.length - 1].last_column
583
- };
584
- if (ranges) {
585
- yyval._$.range = [
586
- lstack[lstack.length - (len || 1)].range[0],
587
- lstack[lstack.length - 1].range[1]
588
- ];
589
- }
590
- r = this.performAction.apply(yyval, [
591
- yytext,
592
- yyleng,
593
- yylineno,
594
- sharedState.yy,
595
- action[1],
596
- vstack,
597
- lstack
598
- ].concat(args));
599
- if (typeof r !== 'undefined') {
600
- return r;
601
- }
602
- if (len) {
603
- stack = stack.slice(0, -1 * len * 2);
604
- vstack = vstack.slice(0, -1 * len);
605
- lstack = lstack.slice(0, -1 * len);
606
- }
607
- stack.push(this.productions_[action[1]][0]);
608
- vstack.push(yyval.$);
609
- lstack.push(yyval._$);
610
- newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
611
- stack.push(newState);
612
- break;
613
- case 3:
614
- return true;
615
- }
616
- }
617
- return true;
618
- }};
619
-
620
- // Helper functions
621
- const fraction = (numerator, denominator) => ({ numerator, denominator });
622
-
623
- const pitch = (phonet, accidental, octave) => ({
624
- phonet,
625
- accidental: accidental || undefined,
626
- octave: octave || 0,
627
- });
628
-
629
- const duration = (division, dots) => ({
630
- division,
631
- dots: dots || 0,
632
- });
633
-
634
- const noteEvent = (pitches, dur, marks, options = {}) => {
635
- // Check if this is a pitched rest (e.g., g'\rest)
636
- const pitchedRestMark = marks && marks.find(m => m && m.pitchedRest);
637
- if (pitchedRestMark) {
638
- const pitch = Array.isArray(pitches) ? pitches[0] : pitches;
639
- return {
640
- type: 'rest',
641
- duration: dur,
642
- pitch: pitch,
643
- };
644
- }
645
- return {
646
- type: 'note',
647
- pitches: Array.isArray(pitches) ? pitches : [pitches],
648
- duration: dur,
649
- marks: marks && marks.length ? marks : undefined,
650
- ...options,
651
- };
652
- };
653
-
654
- const restEvent = (dur, options = {}) => ({
655
- type: 'rest',
656
- duration: dur,
657
- ...options,
658
- });
659
-
660
- const contextChange = (changes) => ({
661
- type: 'context',
662
- ...changes,
663
- });
664
-
665
- const keySignature = (phonet, accidental, mode) => ({
666
- pitch: phonet,
667
- accidental: accidental || undefined,
668
- mode,
669
- });
670
-
671
- const voice = (staff, events) => ({
672
- staff: staff || 1,
673
- events,
674
- });
675
-
676
- const part = (voices, name) => ({
677
- name: name || undefined,
678
- voices,
679
- });
680
-
681
- const measure = (parts, key, timeSig, partial) => ({
682
- key: key || undefined,
683
- timeSig: timeSig || undefined,
684
- parts,
685
- partial: partial || undefined,
686
- });
687
-
688
- const tupletEvent = (ratio, events) => ({
689
- type: 'tuplet',
690
- ratio,
691
- events,
692
- });
693
-
694
- const tremoloEvent = (pitchA, pitchB, count, division) => ({
695
- type: 'tremolo',
696
- pitchA,
697
- pitchB,
698
- count,
699
- division,
700
- });
701
-
702
- // Articulation/mark helpers - all marks have markType for discrimination
703
- const articulation = (type, placement) => ({ markType: 'articulation', type, placement });
704
- const ornament = (type) => ({ markType: 'ornament', type });
705
- const dynamic = (type) => ({ markType: 'dynamic', type });
706
- const hairpin = (type) => ({ markType: 'hairpin', type });
707
- const pedal = (type) => ({ markType: 'pedal', type });
708
- const tie = (start) => ({ markType: 'tie', start });
709
- const slur = (start) => ({ markType: 'slur', start });
710
- const beam = (start) => ({ markType: 'beam', start });
711
- const fingering = (finger, placement) => ({ markType: 'fingering', finger, placement });
712
- const navigation = (type) => ({ markType: 'navigation', type });
713
-
714
- const barlineEvent = (style) => ({ type: 'barline', style });
715
- const harmonyEvent = (text) => ({ type: 'harmony', text });
716
- const markupEvent = (content, placement) => ({ type: 'markup', content, placement: placement || undefined });
717
- const markupMark = (content) => ({ markType: 'markup', content });
718
-
719
- // Parse PITCH token (e.g., "c", "cs", "bf", "css", "bff") into phonet and accidental
720
- const parsePitch = (text, octave) => {
721
- const phonet = text[0].toLowerCase();
722
- const accStr = text.slice(1).toLowerCase();
723
- let accidental = undefined;
724
- if (accStr === 's') accidental = 'sharp';
725
- else if (accStr === 'f') accidental = 'flat';
726
- else if (accStr === 'ss') accidental = 'doubleSharp';
727
- else if (accStr === 'ff') accidental = 'doubleFlat';
728
- return pitch(phonet, accidental, octave || 0);
729
- };
730
-
731
- // Parse PITCH token for key signature (no octave)
732
- const parsePitchName = (text) => {
733
- const phonet = text[0].toLowerCase();
734
- const accStr = text.slice(1).toLowerCase();
735
- let accidental = undefined;
736
- if (accStr === 's') accidental = 'sharp';
737
- else if (accStr === 'f') accidental = 'flat';
738
- else if (accStr === 'ss') accidental = 'doubleSharp';
739
- else if (accStr === 'ff') accidental = 'doubleFlat';
740
- return { phonet, accidental };
741
- };
742
-
743
- // Global state for parsing
744
- let currentStaff = 1;
745
- let currentKey = null;
746
- let currentTimeSig = null;
747
- let currentDuration = { division: 4, dots: 0 }; // default quarter note
748
- let numericTimeSignature = false; // When true, 4/4 and 2/2 use numeric display instead of C/C|
749
- let currentOttava = 0; // Current ottava level, resets on newline
750
-
751
- // Reset parser state - call before each parse
752
- const resetParserState = () => {
753
- currentStaff = 1;
754
- currentKey = null;
755
- currentTimeSig = null;
756
- currentDuration = { division: 4, dots: 0 };
757
- numericTimeSignature = false;
758
- currentOttava = 0;
759
- };
760
-
761
- // Export reset function
762
- parser.resetState = resetParserState;
763
- /* generated by jison-lex 0.3.4 */
764
- var lexer = (function(){
765
- var lexer = ({
766
-
767
- EOF:1,
768
-
769
- parseError:function parseError(str, hash) {
770
- if (this.yy.parser) {
771
- this.yy.parser.parseError(str, hash);
772
- } else {
773
- throw new Error(str);
774
- }
775
- },
776
-
777
- // resets the lexer, sets new input
778
- setInput:function (input, yy) {
779
- this.yy = yy || this.yy || {};
780
- this._input = input;
781
- this._more = this._backtrack = this.done = false;
782
- this.yylineno = this.yyleng = 0;
783
- this.yytext = this.matched = this.match = '';
784
- this.conditionStack = ['INITIAL'];
785
- this.yylloc = {
786
- first_line: 1,
787
- first_column: 0,
788
- last_line: 1,
789
- last_column: 0
790
- };
791
- if (this.options.ranges) {
792
- this.yylloc.range = [0,0];
793
- }
794
- this.offset = 0;
795
- return this;
796
- },
797
-
798
- // consumes and returns one char from the input
799
- input:function () {
800
- var ch = this._input[0];
801
- this.yytext += ch;
802
- this.yyleng++;
803
- this.offset++;
804
- this.match += ch;
805
- this.matched += ch;
806
- var lines = ch.match(/(?:\r\n?|\n).*/g);
807
- if (lines) {
808
- this.yylineno++;
809
- this.yylloc.last_line++;
810
- } else {
811
- this.yylloc.last_column++;
812
- }
813
- if (this.options.ranges) {
814
- this.yylloc.range[1]++;
815
- }
816
-
817
- this._input = this._input.slice(1);
818
- return ch;
819
- },
820
-
821
- // unshifts one char (or a string) into the input
822
- unput:function (ch) {
823
- var len = ch.length;
824
- var lines = ch.split(/(?:\r\n?|\n)/g);
825
-
826
- this._input = ch + this._input;
827
- this.yytext = this.yytext.substr(0, this.yytext.length - len);
828
- //this.yyleng -= len;
829
- this.offset -= len;
830
- var oldLines = this.match.split(/(?:\r\n?|\n)/g);
831
- this.match = this.match.substr(0, this.match.length - 1);
832
- this.matched = this.matched.substr(0, this.matched.length - 1);
833
-
834
- if (lines.length - 1) {
835
- this.yylineno -= lines.length - 1;
836
- }
837
- var r = this.yylloc.range;
838
-
839
- this.yylloc = {
840
- first_line: this.yylloc.first_line,
841
- last_line: this.yylineno + 1,
842
- first_column: this.yylloc.first_column,
843
- last_column: lines ?
844
- (lines.length === oldLines.length ? this.yylloc.first_column : 0)
845
- + oldLines[oldLines.length - lines.length].length - lines[0].length :
846
- this.yylloc.first_column - len
847
- };
848
-
849
- if (this.options.ranges) {
850
- this.yylloc.range = [r[0], r[0] + this.yyleng - len];
851
- }
852
- this.yyleng = this.yytext.length;
853
- return this;
854
- },
855
-
856
- // When called from action, caches matched text and appends it on next action
857
- more:function () {
858
- this._more = true;
859
- return this;
860
- },
861
-
862
- // 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.
863
- reject:function () {
864
- if (this.options.backtrack_lexer) {
865
- this._backtrack = true;
866
- } else {
867
- return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), {
868
- text: "",
869
- token: null,
870
- line: this.yylineno
871
- });
872
-
873
- }
874
- return this;
875
- },
876
-
877
- // retain first n characters of the match
878
- less:function (n) {
879
- this.unput(this.match.slice(n));
880
- },
881
-
882
- // displays already matched input, i.e. for error messages
883
- pastInput:function () {
884
- var past = this.matched.substr(0, this.matched.length - this.match.length);
885
- return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
886
- },
887
-
888
- // displays upcoming input, i.e. for error messages
889
- upcomingInput:function () {
890
- var next = this.match;
891
- if (next.length < 20) {
892
- next += this._input.substr(0, 20-next.length);
893
- }
894
- return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
895
- },
896
-
897
- // displays the character position where the lexing error occurred, i.e. for error messages
898
- showPosition:function () {
899
- var pre = this.pastInput();
900
- var c = new Array(pre.length + 1).join("-");
901
- return pre + this.upcomingInput() + "\n" + c + "^";
902
- },
903
-
904
- // test the lexed token: return FALSE when not a match, otherwise return token
905
- test_match:function(match, indexed_rule) {
906
- var token,
907
- lines,
908
- backup;
909
-
910
- if (this.options.backtrack_lexer) {
911
- // save context
912
- backup = {
913
- yylineno: this.yylineno,
914
- yylloc: {
915
- first_line: this.yylloc.first_line,
916
- last_line: this.last_line,
917
- first_column: this.yylloc.first_column,
918
- last_column: this.yylloc.last_column
919
- },
920
- yytext: this.yytext,
921
- match: this.match,
922
- matches: this.matches,
923
- matched: this.matched,
924
- yyleng: this.yyleng,
925
- offset: this.offset,
926
- _more: this._more,
927
- _input: this._input,
928
- yy: this.yy,
929
- conditionStack: this.conditionStack.slice(0),
930
- done: this.done
931
- };
932
- if (this.options.ranges) {
933
- backup.yylloc.range = this.yylloc.range.slice(0);
934
- }
935
- }
936
-
937
- lines = match[0].match(/(?:\r\n?|\n).*/g);
938
- if (lines) {
939
- this.yylineno += lines.length;
940
- }
941
- this.yylloc = {
942
- first_line: this.yylloc.last_line,
943
- last_line: this.yylineno + 1,
944
- first_column: this.yylloc.last_column,
945
- last_column: lines ?
946
- lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length :
947
- this.yylloc.last_column + match[0].length
948
- };
949
- this.yytext += match[0];
950
- this.match += match[0];
951
- this.matches = match;
952
- this.yyleng = this.yytext.length;
953
- if (this.options.ranges) {
954
- this.yylloc.range = [this.offset, this.offset += this.yyleng];
955
- }
956
- this._more = false;
957
- this._backtrack = false;
958
- this._input = this._input.slice(match[0].length);
959
- this.matched += match[0];
960
- token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
961
- if (this.done && this._input) {
962
- this.done = false;
963
- }
964
- if (token) {
965
- return token;
966
- } else if (this._backtrack) {
967
- // recover context
968
- for (var k in backup) {
969
- this[k] = backup[k];
970
- }
971
- return false; // rule action called reject() implying the next rule should be tested instead.
972
- }
973
- return false;
974
- },
975
-
976
- // return next match in input
977
- next:function () {
978
- if (this.done) {
979
- return this.EOF;
980
- }
981
- if (!this._input) {
982
- this.done = true;
983
- }
984
-
985
- var token,
986
- match,
987
- tempMatch,
988
- index;
989
- if (!this._more) {
990
- this.yytext = '';
991
- this.match = '';
992
- }
993
- var rules = this._currentRules();
994
- for (var i = 0; i < rules.length; i++) {
995
- tempMatch = this._input.match(this.rules[rules[i]]);
996
- if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
997
- match = tempMatch;
998
- index = i;
999
- if (this.options.backtrack_lexer) {
1000
- token = this.test_match(tempMatch, rules[i]);
1001
- if (token !== false) {
1002
- return token;
1003
- } else if (this._backtrack) {
1004
- match = false;
1005
- continue; // rule action called reject() implying a rule MISmatch.
1006
- } else {
1007
- // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
1008
- return false;
1009
- }
1010
- } else if (!this.options.flex) {
1011
- break;
1012
- }
1013
- }
1014
- }
1015
- if (match) {
1016
- token = this.test_match(match, rules[index]);
1017
- if (token !== false) {
1018
- return token;
1019
- }
1020
- // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
1021
- return false;
1022
- }
1023
- if (this._input === "") {
1024
- return this.EOF;
1025
- } else {
1026
- return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
1027
- text: "",
1028
- token: null,
1029
- line: this.yylineno
1030
- });
1031
- }
1032
- },
1033
-
1034
- // return next match that has a token
1035
- lex:function lex () {
1036
- var r = this.next();
1037
- if (r) {
1038
- return r;
1039
- } else {
1040
- return this.lex();
1041
- }
1042
- },
1043
-
1044
- // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
1045
- begin:function begin (condition) {
1046
- this.conditionStack.push(condition);
1047
- },
1048
-
1049
- // pop the previously active lexer condition state off the condition stack
1050
- popState:function popState () {
1051
- var n = this.conditionStack.length - 1;
1052
- if (n > 0) {
1053
- return this.conditionStack.pop();
1054
- } else {
1055
- return this.conditionStack[0];
1056
- }
1057
- },
1058
-
1059
- // produce the lexer rule set which is active for the currently active lexer condition state
1060
- _currentRules:function _currentRules () {
1061
- if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
1062
- return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
1063
- } else {
1064
- return this.conditions["INITIAL"].rules;
1065
- }
1066
- },
1067
-
1068
- // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
1069
- topState:function topState (n) {
1070
- n = this.conditionStack.length - 1 - Math.abs(n || 0);
1071
- if (n >= 0) {
1072
- return this.conditionStack[n];
1073
- } else {
1074
- return "INITIAL";
1075
- }
1076
- },
1077
-
1078
- // alias for begin(condition)
1079
- pushState:function pushState (condition) {
1080
- this.begin(condition);
1081
- },
1082
-
1083
- // return the number of states currently on the stack
1084
- stateStackSize:function stateStackSize() {
1085
- return this.conditionStack.length;
1086
- },
1087
- options: {},
1088
- performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
1089
- var YYSTATE=YY_START;
1090
- switch($avoiding_name_collisions) {
1091
- case 0:
1092
- break;
1093
- case 1:return 9
1094
- break;
1095
- case 2:
1096
- break;
1097
- case 3:return 11
1098
- break;
1099
- case 4:return 14
1100
- break;
1101
- case 5:return 15
1102
- break;
1103
- case 6:return 16
1104
- break;
1105
- case 7:return 17
1106
- break;
1107
- case 8:return 18
1108
- break;
1109
- case 9:return 19
1110
- break;
1111
- case 10:return 20
1112
- break;
1113
- case 11:return 13
1114
- break;
1115
- case 12:return 12
1116
- break;
1117
- case 13:return 68
1118
- break;
1119
- case 14:return 69
1120
- break;
1121
- case 15:return 74
1122
- break;
1123
- case 16:return 76
1124
- break;
1125
- case 17:return 77
1126
- break;
1127
- case 18:return 78
1128
- break;
1129
- case 19:return 80
1130
- break;
1131
- case 20:return 87
1132
- break;
1133
- case 21:return 90
1134
- break;
1135
- case 22:return 91
1136
- break;
1137
- case 23:return 81
1138
- break;
1139
- case 24:return 84
1140
- break;
1141
- case 25:return 85
1142
- break;
1143
- case 26:return 86
1144
- break;
1145
- case 27:return 72
1146
- break;
1147
- case 28:return 73
1148
- break;
1149
- case 29:return 140
1150
- break;
1151
- case 30:return 141
1152
- break;
1153
- case 31:return 40
1154
- break;
1155
- case 32:return 147
1156
- break;
1157
- case 33:return 148
1158
- break;
1159
- case 34:return 41
1160
- break;
1161
- case 35:return 42
1162
- break;
1163
- case 36:return 137
1164
- break;
1165
- case 37:return 138
1166
- break;
1167
- case 38:return 139
1168
- break;
1169
- case 39:return 110
1170
- break;
1171
- case 40:return 111
1172
- break;
1173
- case 41:return 112
1174
- break;
1175
- case 42:return 113
1176
- break;
1177
- case 43:return 114
1178
- break;
1179
- case 44:return 115
1180
- break;
1181
- case 45:return 119
1182
- break;
1183
- case 46:return 120
1184
- break;
1185
- case 47:return 121
1186
- break;
1187
- case 48:return 122
1188
- break;
1189
- case 49:return 123
1190
- break;
1191
- case 50:return 124
1192
- break;
1193
- case 51:return 125
1194
- break;
1195
- case 52:return 126
1196
- break;
1197
- case 53:return 127
1198
- break;
1199
- case 54:return 129
1200
- break;
1201
- case 55:return 130
1202
- break;
1203
- case 56:return 133
1204
- break;
1205
- case 57:return 132
1206
- break;
1207
- case 58:return 134
1208
- break;
1209
- case 59:return 135
1210
- break;
1211
- case 60:return 136
1212
- break;
1213
- case 61:return 128
1214
- break;
1215
- case 62:return 131
1216
- break;
1217
- case 63:return 109
1218
- break;
1219
- case 64:return 25
1220
- break;
1221
- case 65:return 28
1222
- break;
1223
- case 66:return 92
1224
- break;
1225
- case 67:return 50
1226
- break;
1227
- case 68:return 52
1228
- break;
1229
- case 69:return 53
1230
- break;
1231
- case 70:return 54
1232
- break;
1233
- case 71:return 75
1234
- break;
1235
- case 72:return 82
1236
- break;
1237
- case 73:return 88
1238
- break;
1239
- case 74:return 89
1240
- break;
1241
- case 75:return 47
1242
- break;
1243
- case 76:return 49
1244
- break;
1245
- case 77:return 22
1246
- break;
1247
- case 78:return 145
1248
- break;
1249
- case 79:return 13
1250
- break;
1251
- case 80:return 143
1252
- break;
1253
- case 81:return 144
1254
- break;
1255
- case 82:return 142
1256
- break;
1257
- case 83:return 56
1258
- break;
1259
- case 84:return 83
1260
- break;
1261
- case 85:return 116
1262
- break;
1263
- case 86:return 117
1264
- break;
1265
- case 87:return 118
1266
- break;
1267
- case 88:return 146
1268
- break;
1269
- case 89:return 79
1270
- break;
1271
- case 90:return 57
1272
- break;
1273
- case 91:return 58
1274
- break;
1275
- case 92:return 5
1276
- break;
1277
- case 93:
1278
- break;
1279
- }
1280
- },
1281
- rules: [/^(?:[ \t]+)/,/^(?:(\r?\n)+)/,/^(?:%.*)/,/^(?:\[title\b)/,/^(?:\[subtitle\b)/,/^(?:\[composer\b)/,/^(?:\[arranger\b)/,/^(?:\[lyricist\b)/,/^(?:\[opus\b)/,/^(?:\[instrument\b)/,/^(?:\[genre\b)/,/^(?:\])/,/^(?:"[^"]*")/,/^(?:\\clef\b)/,/^(?:\\key\b)/,/^(?:\\time\b)/,/^(?:\\numericTimeSignature\b)/,/^(?:\\defaultTimeSignature\b)/,/^(?:\\tempo\b)/,/^(?:\\staff\b)/,/^(?:\\grace\b)/,/^(?:\\times\b)/,/^(?:\\repeat\b)/,/^(?:\\ottava\b)/,/^(?:\\stemUp\b)/,/^(?:\\stemDown\b)/,/^(?:\\stemNeutral\b)/,/^(?:\\major\b)/,/^(?:\\minor\b)/,/^(?:\\sustainOn\b)/,/^(?:\\sustainOff\b)/,/^(?:\\bar\b)/,/^(?:\\coda\b)/,/^(?:\\segno\b)/,/^(?:\\chords\b)/,/^(?:\\markup\b)/,/^(?:\\<)/,/^(?:\\>)/,/^(?:\\!)/,/^(?:\\staccato\b)/,/^(?:\\staccatissimo\b)/,/^(?:\\tenuto\b)/,/^(?:\\marcato\b)/,/^(?:\\accent\b)/,/^(?:\\portato\b)/,/^(?:\\trill\b)/,/^(?:\\turn\b)/,/^(?:\\mordent\b)/,/^(?:\\prall\b)/,/^(?:\\fermata\b)/,/^(?:\\shortfermata\b)/,/^(?:\\arpeggio\b)/,/^(?:\\ppp\b)/,/^(?:\\pp\b)/,/^(?:\\mp\b)/,/^(?:\\mf\b)/,/^(?:\\fff\b)/,/^(?:\\ff\b)/,/^(?:\\sfz\b)/,/^(?:\\rfz\b)/,/^(?:\\sf\b)/,/^(?:\\p\b)/,/^(?:\\f)/,/^(?:\\rest\b)/,/^(?:\\\\\\)/,/^(?:\\\\)/,/^(?:tremolo\b)/,/^(?:[a-g](ss|ff|s|f)?)/,/^(?:')/,/^(?:,)/,/^(?:[0-9]+)/,/^(?:\/)/,/^(?:#)/,/^(?:\{)/,/^(?:\})/,/^(?:<)/,/^(?:>)/,/^(?:\|)/,/^(?:\[)/,/^(?:\])/,/^(?:\()/,/^(?:\))/,/^(?:~)/,/^(?:\.)/,/^(?:-)/,/^(?:[_])/,/^(?:\^)/,/^(?:!)/,/^(?::)/,/^(?:=)/,/^(?:[rR])/,/^(?:[sS])/,/^(?:$)/,/^(?:.)/],
1282
- conditions: {"INITIAL":{"rules":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93],"inclusive":true}}
1283
- });
1284
- return lexer;
1285
- })();
1286
- parser.lexer = lexer;
1287
- function Parser () {
1288
- this.yy = {};
1289
- }
1290
- Parser.prototype = parser;parser.Parser = Parser;
1291
- return new Parser;
1292
- })(), writable: false, configurable: false });
1293
-
1294
-
1295
-
1296
- // ES module exports
1297
- const __grammar = globalThis.__lilyletGrammar__;
1298
- const __parser = globalThis.__lilyletGrammar__;
1299
- const __Parser = globalThis.__lilyletGrammar__.Parser;
1300
- const __parse = function() { return globalThis.__lilyletGrammar__.parse.apply(globalThis.__lilyletGrammar__, arguments); };
1301
-
1302
- export { __grammar as grammar, __parser as parser, __Parser as Parser, __parse as parse };
1303
- export default __grammar;
1
+ export * from "./lilylet/grammar.jison.js";