本文整理汇总了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;
}
示例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;
}
示例3: RichGreaterThanOperator
public RichGreaterThanOperator(Stringe origin, bool orEqual = false)
: base(origin)
{
Type = ActionValueType.Boolean;
_orEqual = orEqual;
Precedence = 15;
}
示例4: REAObjectPropertyAssignment
public REAObjectPropertyAssignment(Stringe origin, RantExpressionAction nameExp, RantExpressionAction obj, RantExpressionAction value)
: base(origin)
{
Name = nameExp;
_value = value;
_object = obj;
}
示例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));
}
}
}
}
示例6: RACallSubroutine
public RACallSubroutine(Stringe name, string moduleFunctionName = null)
: base(name)
{
if (moduleFunctionName != null)
_inModule = true;
_moduleFunctionName = moduleFunctionName;
}
示例7: RichList
public RichList(Stringe origin, List<RichActionBase> items, bool concatSyntax = true)
: base(origin)
{
_items = items;
Type = ActionValueType.List;
_concatSyntax = concatSyntax;
}
示例8: SetToken
internal void SetToken(Stringe token)
{
_line = token.Line;
_col = token.Column;
_index = token.Offset;
_length = token.Length;
}
示例9: RichIfStatement
public RichIfStatement(Stringe token, RichActionBase expr, RichActionBase body, RichActionBase elseBody = null)
: base(token)
{
_expression = expr;
_body = body;
_elseBody = elseBody;
}
示例10: RichObjectPropertyAssignment
public RichObjectPropertyAssignment(Stringe origin, RichActionBase nameExp, RichActionBase obj, RichActionBase value)
: base(origin)
{
Name = nameExp;
_value = value;
_object = obj;
}
示例11: RAFunction
public RAFunction(Stringe range, RantFunctionInfo funcInfo, List<RantAction> argActions)
: base(range)
{
_funcInfo = funcInfo;
_argActions = argActions;
_argc = argActions.Count;
}
示例12: Chare
internal Chare(Stringe source, char c, int offset)
{
_src = source;
_character = c;
_offset = offset;
_line = _column = 0;
}
示例13: REAList
public REAList(Stringe origin, List<RantExpressionAction> items, bool concatSyntax = true)
: base(origin)
{
_items = items;
Type = ActionValueType.List;
_concatSyntax = concatSyntax;
}
示例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;
}
示例15: REAWhile
public REAWhile(Stringe token, RantExpressionAction test, RantExpressionAction body)
: base(token)
{
_test = test;
_body = body;
Breakable = true;
}