1111import type { Token } from './ast' ;
1212import type { Source } from './source' ;
1313import { syntaxError } from '../error' ;
14+ import removeIndentation from '../jsutils/removeIndentation' ;
1415
1516/**
1617 * Given a Source object, this returns a Lexer for that source.
@@ -533,7 +534,7 @@ function readMultiLineString(source, start, line, col, prev): Token {
533534 let position = start + 3 ;
534535 let chunkStart = position ;
535536 let code = 0 ;
536- let value = '' ;
537+ let rawValue = '' ;
537538
538539 while (
539540 position < body . length &&
@@ -545,15 +546,15 @@ function readMultiLineString(source, start, line, col, prev): Token {
545546 charCodeAt . call ( body , position + 1 ) === 34 &&
546547 charCodeAt . call ( body , position + 2 ) === 34
547548 ) {
548- value += slice . call ( body , chunkStart , position ) ;
549+ rawValue += slice . call ( body , chunkStart , position ) ;
549550 return new Tok (
550551 MULTI_LINE_STRING ,
551552 start ,
552553 position + 3 ,
553554 line ,
554555 col ,
555556 prev ,
556- value
557+ removeIndentation ( rawValue )
557558 ) ;
558559 }
559560
@@ -578,7 +579,7 @@ function readMultiLineString(source, start, line, col, prev): Token {
578579 charCodeAt . call ( body , position + 2 ) === 34 &&
579580 charCodeAt . call ( body , position + 3 ) === 34
580581 ) {
581- value += slice . call ( body , chunkStart , position ) + '"""' ;
582+ rawValue += slice . call ( body , chunkStart , position ) + '"""' ;
582583 position += 4 ;
583584 chunkStart = position ;
584585 } else {
0 commit comments