Skip to content

Commit ac4a45e

Browse files
committed
Renamed semantics to intents; More compact logging
1 parent 821ac82 commit ac4a45e

File tree

9 files changed

+47
-48
lines changed

9 files changed

+47
-48
lines changed

source/Code.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ LANGULUS_RTTI_BOUNDARY(RTTI::MainBoundary)
2121
#define ENABLE_VERBOSE() 0
2222

2323
#define VERBOSE_INNER(...) \
24-
Logger::Flow("Flow::Code: ", Logger::Push, Logger::Cyan, __VA_ARGS__ \
24+
Logger::Flow("Flow::Code: ", Logger::PushCyan, __VA_ARGS__ \
2525
, Logger::Pop, " at ", progress, ": " \
26-
, Logger::NewLine, "+-[", Logger::Push, Logger::Green, Logger::Underline \
27-
, input. LeftOf(progress).Replace('\n', "\\n"), Logger::Pop, Logger::Push, Logger::White \
26+
, Logger::NewLine, "+-[", Logger::PushGreen, Logger::Underline \
27+
, input. LeftOf(progress).Replace('\n', "\\n"), Logger::PopAndPushWhite \
2828
, input.RightOf(progress).Replace('\n', "\\n"), Logger::Pop, ']')
2929

3030
#define PRETTY_ERROR(...) { \
31-
Logger::Error("Flow::Code: ", Logger::Push, Logger::DarkYellow, __VA_ARGS__ \
31+
Logger::Error("Flow::Code: ", Logger::PushDarkYellow, __VA_ARGS__ \
3232
, Logger::Pop, " at ", progress, ": " \
33-
, Logger::NewLine, "+-[", Logger::Push, Logger::DarkYellow, Logger::Underline \
33+
, Logger::NewLine, "+-[", Logger::PushDarkYellow, Logger::Underline \
3434
, input. LeftOf(progress).Replace('\n', "\\n"), Logger::Pop \
3535
, input.RightOf(progress).Replace('\n', "\\n"), ']'); \
3636
LANGULUS_THROW(Flow, "Parse error"); \

source/Code.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ namespace Langulus::Flow
9292
///
9393
/// Concatenation
9494
///
95-
template<class T> requires CT::Codifiable<Desem<T>>
95+
template<class T> requires CT::Codifiable<Deint<T>>
9696
NOD() Code operator + (T&&) const;
9797

98-
template<class T> requires CT::Codifiable<Desem<T>>
98+
template<class T> requires CT::Codifiable<Deint<T>>
9999
Code& operator += (T&&);
100100

101101
template<class T>

source/Code.inl

+2-2
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,15 @@ namespace Langulus::Flow
100100
/// Concatenate two text containers
101101
/// @param rhs - right hand side
102102
/// @return the concatenated text container
103-
template<class T> requires CT::Codifiable<Desem<T>> LANGULUS(INLINED)
103+
template<class T> requires CT::Codifiable<Deint<T>> LANGULUS(INLINED)
104104
Code Code::operator + (T&& rhs) const {
105105
return Text::ConcatInner<Code>(Forward<T>(rhs));
106106
}
107107

108108
/// Concatenate (destructively) text containers
109109
/// @param rhs - right hand side
110110
/// @return a reference to this container
111-
template<class T> requires CT::Codifiable<Desem<T>> LANGULUS(INLINED)
111+
template<class T> requires CT::Codifiable<Deint<T>> LANGULUS(INLINED)
112112
Code& Code::operator += (T&& rhs) {
113113
return Text::ConcatRelativeInner<Code>(Forward<T>(rhs));
114114
}

source/TFactory.hpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,7 @@ namespace Langulus::Flow
125125
ProducedFrom(ProducedFrom&&);
126126
ProducedFrom(T* = nullptr, const Neat& = {});
127127

128-
template<template<class> class S>
129-
requires CT::Semantic<S<Neat>>
128+
template<template<class> class S> requires CT::Intent<S<Neat>>
130129
ProducedFrom(S<ProducedFrom>&&);
131130

132131
void Detach();

source/TFactory.inl

+3-3
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,10 @@ namespace Langulus::Flow
250250
ProducedFrom<T>::ProducedFrom(ProducedFrom&& other)
251251
: ProducedFrom {Move(other)} {}
252252

253-
/// Semantic construction
254-
/// @param other - semantic and element to initialize with
253+
/// Generic construction
254+
/// @param other - intent and element to initialize with
255255
template<class T> template<template<class> class S>
256-
requires CT::Semantic<S<Neat>> LANGULUS(INLINED)
256+
requires CT::Intent<S<Neat>> LANGULUS(INLINED)
257257
ProducedFrom<T>::ProducedFrom(S<ProducedFrom<T>>&& other)
258258
// mProducer intentionally not overwritten
259259
: mDescriptor {S<Neat> {other->mDescriptor}} {}

source/TVerb.inl

+7-7
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ namespace Langulus::Flow
2727
: Verb {Move(other)} {}
2828

2929
/// Generic constructor
30-
/// @param other - the verb/argument and semantic to construct with
30+
/// @param other - the verb/argument and intent to construct with
3131
TEMPLATE() template<CT::Data T1, CT::Data...TN>
3232
requires CT::VerbMakable<T1, TN...> LANGULUS(INLINED)
3333
TME()::TVerb(T1&& t1, TN&&...tn)
@@ -205,7 +205,7 @@ namespace Langulus::Flow
205205

206206
/// Push anything to end of the outputs, satisfying the verb
207207
/// @attention nullptrs are never pushed and don't satisfy verb
208-
/// @param rhs - the data (and semantic) to push
208+
/// @param rhs - the data and intent to push
209209
/// @return a reference to this verb for chaining
210210
TEMPLATE() LANGULUS(INLINED)
211211
VERB& TME()::operator << (CT::UnfoldInsertable auto&& rhs) {
@@ -215,25 +215,25 @@ namespace Langulus::Flow
215215

216216
/// Push anything to the front of the outputs, satisfying the verb
217217
/// @attention nullptrs are never pushed and don't satisfy verb
218-
/// @param rhs - the data (and semantic) to push
218+
/// @param rhs - the data and intent to push
219219
/// @return a reference to this verb for chaining
220220
TEMPLATE() LANGULUS(INLINED)
221221
VERB& TME()::operator >> (CT::UnfoldInsertable auto&& rhs) {
222222
using T = Deref<decltype(rhs)>;
223223
return Verb::operator >> <VERB>(Forward<T>(rhs));
224224
}
225225

226-
/// Merge anything to output's back by a semantic
227-
/// @param rhs - the data (and semantic) to merge
226+
/// Merge anything to output's back, with or without an intent
227+
/// @param rhs - the data and intent to merge
228228
/// @return a reference to this verb for chaining
229229
TEMPLATE() LANGULUS(INLINED)
230230
VERB& TME()::operator <<= (CT::UnfoldInsertable auto&& rhs) {
231231
using T = Deref<decltype(rhs)>;
232232
return Verb::operator <<= <VERB>(Forward<T>(rhs));
233233
}
234234

235-
/// Merge anything to output's front by a semantic
236-
/// @param rhs - the data (and semantic) to merge
235+
/// Merge anything to output's front, with or without an intent
236+
/// @param rhs - the data and intent to merge
237237
/// @return a reference to this verb for chaining
238238
TEMPLATE() LANGULUS(INLINED)
239239
VERB& TME()::operator >>= (CT::UnfoldInsertable auto&& rhs) {

source/Verb.inl

+24-24
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ namespace Langulus::Flow
1515
{
1616

1717
/// Generic constructor
18-
/// @param other - the verb/argument and semantic to construct with
18+
/// @param other - the verb/argument and intent to construct with
1919
template<CT::Data T1, CT::Data...TN>
2020
requires CT::VerbMakable<T1, TN...> LANGULUS(INLINED)
2121
Verb::Verb(T1&& t1, TN&&...tn) {
2222
if constexpr (sizeof...(TN) == 0 and not CT::Array<T1>) {
23-
using S = SemanticOf<decltype(t1)>;
23+
using S = IntentOf<decltype(t1)>;
2424
using T = TypeOf<S>;
2525

2626
if constexpr (CT::VerbBased<T>) {
2727
// Make sure the VMeta is initialized
28-
(void) DesemCast(t1).GetVerb();
28+
(void) DeintCast(t1).GetVerb();
2929
new (this) A::Verb {S::Nest(t1).template Forward<A::Verb>()};
3030
}
3131
else Many::operator = (Forward<T1>(t1));
@@ -34,16 +34,16 @@ namespace Langulus::Flow
3434
}
3535

3636
/// Generic assignment
37-
/// @param rhs - the verb/argument and semantic to assign by
37+
/// @param rhs - the verb/argument and intent to assign by
3838
/// @return a reference to this verb
3939
LANGULUS(INLINED)
4040
Verb& Verb::operator = (CT::VerbAssignable auto&& rhs) {
41-
using S = SemanticOf<decltype(rhs)>;
41+
using S = IntentOf<decltype(rhs)>;
4242
using T = TypeOf<S>;
4343

4444
if constexpr (CT::VerbBased<T>) {
4545
// Make sure the VMeta is initialized
46-
(void) DesemCast(rhs).GetVerb();
46+
(void) DeintCast(rhs).GetVerb();
4747
A::Verb::operator = (S::Nest(rhs).template Forward<A::Verb>());
4848
}
4949
else Many::operator = (S::Nest(rhs));
@@ -71,7 +71,7 @@ namespace Langulus::Flow
7171
CT::UnfoldInsertable auto&& a,
7272
const Charge& charge, VerbState state
7373
) {
74-
using S = SemanticOf<decltype(a)>;
74+
using S = IntentOf<decltype(a)>;
7575
return FromMeta(MetaVerbOf<V>(), S::Nest(a), charge, state);
7676
}
7777

@@ -86,7 +86,7 @@ namespace Langulus::Flow
8686
VMeta verb, CT::UnfoldInsertable auto&& a,
8787
const Charge& charge, VerbState state
8888
) {
89-
using S = SemanticOf<decltype(a)>;
89+
using S = IntentOf<decltype(a)>;
9090
auto result = FromMeta(verb, charge, state);
9191
result.SetArgument(S::Nest(a));
9292
return result;
@@ -418,17 +418,17 @@ namespace Langulus::Flow
418418

419419
/// Push anything to end of the outputs, satisfying the verb
420420
/// @attention nullptrs are never pushed and don't satisfy verb
421-
/// @param rhs - the data (and semantic) to push
421+
/// @param rhs - the data and intent to push
422422
/// @return a reference to this verb for chaining
423423
template<CT::VerbBased THIS> LANGULUS(INLINED)
424424
THIS& Verb::operator << (CT::UnfoldInsertable auto&& rhs) {
425-
using S = SemanticOf<decltype(rhs)>;
425+
using S = IntentOf<decltype(rhs)>;
426426
using T = TypeOf<S>;
427427

428428
if constexpr (not CT::Nullptr<T>) {
429429
if constexpr (CT::PointerRelated<T>) {
430430
// Push a pointer only if valid
431-
if (not DesemCast(rhs))
431+
if (not DeintCast(rhs))
432432
return *reinterpret_cast<THIS*>(this);
433433
}
434434

@@ -441,17 +441,17 @@ namespace Langulus::Flow
441441

442442
/// Push anything to the front of the outputs, satisfying the verb
443443
/// @attention nullptrs are never pushed and don't satisfy verb
444-
/// @param rhs - the data (and semantic) to push
444+
/// @param rhs - the data and intent to push
445445
/// @return a reference to this verb for chaining
446446
template<CT::VerbBased THIS> LANGULUS(INLINED)
447447
THIS& Verb::operator >> (CT::UnfoldInsertable auto&& rhs) {
448-
using S = SemanticOf<decltype(rhs)>;
448+
using S = IntentOf<decltype(rhs)>;
449449
using T = TypeOf<S>;
450450

451451
if constexpr (not CT::Nullptr<T>) {
452452
if constexpr (CT::PointerRelated<T>) {
453453
// Push a pointer only if valid
454-
if (not DesemCast(rhs))
454+
if (not DeintCast(rhs))
455455
return *reinterpret_cast<THIS*>(this);
456456
}
457457

@@ -462,22 +462,22 @@ namespace Langulus::Flow
462462
return *reinterpret_cast<THIS*>(this);
463463
}
464464

465-
/// Merge anything to output's back by a semantic
466-
/// @param rhs - the data (and semantic) to merge
465+
/// Merge anything to output's back, with or without an intent
466+
/// @param rhs - the data and intent to merge
467467
/// @return a reference to this verb for chaining
468468
template<CT::VerbBased THIS> LANGULUS(INLINED)
469469
THIS& Verb::operator <<= (CT::UnfoldInsertable auto&& rhs) {
470-
using S = SemanticOf<decltype(rhs)>;
470+
using S = IntentOf<decltype(rhs)>;
471471
using T = TypeOf<S>;
472472

473473
if constexpr (not CT::Nullptr<T>) {
474474
if constexpr (CT::PointerRelated<TypeOf<S>>) {
475475
// Push a pointer, but check if valid first
476-
if (not DesemCast(rhs))
476+
if (not DeintCast(rhs))
477477
return *reinterpret_cast<THIS*>(this);
478478
}
479479

480-
auto ptr = PointerDecay(DesemCast(rhs));
480+
auto ptr = PointerDecay(DeintCast(rhs));
481481
if (mOutput.Find(ptr))
482482
return *reinterpret_cast<THIS*>(this);
483483

@@ -488,22 +488,22 @@ namespace Langulus::Flow
488488
return *reinterpret_cast<THIS*>(this);
489489
}
490490

491-
/// Merge anything to output's front by a semantic
492-
/// @param rhs - the data (and semantic) to merge
491+
/// Merge anything to output's front, with or without an intent
492+
/// @param rhs - the data and intent to merge
493493
/// @return a reference to this verb for chaining
494494
template<CT::VerbBased THIS> LANGULUS(INLINED)
495495
THIS& Verb::operator >>= (CT::UnfoldInsertable auto&& rhs) {
496-
using S = SemanticOf<decltype(rhs)>;
496+
using S = IntentOf<decltype(rhs)>;
497497
using T = TypeOf<S>;
498498

499499
if constexpr (not CT::Nullptr<T>) {
500500
if constexpr (CT::PointerRelated<TypeOf<S>>) {
501501
// Push a pointer, but check if valid first
502-
if (not DesemCast(rhs))
502+
if (not DeintCast(rhs))
503503
return *reinterpret_cast<THIS*>(this);
504504
}
505505

506-
auto ptr = PointerDecay(DesemCast(rhs));
506+
auto ptr = PointerDecay(DeintCast(rhs));
507507
if (mOutput.Find(ptr))
508508
return *reinterpret_cast<THIS*>(this);
509509

source/verbs/Associate.inl

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ namespace Langulus::Verbs
8484
// Attempt directly refering, if possible
8585
// This will happen only if types are exactly the same
8686
// This is a default (fallback) routine, let's keep things simple
87-
try { lhs.AssignSemantic(Refer(rhs)); }
87+
try { lhs.AssignWithIntent(Refer(rhs)); }
8888
catch (...) { return false; }
8989

9090
// At this point, context has a copy of verb's argument

source/verbs/Do.inl

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ namespace Langulus::Verbs
8585
/// @param verb - the verb/flow to execute
8686
/// @return the Do verb
8787
inline Do Do::In(auto&& context, auto&& verb) {
88-
using CS = SemanticOf<decltype(context)>;
89-
using VS = SemanticOf<decltype(verb)>;
88+
using CS = IntentOf<decltype(context)>;
89+
using VS = IntentOf<decltype(verb)>;
9090
Do v = VS::Nest(verb);
9191
v.SetSource(CS::Nest(context));
9292
return Abandon(v);

0 commit comments

Comments
 (0)