public void Visit(JsConditionalCompilationElseIf node) { // starts with a '@elif', so we don't care }
public void Visit(JsConditionalCompilationElseIf node) { // starts with a '@elif', so we don't care }
public override void Visit(JsConditionalCompilationElseIf node) { if (node != null) { // depth-first base.Visit(node); DoConditionalCompilationElseIf(node); } }
private void DoConditionalCompilationElseIf(JsConditionalCompilationElseIf node) { if (m_parser.Settings.IsModificationAllowed(JsTreeModifications.EvaluateNumericExpressions)) { // if the if-condition is a constant, we can eliminate one of the two branches JsConstantWrapper constantCondition = node.Condition as JsConstantWrapper; if (constantCondition != null) { // instead, replace the condition with a 1 if it's always true or a 0 if it's always false if (constantCondition.IsNotOneOrPositiveZero) { try { node.Condition = new JsConstantWrapper(constantCondition.ToBoolean() ? 1 : 0, JsPrimitiveType.Number, node.Condition.Context, m_parser); } catch (InvalidCastException) { // ignore any invalid cast exceptions } } } } }
public void Visit(JsConditionalCompilationElseIf node) { // invalid! ignore IsValid = false; }
public void Visit(JsConditionalCompilationElseIf node) { // invalid! ignore IsValid = false; }
public void Visit(JsConditionalCompilationElseIf node) { // not applicable; terminate }
public void Visit(JsConditionalCompilationElseIf node) { // not applicable; terminate }
public void Visit(JsConditionalCompilationElseIf node) { // preprocessor nodes are handled outside the real JavaScript parsing }
public void Visit(JsConditionalCompilationElseIf node) { // nothing to do }
public void Visit(JsConditionalCompilationElseIf node) { // nothing to do }
public void Visit(JsConditionalCompilationElseIf node) { // preprocessor nodes are handled outside the real JavaScript parsing }
public void Visit(JsConditionalCompilationElseIf node) { if (node != null) { var symbol = StartSymbol(node); Output("@elif("); MarkSegment(node, null, node.Context); SetContextOutputPosition(node.Context); m_startOfStatement = false; if (node.Condition != null) { node.Condition.Accept(this); } OutputPossibleLineBreak(')'); EndSymbol(symbol); } }