/parsing/d/logicalandexprunit.d
D | 53 lines | 34 code | 11 blank | 8 comment | 5 complexity | 2060ed668793f1d1562158daf98432b9 MD5 | raw file
1/* 2 * expressionunit.d 3 * 4 * This module parses expressions. 5 * 6 */ 7 8module parsing.d.logicalandexprunit; 9 10import parsing.parseunit; 11import parsing.token; 12 13import parsing.d.tokens; 14import parsing.d.nodes; 15 16import parsing.d.orexprunit; 17 18import io.console; 19 20import djehuty; 21 22class LogicalAndExprUnit : ParseUnit { 23 override bool tokenFound(Token current) { 24 switch (current.type) { 25 case DToken.LogicalAnd: 26 if (this.state == 1) { 27 Console.putln("ANDAND"); 28 this.state = 0; 29 break; 30 } 31 32 // Fall through 33 goto default; 34 35 default: 36 lexer.push(current); 37 if (this.state == 1) { 38 // Done. 39 return false; 40 } 41 auto tree = expand!(OrExprUnit)(); 42 this.state = 1; 43 break; 44 } 45 return true; 46 } 47 48protected: 49 string cur_string = ""; 50 51 static const string _common_error_msg = ""; 52 static const string[] _common_error_usages = null; 53}