@Override
    public Scanner scan(Lexer lexer) {
        boolean terminated = false;
        loop:
        while (lexer.hasNext()) {
            final char ch = lexer.next();
            switch (ch) {
                case '\\':
                    if (lexer.hasNext()) {
                        final char chn = lexer.next();
                        if (chn != '\n') {
                            break;
                        }
                    }
                case '\n':
                    break loop;
                case '"':
                    terminated = true;
                    break loop;
            }
        }

        if (terminated) {
            lexer.emit(TokenType.STRING);
            return new InsideActionScanner();
        } else {
            return lexer.errorf("unterminated quoted string");
        }
    }