// File: /workspace/github_cpp_makefile_star2_O3/WayfireWM[P]wf-utils/wayfire/lexer/lexer.cpp
// Function: wf::lexer_t::_parse_literal[abi:cxx11]()
variant_t lexer_t::_parse_literal()
{
    // Catch out char and string literals first.
    auto c = _text.substr(_parse_position, 1);
    if ((c == "\'") || (c == "\""))
    {
        return _parse_encapsulated_literal(c, c);
    }

    // It is possible that the literal is 1 character long (Structures and operators).
    if ((contains(OPERATORS, c)) || (contains(STRUCTURES, c)))
    {
         ++_parse_position;
        return parse_literal(c);
    }

    // A literal is denoted from _position until the first occurrence of one of ')', '(', '&', '|', '!', ' ', '"', '\''
    auto end = std::string::npos;
    for (const auto &s : OPERATORS)
    {
        end = std::min(end, _text.find(s, _parse_position));
    }
    for (const auto &s : STRUCTURES)
    {
        end = std::min(end, _text.find(s, _parse_position));
    }
    for (const auto &s : DELIMITERS)
    {
        end = std::min(end, _text.find(s, _parse_position));
    }

    // If we found none of them, the literal ends at the end of _text
    if (end == std::string::npos)
    {
        end = _size;
    }

    // At this point we know that the literal we want is between _parse_position and end. Extract and return.
    auto length = end - _parse_position;
    auto literal_text = _text.substr(_parse_position, length);
    _parse_position += length;
    return parse_literal(literal_text);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq 0x28(%rsi), %rdx
leaq 0x8(%rsi), %r15
leaq 0x8(%rsp), %r12
movl $0x1, %ecx
movq %rsi, %r14
movq %rdi, %rbx
movq %r12, %rdi
movq %r15, %rsi
callq 0x5250
leaq 0x50c8(%rip), %rsi      # 0xc6cc
movq %r12, %rdi
callq 0x5080
testl %eax, %eax
je 0x7662
leaq 0x4bce(%rip), %rsi      # 0xc1e5
leaq 0x8(%rsp), %rdi
callq 0x5080
testl %eax, %eax
je 0x7662
leaq 0xbc3c(%rip), %rdi      # 0x13268
leaq 0x8(%rsp), %rsi
callq 0x79f7
testb %al, %al
jne 0x764f
leaq 0xbc57(%rip), %rdi      # 0x13298
leaq 0x8(%rsp), %rsi
callq 0x79f7
testb %al, %al
je 0x76a2
incq 0x28(%r14)
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x80c6
jmp 0x7675
leaq 0x8(%rsp), %rcx
movq %rbx, %rdi
movq %r14, %rsi
movq %rcx, %rdx
callq 0x789a
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7690
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5230
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xbbd7(%rip), %r13      # 0x13280
leaq 0xbbc0(%rip), %rbp      # 0x13270
movq $-0x1, %r12
cmpq %rbp, %r13
je 0x76e7
movq 0x28(%r14), %rdx
movq 0x20(%r13), %rcx
movq 0x28(%r13), %rsi
movq %r15, %rdi
callq 0x5380
cmpq %r12, %rax
movq %r13, %rdi
cmovbq %rax, %r12
callq 0x5280
movq %rax, %r13
cmpq %rbp, %rax
jne 0x76bc
movq 0xbbc2(%rip), %r13      # 0x132b0
leaq 0xbbab(%rip), %rbp      # 0x132a0
cmpq %rbp, %r13
je 0x7725
movq 0x28(%r14), %rdx
movq 0x20(%r13), %rcx
movq 0x28(%r13), %rsi
movq %r15, %rdi
callq 0x5380
cmpq %r12, %rax
movq %r13, %rdi
cmovbq %rax, %r12
callq 0x5280
movq %rax, %r13
cmpq %rbp, %rax
jne 0x76fa
movq 0xbbb4(%rip), %r13      # 0x132e0
leaq 0xbb9d(%rip), %rbp      # 0x132d0
cmpq %rbp, %r13
je 0x7763
movq 0x28(%r14), %rdx
movq 0x20(%r13), %rcx
movq 0x28(%r13), %rsi
movq %r15, %rdi
callq 0x5380
cmpq %r12, %rax
movq %r13, %rdi
cmovbq %rax, %r12
callq 0x5280
movq %rax, %r13
cmpq %rbp, %rax
jne 0x7738
cmpq $-0x1, %r12
jne 0x776c
movq (%r14), %r12
movq 0x28(%r14), %rdx
subq %rdx, %r12
leaq 0x28(%rsp), %rdi
movq %r15, %rsi
movq %r12, %rcx
callq 0x5250
addq %r12, 0x28(%r14)
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x80c6
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7675
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x5230
jmp 0x7675
leaq 0x38(%rsp), %rcx
movq %rax, %rbx
movq -0x10(%rcx), %rdi
cmpq %rcx, %rdi
je 0x77dd
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x5230
jmp 0x77dd
jmp 0x77da
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x77f8
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5230
movq %rbx, %rdi
callq 0x5390