예제 #1
0
        public static BlockHeaderParser Parse(string h)
        {
            var sh = new BlockHeaderParser();

            if (h.StartsWith("func"))
            {
                sh.Type = SectionType.Function;
                sh.Name = h.Remove(0, 4);
            }
            else if (h.StartsWith("class"))
            {
                sh.Type = SectionType.Class;
                sh.Name = h.Remove(0, 5);
            }
            else
            {
                throw new RuntimeError("unknown type of block");
            }

            return(sh);
        }
예제 #2
0
파일: Section.cs 프로젝트: rajeshwarn/Creek
 public Section()
 {
     Variables = new Dictionary <string, IPropertyObject>();
     Functions = new Dictionary <Function, Action>();
     Header    = new BlockHeaderParser();
 }