diff --git a/src/parser/scanner.ts b/src/parser/scanner.ts index 21d42f28..c1b07983 100644 --- a/src/parser/scanner.ts +++ b/src/parser/scanner.ts @@ -582,7 +582,6 @@ export class Scanner implements ITokenStream { break; } if (this.stream.char === '\n') { - this.stream.next(); break; } this.stream.next(); diff --git a/test/index.ts b/test/index.ts index 7eb82f9b..2c28d4ac 100644 --- a/test/index.ts +++ b/test/index.ts @@ -341,6 +341,15 @@ describe('Comment', () => { const res = await exe('<: "//"'); eq(res, STR('//')); }); + + test.concurrent('line tail', async () => { + const res = await exe(` + let x = 'a' // comment + let y = 'b' + <: x + `); + eq(res, STR('a')); + }); }); test.concurrent('式にコロンがあってもオブジェクトと判定されない', async () => {