コード例 #1
0
        public static Field Parse(FormattableString declaration)
        {
            var match = DefinitionCheck.Match(declaration.Format);

            if (!match.Success)
            {
                throw new InvalidOperationException("Bad field declaration");
            }

            return(new Field(match.Groups[6].Value));
        }
コード例 #2
0
        public static Local Parse(FormattableString str)
        {
            var match = DefinitionCheck.Match(str.Format);

            if (!match.Success)
            {
                throw new FormatException("Bad local declaration");
            }

            return(match.Groups[4].Success
                ? new Local(match.Groups[4].Value)
                : new Local(match.Groups[7].Value));
        }