public void Visit(JsConditionalCompilationElseIf node)
 {
     // invalid! ignore
     IsValid = false;
 }
Пример #2
0
 public void Visit(JsConditionalCompilationElseIf node)
 {
     // not applicable; terminate
 }
 public void Visit(JsConditionalCompilationElseIf node)
 {
     // starts with a '@elif', so we don't care
 }
 public void Visit(JsConditionalCompilationElseIf node)
 {
     // nothing to do
 }
Пример #5
0
 public void Visit(JsConditionalCompilationElseIf node)
 {
     // invalid! ignore
     IsValid = false;
 }
 public void Visit(JsConditionalCompilationElseIf node)
 {
     // nothing to do
 }
 public void Visit(JsConditionalCompilationElseIf node)
 {
     // preprocessor nodes are handled outside the real JavaScript parsing
 }
Пример #8
0
 public void Visit(JsConditionalCompilationElseIf node)
 {
     // preprocessor nodes are handled outside the real JavaScript parsing
 }
 public void Visit(JsConditionalCompilationElseIf node)
 {
     // not applicable; terminate
 }
        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);
            }
        }
 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 override void Visit(JsConditionalCompilationElseIf node)
        {
            if (node != null)
            {
                // depth-first
                base.Visit(node);

                DoConditionalCompilationElseIf(node);
            }
        }