Exemple #1
0
        private void HandleElse(Stack <IfDefTruth> ifDefStack)
        {
            IfDefTruth truth = ifDefStack.Pop();

            if (truth == IfDefTruth.InitiallyFalse)
            {
                ifDefStack.Push(IfDefTruth.True);
            }
            else
            {
                ifDefStack.Push(IfDefTruth.ForeverFalse);
            }
        }
Exemple #2
0
        private void HandleElseIf(Stack <IfDefTruth> ifDefStack, string directive, Location location)
        {
            IfDefTruth truth = ifDefStack.Pop();

            if (truth == IfDefTruth.True || truth == IfDefTruth.ForeverFalse)
            {
                ifDefStack.Push(IfDefTruth.ForeverFalse);
            }
            else
            {
                string trimmedDirective = directive.Substring(4);
                if (_compilerDefines.IsTrue(trimmedDirective, location))
                {
                    ifDefStack.Push(IfDefTruth.True);
                }
                else
                {
                    ifDefStack.Push(IfDefTruth.InitiallyFalse);
                }
            }
        }