private function buildFixedAndInlines(array $fixedMap, array $inlines): array
    {
        $overlapped = array_intersect($fixedMap, $inlines);
        if ($overlapped) {
            throw new \InvalidArgumentException(
                "Duplicating fixed tokens and inline tokens strings: "
                . join(', ', array_map('json_encode', $overlapped))
            );
        }

        // $fixedMap all keys are valid names, so + with integer keys will not loss anything
        $all = $fixedMap + array_values($inlines);

        // sort in reverse order to let more long items match first
        // so /'$$' | '$'/ will find ['$$', '$'] in '$$$' and not ['$', '$', '$']
        arsort($all, SORT_STRING);

        $re_map = [];

        $alias_name = 'a';
        foreach ($all as $name => $text) {
            // inline?
            if (is_int($name)) {
                $name = '_' . $alias_name;
                // string increment
                $alias_name++;

                $this->aliased[$name] = $text;
                $this->aliasOf[$text] = $name;
            }
            $re_map[$name] = $this->textToRegExp($text);
        }

        return $re_map;
    }