5
5
// THIS FILE HAS BEEN GENERATED BY THE `syntax-to-token-pattern.py` GENERATOR
6
6
// DO NOT EDIT THIS FILE DIRECTLY! INSTEAD RUN THE PYTHON SCRIPT.
7
7
// ANY MANUAL EDITS MADE TO THIS FILE WILL BE OVERWRITTEN. YOU HAVE BEEN WARNED.
8
- // Last generated: 15 /08/2024 21:19:25 (UTC+0)
8
+ // Last generated: 17 /08/2024 11:27:04 (UTC+0)
9
9
10
10
import { MetaTokenType , CharacterTokenType , LiteralTokenType , EntityTokenType , KeywordTokenType , EscapedCharacterTokenType , OperatorTokenType } from "./renpy-tokens" ;
11
11
import { TokenPattern } from "./token-pattern-types" ;
@@ -1033,7 +1033,7 @@ export const sayStatements: TokenPattern = {
1033
1033
1034
1034
token : MetaTokenType . SayStatement , /*meta.say.statement.renpy*/
1035
1035
contentToken : LiteralTokenType . String , /*renpy.meta.say.$1 string.quoted.renpy*/
1036
- begin : / (?< = ^ [ \t ] + ) (?: ( [ a - z A - Z _ ] \w * ) \b | " ( [ a - z A - Z _ ] \w * ) \b " ) ( (?: [ \t ] + (?: @ | \w + ) ) * ) ? [ \t ] * ( " " " | " | ' ' ' | ' | ` ` ` | ` ) / dgm,
1036
+ begin : / (?< = ^ [ \t ] + ) (?: ( (?: c h a r a c t e r \. ) ? [ a - z A - Z _ ] \w * ) \b | " ( [ a - z A - Z _ ] \w * ) \b " ) ( (?: [ \t ] + (?: @ | \w + ) ) * ) ? (? = [ \t ] * r ? (?: " | ' | ` ) ) / dgm,
1037
1037
beginCaptures : {
1038
1038
1 : {
1039
1039
token : EntityTokenType . Identifier , /*renpy.meta.character.$1 variable.other.renpy*/
@@ -1073,18 +1073,11 @@ export const sayStatements: TokenPattern = {
1073
1073
} ,
1074
1074
4 : { token : MetaTokenType . StringBegin , /*string.quoted.renpy punctuation.definition.string.begin.renpy*/ } ,
1075
1075
} ,
1076
- // @ts -ignore: Back references in end patterns are replaced by begin matches at runtime
1077
- end : / (?< ! [ ^ \\ ] \\ ) ( ( (?< = \4) \4) | \4) ( [ \t ] * \( .* ?\) (? ! [ ^ \( ] * ?\) ) ) ? / dg,
1078
- endCaptures : {
1079
- 1 : { token : MetaTokenType . StringEnd , /*string.quoted.renpy punctuation.definition.string.end.renpy*/ } ,
1080
- 2 : { token : MetaTokenType . EmptyString , /*meta.empty-string.renpy*/ } ,
1081
- 3 : {
1082
- token : MetaTokenType . Arguments , /*meta.say.arguments.renpy*/
1083
- patterns : [
1084
- ]
1085
- } ,
1086
- } ,
1087
- patterns : [ stringsInterior ]
1076
+ end : / $ / gm,
1077
+ patterns : [
1078
+ strings ,
1079
+ fallbackPatterns ,
1080
+ ]
1088
1081
} ,
1089
1082
{
1090
1083
debugName : "sayStatements.patterns![1]" ,
@@ -1237,23 +1230,35 @@ export const image: TokenPattern = {
1237
1230
debugName : "image.patterns![0]" ,
1238
1231
1239
1232
token : MetaTokenType . ImageStatement , /*meta.image.statement.renpy*/
1240
- begin : / (?< = ^ [ \t ] * ) ( i m a g e ) \b [ \t ] * / dgm,
1233
+ begin : / (?< = ^ [ \t ] * ) ( i m a g e ) \b / dgm,
1241
1234
beginCaptures : {
1242
1235
1 : { token : KeywordTokenType . Image , /*keyword.image.renpy*/ } ,
1243
1236
} ,
1244
- end : / (? = \b ( a t | w i t h ) \b | # | = | : ) | $ / gm,
1237
+ end : / (? = : ) | $ / gm,
1245
1238
patterns : [
1246
1239
strings ,
1247
1240
{
1248
1241
debugName : "image.patterns![0].patterns![1]" ,
1249
1242
1250
1243
token : EntityTokenType . ImageName , /*entity.name.type.image.renpy*/
1251
- match : / \b (?: [ a - z A - Z _ 0 - 9 ] + ) \b [ \t ] * / g,
1244
+ match : / \b (?: [ a - z A - Z _ 0 - 9 ] + ) \b / g,
1252
1245
} ,
1246
+ atStatement ,
1247
+ withStatement ,
1248
+ {
1249
+ debugName : "image.patterns![0].patterns![4]" ,
1250
+
1251
+ contentToken : MetaTokenType . PythonExpression , /*meta.python.expression.renpy*/
1252
+ begin : / = / dg,
1253
+ beginCaptures : {
1254
+ 0 : { token : OperatorTokenType . Assignment , /*keyword.operator.assignment.renpy*/ } ,
1255
+ } ,
1256
+ end : / $ / gm,
1257
+ patterns : [ whitespace ]
1258
+ } ,
1259
+ fallbackPatterns ,
1253
1260
]
1254
1261
} ,
1255
- atStatement ,
1256
- withStatement ,
1257
1262
]
1258
1263
} ;
1259
1264
@@ -1681,7 +1686,7 @@ export const label: TokenPattern = {
1681
1686
beginCaptures : {
1682
1687
1 : { token : KeywordTokenType . Label , /*storage.type.function.label.renpy*/ } ,
1683
1688
} ,
1684
- end : / (? = # | : ) | $ / gm,
1689
+ end : / (? = : ) | $ / gm,
1685
1690
patterns : [
1686
1691
{
1687
1692
debugName : "label.patterns![0]" ,
@@ -1690,6 +1695,7 @@ export const label: TokenPattern = {
1690
1695
match : / \b (?< ! \. ) ( h i d e ) \b / g,
1691
1696
} ,
1692
1697
labelDefName ,
1698
+ fallbackPatterns ,
1693
1699
]
1694
1700
} ;
1695
1701
@@ -2054,6 +2060,7 @@ simpleExpression.patterns!.splice(7, 0, comments);
2054
2060
stringsInterior . patterns ! . splice ( 2 , 0 , stringTags ) ;
2055
2061
stringTags . patterns ! [ 10 ] . captures ! [ 4 ] . patterns ! [ 0 ] . captures ! [ 3 ] . patterns ! . splice ( 0 , 0 , labelName ) ;
2056
2062
pythonStatements . patterns ! . push ( define , defaultStatement , oneLinePython , pythonBlockTester ) ;
2063
+ sayStatements . patterns ! [ 0 ] . patterns ! . splice ( 2 , 0 , withStatement ) ;
2057
2064
sayStatements . patterns ! [ 1 ] . patterns ! . splice ( 2 , 0 , withStatement ) ;
2058
2065
renpyBlockTester . patterns ! . push ( basePatterns ) ;
2059
2066
layeredimageBlockTester . patterns ! . push ( layeredimageGroup , layeredimageAttribute , basePatterns ) ;
0 commit comments