Changeset View
Changeset View
Standalone View
Standalone View
src/lib/context.cpp
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Line(s) | 43 | { | |||
---|---|---|---|---|---|
44 | m_def = def; | 44 | m_def = def; | ||
45 | } | 45 | } | ||
46 | 46 | | |||
47 | QString Context::name() const | 47 | QString Context::name() const | ||
48 | { | 48 | { | ||
49 | return m_name; | 49 | return m_name; | ||
50 | } | 50 | } | ||
51 | 51 | | |||
52 | QString Context::attribute() const | | |||
53 | { | | |||
54 | return m_attribute; | | |||
55 | } | | |||
56 | | ||||
57 | ContextSwitch Context::lineEndContext() const | 52 | ContextSwitch Context::lineEndContext() const | ||
58 | { | 53 | { | ||
59 | return m_lineEndContext; | 54 | return m_lineEndContext; | ||
60 | } | 55 | } | ||
61 | 56 | | |||
62 | ContextSwitch Context::lineEmptyContext() const | 57 | ContextSwitch Context::lineEmptyContext() const | ||
63 | { | 58 | { | ||
64 | return m_lineEmptyContext; | 59 | return m_lineEmptyContext; | ||
▲ Show 20 Lines • Show All 144 Lines • ▼ Show 20 Line(s) | 181 | for (auto it = m_rules.begin(); it != m_rules.end();) { | |||
209 | } | 204 | } | ||
210 | if (!context) { | 205 | if (!context) { | ||
211 | qCWarning(Log) << "Unable to resolve include rule for definition" << inc->contextName() << "##" << inc->definitionName() << "in" << m_def.definition().name(); | 206 | qCWarning(Log) << "Unable to resolve include rule for definition" << inc->contextName() << "##" << inc->definitionName() << "in" << m_def.definition().name(); | ||
212 | ++it; | 207 | ++it; | ||
213 | continue; | 208 | continue; | ||
214 | } | 209 | } | ||
215 | context->resolveIncludes(); | 210 | context->resolveIncludes(); | ||
216 | if (inc->includeAttribute()) { | 211 | if (inc->includeAttribute()) { | ||
217 | m_attribute = context->attribute(); | 212 | m_attribute = context->m_attribute; | ||
218 | } | 213 | } | ||
219 | it = m_rules.erase(it); | 214 | it = m_rules.erase(it); | ||
220 | foreach (const auto &rule, context->rules()) { | 215 | foreach (const auto &rule, context->rules()) { | ||
221 | it = m_rules.insert(it, rule); | 216 | it = m_rules.insert(it, rule); | ||
222 | ++it; | 217 | ++it; | ||
223 | } | 218 | } | ||
224 | } | 219 | } | ||
225 | 220 | | |||
226 | m_resolveState = Resolved; | 221 | m_resolveState = Resolved; | ||
227 | } | 222 | } | ||
223 | | ||||
224 | void Context::resolveAttributeFormat() | ||||
225 | { | ||||
226 | if (!m_attribute.isEmpty()) { | ||||
227 | m_attributeFormat = formatByName(m_attribute); | ||||
228 | } | ||||
229 | | ||||
230 | foreach (const auto &rule, m_rules) { | ||||
231 | rule->resolveAttributeFormat(this); | ||||
232 | } | ||||
233 | } |