Differences From Artifact [f9c1f3b744698d72]:
- File
polemy/layer.d
- 2010-11-23 10:09:03 - part of checkin [36c517dfc4] on branch trunk - refactored d-value and polemy-value conversion (user: kinaba) [annotate]
To Artifact [59dc790b72d21ee0]:
- File
polemy/layer.d
- 2010-11-23 10:37:54 - part of checkin [5e924caac9] on branch trunk - added AST-rewriting macro sample. (user: kinaba) [annotate]
21 21
22 /// True if it is macro-like layer that basically generates syntax tree 22 /// True if it is macro-like layer that basically generates syntax tree
23 23
24 bool isMacroishLayer( Layer lay ) 24 bool isMacroishLayer( Layer lay )
25 { 25 {
26 return lay==MacroLayer || lay==RawMacroLayer; 26 return lay==MacroLayer || lay==RawMacroLayer;
27 } 27 }
> 28
> 29 unittest
> 30 {
> 31 assert( !isMacroishLayer(SystemLayer) );
> 32 assert( !isMacroishLayer(ValueLayer) );
> 33 assert( isMacroishLayer(MacroLayer) );
> 34 assert( isMacroishLayer(RawMacroLayer) );
> 35 }
28 36
29 /// True if in the specified layer @lay(...) has no effect and merely produces a 37 /// True if in the specified layer @lay(...) has no effect and merely produces a
30 38
31 bool isNoLayerChangeLayer( Layer lay ) 39 bool isNoLayerChangeLayer( Layer lay )
32 { 40 {
33 return lay==RawMacroLayer; 41 return lay==RawMacroLayer;
34 } 42 }
> 43
> 44 unittest
> 45 {
> 46 assert( !isNoLayerChangeLayer(SystemLayer) );
> 47 assert( !isNoLayerChangeLayer(ValueLayer) );
> 48 assert( !isNoLayerChangeLayer(MacroLayer) );
> 49 assert( isNoLayerChangeLayer(RawMacroLayer) );
> 50 }