7IRawCapturesMap::~IRawCapturesMap() {
8 for (
auto& pair : captures) {
15IRawRule::~IRawRule() {
17 deleteIfNotNull(include);
18 deleteIfNotNull(name);
19 deleteIfNotNull(contentName);
20 deleteIfNotNull(match);
21 deleteIfNotNull(captures);
22 deleteIfNotNull(begin);
23 deleteIfNotNull(beginCaptures);
25 deleteIfNotNull(endCaptures);
26 deleteIfNotNull(whilePattern);
27 deleteIfNotNull(whileCaptures);
28 deleteIfNotNull(applyEndPatternLast);
30 if (patterns !=
nullptr) {
31 for (IRawRule* rule : *patterns) {
38 deleteIfNotNull(repository);
42IRawRepositoryMap::~IRawRepositoryMap() {
43 for (
auto& pair : rules) {
53 deleteIfNotNull(selfRule);
61IRawRule* IRawRepositoryMap::getRule(
const std::string& name)
const {
62 if (name ==
"$self") {
65 if (name ==
"$base") {
68 auto it = rules.find(name);
69 if (it != rules.end()) {
76IRawGrammar::~IRawGrammar() {
78 deleteIfNotNull(repository);
81 if (patterns !=
nullptr) {
82 for (
size_t i = 0; i < patterns->size(); i++) {
83 delete (*patterns)[i];
89 if (injections !=
nullptr) {
90 for (
auto& pair : *injections) {
97 deleteIfNotNull(injectionSelector);
98 deleteIfNotNull(fileTypes);
99 deleteIfNotNull(name);
100 deleteIfNotNull(firstLineMatch);