Exemplo n.º 1
0
        protected void Script()
        {
            string scripttype = Current;
            string endtag     = "END" + scripttype;

            if (!IsScriptType(scripttype))
            {
                throw new ExpectedException("Script Type");
            }

            GetName();
            string scriptname = Current;

            AddVar("$" + scriptname, VarScope.Script);
            emitter.BeginScript(scriptname);

            OptionalNameList();
            Block();

            Consume(endtag);
            emitter.EndScript();

            foreach (Var v in variables.Values.Where(v => v.Scope == VarScope.Temp).ToArray())
            {
                variables.Remove(v.Name);
            }
        }