当前位置: 首页>>代码示例>>C#>>正文


C# Stringe类代码示例

本文整理汇总了C#中Stringe的典型用法代码示例。如果您正苦于以下问题:C# Stringe类的具体用法?C# Stringe怎么用?C# Stringe使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Stringe类属于命名空间,在下文中一共展示了Stringe类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: REAIfStatement

		public REAIfStatement(Stringe token, RantExpressionAction expr, RantExpressionAction body, RantExpressionAction elseBody = null)
			: base(token)
		{
			_expression = expr;
			_body = body;
            _elseBody = elseBody;
		}
开发者ID:katnapper323,项目名称:Rant,代码行数:7,代码来源:REAIfStatement.cs

示例2: CapsInfer

 private static bool CapsInfer(Interpreter interpreter, Source source, Stringe tagname, TagArg[] args)
 {
     // TODO: Make capsinfer properly infer "first" capitalization given multiple sentences. Currently, it mistakes it for "word" mode.
     var words = Regex.Matches(args[0].GetString(), @"\w+").OfType<Match>().Select(m => m.Value).ToArray();
     int wCount = words.Length;
     int uCount = 0;
     int fwCount = 0;
     bool firstCharIsUpper = false;
     for (int i = 0; i < wCount; i++)
     {
         if (words[i].All(Char.IsUpper))
         {
             uCount++;
         }
         if (Char.IsUpper(words[i][0]))
         {
             fwCount++;
             if (i == 0) firstCharIsUpper = true;
         }
     }
     if (uCount == wCount)
     {
         interpreter.CurrentState.Output.SetCaps(Capitalization.Upper);
     }
     else if (wCount > 1 && fwCount == wCount)
     {
         interpreter.CurrentState.Output.SetCaps(Capitalization.Word);
     }
     else if (firstCharIsUpper)
     {
         interpreter.CurrentState.Output.SetCaps(Capitalization.First);
     }
     return false;
 }
开发者ID:zhangfann,项目名称:Processus,代码行数:34,代码来源:Interpreter.TagFuncs.cs

示例3: RichGreaterThanOperator

		public RichGreaterThanOperator(Stringe origin, bool orEqual = false)
			: base(origin)
		{
			Type = ActionValueType.Boolean;
			_orEqual = orEqual;
            Precedence = 15;
        }
开发者ID:W-h-a-t-s,项目名称:Rant,代码行数:7,代码来源:RichGreaterThanOperator.cs

示例4: REAObjectPropertyAssignment

		public REAObjectPropertyAssignment(Stringe origin, RantExpressionAction nameExp, RantExpressionAction obj, RantExpressionAction value)
			: base(origin)
		{
			Name = nameExp;
			_value = value;
			_object = obj;
		}
开发者ID:katnapper323,项目名称:Rant,代码行数:7,代码来源:REAObjectPropertyAssignment.cs

示例5: TagBlueprint

        public TagBlueprint(Interpreter interpreter, Source source, Stringe name, IEnumerable<Token<TokenType>>[] args = null)
            : base(interpreter)
        {
            Source = source;
            Name = name;

            if (!Interpreter.TagFuncs.TryGetValue(Name.Value.ToLower().Trim(), out _tagDef))
            {
                throw new ManhoodException(Source, Name, "The tag '" + Name.Value + "' does not exist.");
            }

            _tagDef.ValidateArgCount(source, name, args != null ? args.Length : 0);

            if (args == null)
            {
                _args = Enumerable.Empty<TagArg>().ToArray();
            }
            else
            {
                // Insert token arguments into the array, set string args to null.
                _args = args.Select((a, i) => _tagDef.ArgTypes[i] == TagArgType.Tokens ? TagArg.FromTokens(a) : null).ToArray();

                // Queue string arguments on the stack.
                for (int i = 0; i < _tagDef.ArgTypes.Length; i++)
                {
                    if (_tagDef.ArgTypes[i] == TagArgType.Result)
                    {
                        interpreter.PushState(Interpreter.State.CreateDerivedDistinct(source, args[i], interpreter));
                    }
                }
            }
        }
开发者ID:dandrews,项目名称:Manhood,代码行数:32,代码来源:TagBlueprint.cs

