Add class name literals, with less conflicts.

This commit is contained in:
Trey Evans
2021-02-25 14:47:53 -05:00
parent be95b93a2d
commit 438884b866
3 changed files with 69 additions and 1 deletions

View File

@@ -7,6 +7,7 @@
/* lexical grammar */
%lex
%x string
%x bqstring
%x generic
%x struct
%x href
@@ -49,6 +50,10 @@
<string>["] this.popState();
<string>[^"]* return "STR";
[`] this.begin("bqstring");
<bqstring>[`] this.popState();
<bqstring>[^`]+ return "BQUOTE_STR";
/*
---interactivity command---
'href' adds a link to the specified node. 'href' can only be specified when the
@@ -215,9 +220,10 @@ statements
className
: alphaNumToken { $$=$1; }
| classLiteralName { $$=$1; }
| alphaNumToken className { $$=$1+$2; }
| alphaNumToken GENERICTYPE className { $$=$1+'~'+$2+$3; }
| alphaNumToken GENERICTYPE { $$=$1+'~'+$2; }
| classLiteralName GENERICTYPE { $$=$1+'~'+$2; }
;
statement
@@ -309,4 +315,6 @@ textNoTagsToken: alphaNumToken | SPACE | MINUS | keywords ;
alphaNumToken : UNICODE_TEXT | NUM | ALPHA;
classLiteralName : BQUOTE_STR;
%%