// File: /workspace/github_cpp_makefile_star2_O1/kram[P]kram/./src/lexer/lexer.cpp
// Function: lexer::Lexer::next()
Token* Lexer::next() {
	this->current = this->char_at_pos(this->index);

	// End of row
	if (this->current == '\0') {
		return new Token(Type::T_EOL);
	}

	// Ignore Whitespace
	if (iswspace(this->current)) {
		return new Token(Type::IGNORE);
	}

	// Comments
	if (this->current == '/' && this->char_at_pos(this->index+1) == '/') {
		return this->comment();
	}

	// Names
	// Begins with a char a-Z
	if ((this->current >= 'a' && this->current <= 'z') || (this->current >= 'A' && this->current <= 'Z')) {
		return this->name();
	}

	// Numbers
	if (this->current >= '0' && this->current <= '9') {
		return this->number();
	}

	// Strings
	if (this->current == '\"') {
		return this->string();
	}

	// Operators
	std::string str(1, this->current);
	if (Token::Trans(str) != Type::IGNORE) {
		return this->oper();
	}

	std::cout << "Ignoring: " << this->current << "(" << str << ")\n";

	return new Token(Type::IGNORE);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rdi, %rbx
movq 0x58(%rdi), %rax
cmpq %rax, 0x40(%rdi)
jbe 0x4c96
movq 0x38(%rbx), %rcx
movb (%rcx,%rax), %al
jmp 0x4c98
xorl %eax, %eax
movb %al, 0x60(%rbx)
testb %al, %al
je 0x4cc7
movsbl %al, %edi
callq 0x31c0
testl %eax, %eax
je 0x4cf1
movl $0x28, %edi
callq 0x3260
movq %rax, %rbx
movq %rax, %rdi
movl $0x2, %esi
callq 0x5d0e
jmp 0x4ce1
movl $0x28, %edi
callq 0x3260
movq %rax, %rbx
movq %rax, %rdi
movl $0x1, %esi
callq 0x5d0e
movq %rbx, %rax
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movb 0x60(%rbx), %al
cmpb $0x2f, %al
jne 0x4d23
movq 0x58(%rbx), %rcx
incq %rcx
cmpq %rcx, 0x40(%rbx)
jbe 0x4d23
movq 0x38(%rbx), %rdx
cmpb $0x2f, (%rdx,%rcx)
jne 0x4d23
movq %rbx, %rdi
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x4ede
movl %eax, %ecx
andb $-0x21, %cl
addb $-0x41, %cl
cmpb $0x19, %cl
ja 0x4d44
movq %rbx, %rdi
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x4f58
leal -0x30(%rax), %ecx
cmpb $0x9, %cl
ja 0x4d60
movq %rbx, %rdi
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x5166
cmpb $0x22, %al
jne 0x4d78
movq %rbx, %rdi
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x529e
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
movsbl %al, %edx
leaq 0x10(%rsp), %rdi
movl $0x1, %esi
callq 0x32b0
leaq 0x40(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
addq %rsi, %rdx
leaq 0x30(%rsp), %rdi
callq 0x473c
leaq 0x30(%rsp), %rdi
callq 0x5dd2
movl %eax, %ebp
movq 0x30(%rsp), %rdi
cmpq %r12, %rdi
je 0x4dcf
callq 0x3230
cmpl $0x2, %ebp
jne 0x4e64
movq 0x171f1(%rip), %rdi     # 0x1bfd0
leaq 0xe50c(%rip), %rsi      # 0x132f2
movl $0xa, %edx
callq 0x32a0
movb 0x60(%rbx), %al
leaq 0xf(%rsp), %rsi
movb %al, (%rsi)
movq 0x171cf(%rip), %rdi     # 0x1bfd0
movl $0x1, %edx
callq 0x32a0
movq %rax, %rbx
leaq 0xe4e8(%rip), %rsi      # 0x132fd
movl $0x1, %edx
movq %rax, %rdi
callq 0x32a0
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %rbx, %rdi
callq 0x32a0
leaq 0xe8a3(%rip), %rsi      # 0x136de
movl $0x2, %edx
movq %rax, %rdi
callq 0x32a0
movl $0x28, %edi
callq 0x3260
movq %rax, %rbx
movq %rax, %rdi
movl $0x2, %esi
callq 0x5d0e
jmp 0x4e6f
movq %rbx, %rdi
callq 0x541e
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x4ce1
callq 0x3230
jmp 0x4ce1
movq %rax, %r14
movq %rbx, %rdi
jmp 0x4e9c
movq %rax, %r14
movq 0x30(%rsp), %rdi
cmpq %r12, %rdi
je 0x4eab
callq 0x3230
jmp 0x4eab
movq %rax, %r14
jmp 0x4ec4
movq %rax, %r14
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
jne 0x4ebf
jmp 0x4ec4
jmp 0x4eb9
movq %rax, %r14
movq %rbx, %rdi
callq 0x3230
movq %r14, %rdi
callq 0x33c0