示例6: RACallSubroutine

		public RACallSubroutine(Stringe name, string moduleFunctionName = null)
			: base(name)
		{
			if (moduleFunctionName != null)
				_inModule = true;
			_moduleFunctionName = moduleFunctionName;
		}
开发者ID:W-h-a-t-s,项目名称:Rant,代码行数:7,代码来源:RACallSubroutine.cs

示例7: RichList

		public RichList(Stringe origin, List<RichActionBase> items, bool concatSyntax = true)
			: base(origin)
		{
			_items = items;
			Type = ActionValueType.List;
			_concatSyntax = concatSyntax;
		}
开发者ID:W-h-a-t-s,项目名称:Rant,代码行数:7,代码来源:RichList.cs

示例8: SetToken

 internal void SetToken(Stringe token)
 {
     _line = token.Line;
     _col = token.Column;
     _index = token.Offset;
     _length = token.Length;
 }
开发者ID:W-h-a-t-s,项目名称:Rant,代码行数:7,代码来源:RantRuntimeException.cs

示例9: RichIfStatement

		public RichIfStatement(Stringe token, RichActionBase expr, RichActionBase body, RichActionBase elseBody = null)
			: base(token)
		{
			_expression = expr;
			_body = body;
            _elseBody = elseBody;
		}
开发者ID:W-h-a-t-s,项目名称:Rant,代码行数:7,代码来源:RichIfStatement.cs

示例10: RichObjectPropertyAssignment

		public RichObjectPropertyAssignment(Stringe origin, RichActionBase nameExp, RichActionBase obj, RichActionBase value)
			: base(origin)
		{
			Name = nameExp;
			_value = value;
			_object = obj;
		}
开发者ID:W-h-a-t-s,项目名称:Rant,代码行数:7,代码来源:RichObjectPropertyAssignment.cs

示例11: RAFunction

		public RAFunction(Stringe range, RantFunctionInfo funcInfo, List<RantAction> argActions)
			: base(range)
		{
			_funcInfo = funcInfo;
			_argActions = argActions;
			_argc = argActions.Count;
		}
开发者ID:W-h-a-t-s,项目名称:Rant,代码行数:7,代码来源:RAFunction.cs

示例12: Chare

 internal Chare(Stringe source, char c, int offset)
 {
     _src = source;
     _character = c;
     _offset = offset;
     _line = _column = 0;
 }
开发者ID:W-h-a-t-s,项目名称:Rant,代码行数:7,代码来源:Chare.cs

示例13: REAList

		public REAList(Stringe origin, List<RantExpressionAction> items, bool concatSyntax = true)
			: base(origin)
		{
			_items = items;
			Type = ActionValueType.List;
			_concatSyntax = concatSyntax;
		}
开发者ID:katnapper323,项目名称:Rant,代码行数:7,代码来源:REAList.cs

示例14: RichFunctionCall

		public RichFunctionCall(Stringe token, RichActionBase function, RichGroup args, string _sourceName)
			: base(token)
		{
			_function = function;
			List<RichActionBase> argValues = new List<RichActionBase>();
			if (args.Actions.Count > 0)
			{
				RichActionBase lastArg = null;
				for (var i = 0; i < args.Actions.Count; i++)
				{
					var action = args.Actions[i];
                    if (action is RichArgumentSeperator)
                    {
                        if (lastArg == null)
                            throw new RantCompilerException(_sourceName, Range, "Blank argument in function call.");
                        argValues.Add(lastArg);
                    }
                    else
                        lastArg = action;
				}
				argValues.Add(lastArg);
			}
			_argValues = argValues.ToArray();

            Returnable = true;
		}
开发者ID:W-h-a-t-s,项目名称:Rant,代码行数:26,代码来源:RichFunctionCall.cs

示例15: REAWhile

        public REAWhile(Stringe token, RantExpressionAction test, RantExpressionAction body)
            : base(token)
        {
            _test = test;
            _body = body;

            Breakable = true;
        }
开发者ID:katnapper323,项目名称:Rant,代码行数:8,代码来源:REAWhile.cs


注:本文中的Stringe类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。