// File: /workspace/github_cpp_makefile_star2_O2/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
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %r12
pushq $0x1
popq %rcx
movq %r12, %rdi
movq %r15, %rsi
callq 0x5210
leaq 0x5500(%rip), %rsi      # 0xc68c
movq %r12, %rdi
callq 0x73a5
testb %al, %al
jne 0x71ad
leaq 0x5046(%rip), %rsi      # 0xc1e5
leaq 0x8(%rsp), %rdi
callq 0x73a5
testb %al, %al
je 0x71dc
leaq 0x8(%rsp), %rcx
movq %rbx, %rdi
movq %r14, %rsi
movq %rcx, %rdx
callq 0x73b2
leaq 0x8(%rsp), %rdi
callq 0x50e0
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xd07d(%rip), %rdi      # 0x14260
leaq 0x8(%rsp), %rsi
callq 0x74cd
testb %al, %al
jne 0x7206
leaq 0xd098(%rip), %rdi      # 0x14290
leaq 0x8(%rsp), %rsi
callq 0x74cd
testb %al, %al
je 0x7219
incq 0x28(%r14)
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x7ca8
jmp 0x71c0
pushq $-0x1
popq %r12
movq 0xd054(%rip), %r13      # 0x14278
leaq 0xd03d(%rip), %rbp      # 0x14268
cmpq %rbp, %r13
je 0x7254
movq 0x28(%r14), %rdx
leaq 0x20(%r13), %rsi
movq %r15, %rdi
callq 0x74ec
cmpq %r12, %rax
movq %r13, %rdi
cmovbq %rax, %r12
callq 0x5230
movq %rax, %r13
jmp 0x722b
movq 0xd04d(%rip), %r13      # 0x142a8
leaq 0xd036(%rip), %rbp      # 0x14298
cmpq %rbp, %r13
je 0x728b
movq 0x28(%r14), %rdx
leaq 0x20(%r13), %rsi
movq %r15, %rdi
callq 0x74ec
cmpq %r12, %rax
movq %r13, %rdi
cmovbq %rax, %r12
callq 0x5230
movq %rax, %r13
jmp 0x7262
movq 0xd046(%rip), %r13      # 0x142d8
leaq 0xd02f(%rip), %rbp      # 0x142c8
cmpq %rbp, %r13
je 0x72c2
movq 0x28(%r14), %rdx
leaq 0x20(%r13), %rsi
movq %r15, %rdi
callq 0x74ec
cmpq %r12, %rax
movq %r13, %rdi
cmovbq %rax, %r12
callq 0x5230
movq %rax, %r13
jmp 0x7299
cmpq $-0x1, %r12
jne 0x72cb
movq (%r14), %r12
movq 0x28(%r14), %rdx
subq %rdx, %r12
leaq 0x28(%rsp), %rdi
movq %r15, %rsi
movq %r12, %rcx
callq 0x5210
addq %r12, 0x28(%r14)
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x7ca8
leaq 0x28(%rsp), %rdi
callq 0x50e0
jmp 0x71c0
leaq 0x28(%rsp), %rdi
movq %rax, %rbx
callq 0x50e0
jmp 0x7316
jmp 0x7313
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x50e0
movq %rbx, %rdi
callq 0x5340