gitGraph: 🔨 dot and minus should be valid branch name

This commit is contained in:
zwPapEr 2020-06-20 11:58:38 +08:00
parent 98a7800fae
commit c00b204259

View File

@ -1,10 +1,9 @@
/* /*
* Parse following * Parse following
* gitGraph: * gitGraph:
* commit * commit
* commit * commit
* branch * branch
*/ */
%lex %lex
@ -14,28 +13,28 @@
%% %%
(\r?\n)+ return 'NL'; (\r?\n)+ return 'NL';
\s+ /* skip all whitespace */ \s+ /* skip all whitespace */
\#[^\n]* /* skip comments */ \#[^\n]* /* skip comments */
\%%[^\n]* /* skip comments */ \%%[^\n]* /* skip comments */
"gitGraph" return 'GG'; "gitGraph" return 'GG';
"commit" return 'COMMIT'; "commit" return 'COMMIT';
"branch" return 'BRANCH'; "branch" return 'BRANCH';
"merge" return 'MERGE'; "merge" return 'MERGE';
"reset" return 'RESET'; "reset" return 'RESET';
"checkout" return 'CHECKOUT'; "checkout" return 'CHECKOUT';
"LR" return 'DIR'; "LR" return 'DIR';
"BT" return 'DIR'; "BT" return 'DIR';
":" return ':'; ":" return ':';
"^" return 'CARET' "^" return 'CARET'
"options"\r?\n this.begin("options"); "options"\r?\n this.begin("options");
<options>"end"\r?\n this.popState(); <options>"end"\r?\n this.popState();
<options>[^\n]+\r?\n return 'OPT'; <options>[^\n]+\r?\n return 'OPT';
["] this.begin("string"); ["] this.begin("string");
<string>["] this.popState(); <string>["] this.popState();
<string>[^"]* return 'STR'; <string>[^"]* return 'STR';
[a-zA-Z][a-zA-Z0-9_]+ return 'ID'; [a-zA-Z][-_\.a-zA-Z0-9]*[-_a-zA-Z0-9] return 'ID';
<<EOF>> return 'EOF'; <<EOF>> return 'EOF';
/lex /lex