@@ -50,7 +50,7 @@ public class Lexer {
50
50
}
51
51
52
52
isolated function readNextToken() returns Token | SyntaxError {
53
- string : Char ? char = self .charReader .peek ();
53
+ string ? char = self .charReader .peek ();
54
54
if char == () {
55
55
return {
56
56
kind : T_EOF ,
@@ -72,14 +72,14 @@ public class Lexer {
72
72
}
73
73
}
74
74
75
- isolated function readSeparatorToken(string : Char char ) returns Token ? {
75
+ isolated function readSeparatorToken(string char ) returns Token ? {
76
76
Location location = self .currentLocation .clone ();
77
77
_ = self .readNextChar ();
78
78
TokenType kind = getTokenType (char );
79
79
return getToken (char , kind , location );
80
80
}
81
81
82
- isolated function readSpecialCharacterToken(string : Char char ) returns Token {
82
+ isolated function readSpecialCharacterToken(string char ) returns Token {
83
83
Location location = self .currentLocation .clone ();
84
84
_ = self .readNextChar ();
85
85
TokenType kind = getTokenType (char );
@@ -99,9 +99,9 @@ public class Lexer {
99
99
Location location = self .currentLocation .clone ();
100
100
_ = self .readNextChar (); // Consume first double quote character
101
101
102
- string : Char ? char = self .charReader .peek ();
102
+ string ? char = self .charReader .peek ();
103
103
boolean isEscaped = false ;
104
- while char is string : Char {
104
+ while char is string {
105
105
if char is LineTerminator {
106
106
break ;
107
107
} else if char == DOUBLE_QUOTE && ! isEscaped {
@@ -127,7 +127,7 @@ public class Lexer {
127
127
string line = " " ;
128
128
self .consumeIgnoreChars (3 ); // Consume first three double quote characters
129
129
130
- string : Char ? currentChar = self .charReader .peek ();
130
+ string ? currentChar = self .charReader .peek ();
131
131
boolean isEscaped = false ;
132
132
133
133
while currentChar != () {
@@ -209,11 +209,11 @@ public class Lexer {
209
209
return i ;
210
210
}
211
211
212
- isolated function readNumericLiteral(string : Char firstChar ) returns Token | SyntaxError {
212
+ isolated function readNumericLiteral(string firstChar ) returns Token | SyntaxError {
213
213
Location location = self .currentLocation .clone ();
214
214
string numeral = firstChar ; // Passing first char to handle negative numbers.
215
215
_ = self .readNextChar (); // Consume first char
216
- string : Char ? character = self .charReader .peek ();
216
+ string ? character = self .charReader .peek ();
217
217
while character != () {
218
218
if character is Digit {
219
219
numeral += character ;
@@ -233,15 +233,15 @@ public class Lexer {
233
233
return getToken (number , T_INT , location );
234
234
}
235
235
236
- isolated function readFloatLiteral(string initialNumber , string : Char separator , Location location )
236
+ isolated function readFloatLiteral(string initialNumber , string separator , Location location )
237
237
returns Token | SyntaxError {
238
238
_ = self .readNextChar (); // Consume the separator character
239
239
boolean isExpExpected = separator == DOT ;
240
240
boolean isDashExpected = ! isExpExpected ;
241
241
boolean isDigitExpected = true ;
242
242
243
243
string numeral = initialNumber + separator ;
244
- string : Char ? value = self .charReader .peek ();
244
+ string ? value = self .charReader .peek ();
245
245
while value != () {
246
246
if value is Digit {
247
247
numeral += value ;
@@ -272,7 +272,7 @@ public class Lexer {
272
272
isolated function readCommentToken() returns Token | SyntaxError {
273
273
Location location = self .currentLocation .clone ();
274
274
_ = self .readNextChar (); // Ignore first hash character
275
- string : Char ? character = self .charReader .peek ();
275
+ string ? character = self .charReader .peek ();
276
276
string word = " #" ;
277
277
while character != () {
278
278
if character is LineTerminator {
@@ -292,7 +292,7 @@ public class Lexer {
292
292
int i = 0 ;
293
293
while i < 3 {
294
294
i += 1 ;
295
- string : Char ? c = self .readNextChar ();
295
+ string ? c = self .readNextChar ();
296
296
if c is DOT {
297
297
ellipsis += c ;
298
298
continue ;
@@ -309,12 +309,12 @@ public class Lexer {
309
309
return getToken (ELLIPSIS , T_ELLIPSIS , location );
310
310
}
311
311
312
- isolated function readIdentifierToken(string : Char firstChar ) returns Token | SyntaxError {
312
+ isolated function readIdentifierToken(string firstChar ) returns Token | SyntaxError {
313
313
Location location = self .currentLocation .clone ();
314
314
_ = self .readNextChar ();
315
315
check validateFirstChar (firstChar , self .currentLocation );
316
316
string word = firstChar ;
317
- string : Char ? char = self .charReader .peek ();
317
+ string ? char = self .charReader .peek ();
318
318
while char != () {
319
319
if char is SpecialCharacter {
320
320
break ;
@@ -345,7 +345,7 @@ public class Lexer {
345
345
};
346
346
}
347
347
348
- isolated function updateLocation(string : Char ? char ) {
348
+ isolated function updateLocation(string ? char ) {
349
349
if char is LineTerminator {
350
350
self .currentLocation .line += 1 ;
351
351
self .currentLocation .column = 1 ;
@@ -354,14 +354,14 @@ public class Lexer {
354
354
}
355
355
}
356
356
357
- isolated function readNextChar() returns string : Char ? {
358
- string : Char ? char = self .charReader .read ();
357
+ isolated function readNextChar() returns string ? {
358
+ string ? char = self .charReader .read ();
359
359
self .updateLocation (char );
360
360
return char ;
361
361
}
362
362
}
363
363
364
- isolated function getTokenType(string : Char ? value ) returns TokenType {
364
+ isolated function getTokenType(string ? value ) returns TokenType {
365
365
match value {
366
366
() => {
367
367
return T_EOF ;
0 commit comments