@@ -13,7 +13,7 @@ const digit = /^[0-9]$/;
1313const identifierStart = / ^ [ A - Z a - z _ ] $ / u;
1414const identifierPart = / ^ [ A - Z a - z 0 - 9 _ ] $ / u;
1515const hexDigit = / ^ [ 0 - 9 a - f A - F ] $ / ;
16- const exponentIndicatorPattern = / ^ [ e E ] $ / ;
16+ // const exponentIndicatorPattern = /^[eE]$/;
1717
1818/**
1919 * 入力文字列からトークンを読み取るクラス
@@ -330,9 +330,6 @@ export class Scanner implements ITokenStream {
330330 throw new AiScriptSyntaxError ( `invalid character: "${ this . stream . char } "` , pos ) ;
331331 }
332332 }
333- // Use `return` or `continue` before reaching this line.
334- // Do not add any more code here. This line should be unreachable.
335- break ;
336333 }
337334 // Use `return` or `continue` before reaching this line.
338335 // Do not add any more code here. This line should be unreachable.
@@ -508,37 +505,38 @@ export class Scanner implements ITokenStream {
508505 }
509506 }
510507
511- let exponentIndicator = '' ;
512- let exponentSign = '' ;
513- let exponentAbsolute = '' ;
514- if ( ! this . stream . eof && exponentIndicatorPattern . test ( this . stream . char as string ) ) {
515- exponentIndicator = this . stream . char as string ;
516- this . stream . next ( ) ;
517- if ( ! this . stream . eof && ( this . stream . char as string ) === '-' ) {
518- exponentSign = '-' ;
519- this . stream . next ( ) ;
520- } else if ( ! this . stream . eof && ( this . stream . char as string ) === '+' ) {
521- exponentSign = '+' ;
522- this . stream . next ( ) ;
523- }
524- while ( ! this . stream . eof && digit . test ( this . stream . char ) ) {
525- exponentAbsolute += this . stream . char ;
526- this . stream . next ( ) ;
527- }
528- if ( exponentAbsolute . length === 0 ) {
529- throw new AiScriptSyntaxError ( 'exponent expected' , pos ) ;
530- }
531- }
508+ // 指数表記仕様が必要になった段階で有効化する
509+ //let exponentIndicator = '';
510+ //let exponentSign = '';
511+ //let exponentAbsolute = '';
512+ //if (!this.stream.eof && exponentIndicatorPattern.test(this.stream.char as string)) {
513+ // exponentIndicator = this.stream.char as string;
514+ // this.stream.next();
515+ // if (!this.stream.eof && (this.stream.char as string) === '-') {
516+ // exponentSign = '-';
517+ // this.stream.next();
518+ // } else if (!this.stream.eof && (this.stream.char as string) === '+') {
519+ // exponentSign = '+';
520+ // this.stream.next();
521+ // }
522+ // while (!this.stream.eof && digit.test(this.stream.char)) {
523+ // exponentAbsolute += this.stream.char;
524+ // this.stream.next();
525+ // }
526+ // if (exponentAbsolute.length === 0) {
527+ // throw new AiScriptSyntaxError('exponent expected', pos);
528+ // }
529+ //}
532530
533531 let value : string ;
534532 if ( fractional . length > 0 ) {
535533 value = wholeNumber + '.' + fractional ;
536534 } else {
537535 value = wholeNumber ;
538536 }
539- if ( exponentIndicator . length > 0 ) {
540- value += exponentIndicator + exponentSign + exponentAbsolute ;
541- }
537+ // if (exponentIndicator.length > 0) {
538+ // value += exponentIndicator + exponentSign + exponentAbsolute;
539+ // }
542540 return TOKEN ( TokenKind . NumberLiteral , pos , { hasLeftSpacing, value } ) ;
543541 }
544542
0 commit comments