@@ -235,6 +235,57 @@ Object newPoint = new Vector(point.x * z, 0);`);
235235 Token . Punctuation . Semicolon ,
236236 ] ) ;
237237 } ) ;
238+
239+ it ( 'ternary with decimal literal without spaces (W-8095488)' , async ( ) => {
240+ const input = Input . InMethod ( `Decimal d = b?.34:0;` ) ;
241+ const tokens = await tokenize ( input ) ;
242+
243+ tokens . should . deep . equal ( [
244+ Token . PrimitiveType . Decimal ,
245+ Token . Identifiers . LocalName ( 'd' ) ,
246+ Token . Operators . Assignment ,
247+ Token . Variables . ReadWrite ( 'b' ) ,
248+ Token . Operators . Conditional . QuestionMark ,
249+ Token . Literals . Numeric . Decimal ( '34' ) ,
250+ Token . Operators . Conditional . Colon ,
251+ Token . Literals . Numeric . Decimal ( '0' ) ,
252+ Token . Punctuation . Semicolon ,
253+ ] ) ;
254+ } ) ;
255+
256+ it ( 'ternary with decimal literal with leading digits (W-8095488)' , async ( ) => {
257+ const input = Input . InMethod ( `Decimal i = b?.123:0;` ) ;
258+ const tokens = await tokenize ( input ) ;
259+
260+ tokens . should . deep . equal ( [
261+ Token . PrimitiveType . Decimal ,
262+ Token . Identifiers . LocalName ( 'i' ) ,
263+ Token . Operators . Assignment ,
264+ Token . Variables . ReadWrite ( 'b' ) ,
265+ Token . Operators . Conditional . QuestionMark ,
266+ Token . Literals . Numeric . Decimal ( '123' ) ,
267+ Token . Operators . Conditional . Colon ,
268+ Token . Literals . Numeric . Decimal ( '0' ) ,
269+ Token . Punctuation . Semicolon ,
270+ ] ) ;
271+ } ) ;
272+
273+ it ( 'ternary with decimal literal with spaces (W-8095488)' , async ( ) => {
274+ const input = Input . InMethod ( `Decimal d = b ? .34 : 0;` ) ;
275+ const tokens = await tokenize ( input ) ;
276+
277+ tokens . should . deep . equal ( [
278+ Token . PrimitiveType . Decimal ,
279+ Token . Identifiers . LocalName ( 'd' ) ,
280+ Token . Operators . Assignment ,
281+ Token . Variables . ReadWrite ( 'b' ) ,
282+ Token . Operators . Conditional . QuestionMark ,
283+ Token . Literals . Numeric . Decimal ( '34' ) ,
284+ Token . Operators . Conditional . Colon ,
285+ Token . Literals . Numeric . Decimal ( '0' ) ,
286+ Token . Punctuation . Semicolon ,
287+ ] ) ;
288+ } ) ;
238289 } ) ;
239290
240291 describe ( 'Element Access' , ( ) => {
0 commit comments