Add class name literals.

This commit is contained in:
Trey Evans
2021-02-01 13:21:49 -05:00
parent 15e412bd4e
commit b974b3df3e
2 changed files with 60 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
@@ -214,10 +219,15 @@ statements
;
className
: alphaNumToken { $$=$1; }
:
| alphaNumToken { $$=$1; }
| classLiteralName { $$=$1; }
| alphaNumToken className { $$=$1+$2; }
| classLiteralName className { $$=$1+$2; }
| alphaNumToken GENERICTYPE className { $$=$1+'~'+$2+$3; }
| classLiteralName GENERICTYPE className { $$=$1+'~'+$2+$3; }
| alphaNumToken GENERICTYPE { $$=$1+'~'+$2; }
| classLiteralName GENERICTYPE { $$=$1+'~'+$2; }
;
statement
@@ -309,4 +319,6 @@ textNoTagsToken: alphaNumToken | SPACE | MINUS | keywords ;
alphaNumToken : UNICODE_TEXT | NUM | ALPHA;
classLiteralName : BQUOTE_STR;
%%