Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Roblox
GitHub Repository: Roblox/luau
Path: blob/master/Require/src/AliasCycleTracker.h
2725 views
1
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2
#pragma once
3
4
#include "Luau/DenseHash.h"
5
6
#include <optional>
7
#include <string>
8
#include <vector>
9
10
namespace Luau::Require
11
{
12
13
class AliasCycleTracker
14
{
15
public:
16
std::optional<std::string> add(std::string alias);
17
18
private:
19
std::string getStringifiedCycle(const std::string& repeated) const;
20
21
DenseHashSet<std::string> seen{""};
22
std::vector<std::string> ordered;
23
};
24
25
} // namespace Luau::Require
26
27