File tree Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -404,19 +404,13 @@ func blockStringValue(in string) string {
404
404
}
405
405
406
406
// Remove leading blank lines.
407
- for {
408
- if isBlank := lineIsBlank (lines [0 ]); ! isBlank {
409
- break
410
- }
407
+ for len (lines ) > 0 && lineIsBlank (lines [0 ]) {
411
408
lines = lines [1 :]
412
409
}
413
410
414
411
// Remove trailing blank lines.
415
- for {
412
+ for len ( lines ) > 0 && lineIsBlank ( lines [ len ( lines ) - 1 ]) {
416
413
i := len (lines ) - 1
417
- if isBlank := lineIsBlank (lines [i ]); ! isBlank {
418
- break
419
- }
420
414
lines = append (lines [:i ], lines [i + 1 :]... )
421
415
}
422
416
Original file line number Diff line number Diff line change @@ -449,6 +449,15 @@ func TestLexer_ReportsUsefulStringErrors(t *testing.T) {
449
449
450
450
func TestLexer_LexesBlockStrings (t * testing.T ) {
451
451
tests := []Test {
452
+ {
453
+ Body : `""""""` ,
454
+ Expected : Token {
455
+ Kind : BLOCK_STRING ,
456
+ Start : 0 ,
457
+ End : 6 ,
458
+ Value : "" ,
459
+ },
460
+ },
452
461
{
453
462
Body : `"""simple"""` ,
454
463
Expected : Token {
You can’t perform that action at this time.
0 commit comments