Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Chord Mate
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RJ Garcia
Chord Mate
Commits
0061d349
Commit
0061d349
authored
10 years ago
by
RJ Garcia
Browse files
Options
Downloads
Patches
Plain Diff
adding instrumental, increasing newlines for exporter
Signed-off-by:
RJ Garcia
<
rj@bighead.net
>
parent
e7c04b2a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/exporter/song.js
+1
-1
1 addition, 1 deletion
src/exporter/song.js
src/lexer.js
+7
-2
7 additions, 2 deletions
src/lexer.js
with
8 additions
and
3 deletions
src/exporter/song.js
+
1
−
1
View file @
0061d349
...
@@ -55,7 +55,7 @@ TextExporter.prototype = (function(proto)
...
@@ -55,7 +55,7 @@ TextExporter.prototype = (function(proto)
var
self
=
this
;
var
self
=
this
;
return
_
.
map
(
song
.
parts
,
function
(
part
)
return
_
.
map
(
song
.
parts
,
function
(
part
)
{
{
return
sprintf
(
'
# %s
\n
%s
'
,
part
.
title
,
exportLines
(
self
,
part
.
lines
));
return
sprintf
(
'
# %s
\n
%s
\n
'
,
part
.
title
,
exportLines
(
self
,
part
.
lines
));
}).
join
(
'
\n
'
);
}).
join
(
'
\n
'
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/lexer.js
+
7
−
2
View file @
0061d349
...
@@ -11,11 +11,12 @@ var LexerPrototype = {
...
@@ -11,11 +11,12 @@ var LexerPrototype = {
var
LexStates
=
Util
.
defineEnum
([
'
NORMAL
'
,
'
LINE
'
]);
var
LexStates
=
Util
.
defineEnum
([
'
NORMAL
'
,
'
LINE
'
]);
var
TokenTypes
=
Util
.
defineEnum
([
var
TokenTypes
=
Util
.
defineEnum
([
'
TITLE
'
,
'
KEY
'
,
'
FLOW
'
,
'
COLON
'
,
'
STRING
'
,
'
SEPARATOR
'
,
'
CHORD
'
,
'
LPAREN
'
,
'
RPAREN
'
,
'
ARROW
'
,
'
MULTIPLIER
'
,
'
CHORD_DEF_SEPARATOR
'
,
'
CHORD_DEF
'
,
'
HASH
'
,
'
LINE
'
,
'
WHITESPACE
'
,
'
INTRO
'
,
'
VERSE
'
,
'
PRE_CHORUS
'
,
'
CHORUS
'
,
'
BRIDGE
'
,
'
OUTRO
'
,
'
INT
'
,
'
NEWLINE
'
,
'
NULL
'
,
'
TITLE
'
,
'
KEY
'
,
'
FLOW
'
,
'
COLON
'
,
'
STRING
'
,
'
SEPARATOR
'
,
'
CHORD
'
,
'
LPAREN
'
,
'
RPAREN
'
,
'
ARROW
'
,
'
MULTIPLIER
'
,
'
CHORD_DEF_SEPARATOR
'
,
'
CHORD_DEF
'
,
'
HASH
'
,
'
LINE
'
,
'
WHITESPACE
'
,
'
INTRO
'
,
'
VERSE
'
,
'
PRE_CHORUS
'
,
'
CHORUS
'
,
'
BRIDGE
'
,
'
OUTRO
'
,
'
INSTRUMENTAL
'
,
'
INT
'
,
'
NEWLINE
'
,
'
NULL
'
,
]);
]);
var
TitleKeyWordTokenTypes
=
[
var
TitleKeyWordTokenTypes
=
[
TokenTypes
.
INTRO
,
TokenTypes
.
VERSE
,
TokenTypes
.
PRE_CHORUS
,
TokenTypes
.
INTRO
,
TokenTypes
.
VERSE
,
TokenTypes
.
PRE_CHORUS
,
TokenTypes
.
CHORUS
,
TokenTypes
.
BRIDGE
,
TokenTypes
.
OUTRO
,
TokenTypes
.
CHORUS
,
TokenTypes
.
BRIDGE
,
TokenTypes
.
OUTRO
,
TokenTypes
.
INSTRUMENTAL
,
];
];
function
tokenTypeToString
(
type
)
function
tokenTypeToString
(
type
)
...
@@ -69,6 +70,8 @@ function tokenTypeToString(type)
...
@@ -69,6 +70,8 @@ function tokenTypeToString(type)
return
'
BRIDGE
'
;
return
'
BRIDGE
'
;
case
TokenTypes
.
OUTRO
:
case
TokenTypes
.
OUTRO
:
return
'
OUTRO
'
;
return
'
OUTRO
'
;
case
TokenTypes
.
INSTRUMENTAL
:
return
'
INSTRUMENTAL
'
;
case
TokenTypes
.
INT
:
case
TokenTypes
.
INT
:
return
'
INT
'
;
return
'
INT
'
;
case
TokenTypes
.
NULL
:
case
TokenTypes
.
NULL
:
...
@@ -103,7 +106,7 @@ Lexer.prototype = (function(proto)
...
@@ -103,7 +106,7 @@ Lexer.prototype = (function(proto)
'
(
'
+
'
(
'
+
'
m[769]?|
'
+
'
m[769]?|
'
+
'
maj[79]?|
'
+
'
maj[79]?|
'
+
'
sus[24]|
'
+
'
sus[24]
?
|
'
+
'
7(sus4|[#b][59])?|
'
+
'
7(sus4|[#b][59])?|
'
+
'
6(
\
/9)?|
'
+
'
6(
\
/9)?|
'
+
'
9(b5)?|
'
+
'
9(b5)?|
'
+
...
@@ -135,6 +138,7 @@ Lexer.prototype = (function(proto)
...
@@ -135,6 +138,7 @@ Lexer.prototype = (function(proto)
new
TokRegExp
(
/^Chorus/
,
'
chorus
'
),
new
TokRegExp
(
/^Chorus/
,
'
chorus
'
),
new
TokRegExp
(
/^Bridge/
,
'
bridge
'
),
new
TokRegExp
(
/^Bridge/
,
'
bridge
'
),
new
TokRegExp
(
/^Outro/
,
'
outro
'
),
new
TokRegExp
(
/^Outro/
,
'
outro
'
),
new
TokRegExp
(
/^Instrumental/
,
'
instrumental
'
),
new
TokRegExp
(
/^title/
,
'
title
'
),
new
TokRegExp
(
/^title/
,
'
title
'
),
new
TokRegExp
(
/^key/
,
'
key
'
),
new
TokRegExp
(
/^key/
,
'
key
'
),
new
TokRegExp
(
/^flow/
,
'
flow
'
),
new
TokRegExp
(
/^flow/
,
'
flow
'
),
...
@@ -172,6 +176,7 @@ Lexer.prototype = (function(proto)
...
@@ -172,6 +176,7 @@ Lexer.prototype = (function(proto)
case
'
chorus
'
:
return
new
Token
(
TokenTypes
.
CHORUS
);
case
'
chorus
'
:
return
new
Token
(
TokenTypes
.
CHORUS
);
case
'
bridge
'
:
return
new
Token
(
TokenTypes
.
BRIDGE
);
case
'
bridge
'
:
return
new
Token
(
TokenTypes
.
BRIDGE
);
case
'
outro
'
:
return
new
Token
(
TokenTypes
.
OUTRO
);
case
'
outro
'
:
return
new
Token
(
TokenTypes
.
OUTRO
);
case
'
instrumental
'
:
return
new
Token
(
TokenTypes
.
INSTRUMENTAL
);
case
'
title
'
:
return
new
Token
(
TokenTypes
.
TITLE
);
case
'
title
'
:
return
new
Token
(
TokenTypes
.
TITLE
);
case
'
key
'
:
return
new
Token
(
TokenTypes
.
KEY
);
case
'
key
'
:
return
new
Token
(
TokenTypes
.
KEY
);
case
'
flow
'
:
return
new
Token
(
TokenTypes
.
FLOW
);
case
'
flow
'
:
return
new
Token
(
TokenTypes
.
FLOW
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment