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


C# SourceCode.Matches方法代码示例

本文整理汇总了C#中SourceCode.Matches方法的典型用法代码示例。如果您正苦于以下问题:C# SourceCode.Matches方法的具体用法?C# SourceCode.Matches怎么用?C# SourceCode.Matches使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SourceCode的用法示例。


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

示例1: ConditionMatch

 public override bool ConditionMatch(Token lastToken, SourceCode sourceCode)
 {
     if (lastToken is NewTypeToken || lastToken is TypeFunctionToken)
     {
         // TODO: Fix this problem, as if the method returns a Function, () won't work!
         return false;
     }
     return sourceCode.Matches("(");
 }
开发者ID:iammitch,项目名称:Slimterpreter,代码行数:9,代码来源:RoundBracketBuilder.cs

示例2: GetType

 private ComparisonOperatorToken.OperatorType GetType(ref SourceCode code)
 {
     ComparisonOperatorToken.OperatorType t = ComparisonOperatorToken.OperatorType.Equals;
     if (code.Matches("=="))
     {
         t = ComparisonOperatorToken.OperatorType.Equals;
         code += 2;
     }
     if (code.Matches("!="))
     {
         t = ComparisonOperatorToken.OperatorType.NotEquals;
         code += 2;
     }
     if (code.Matches("<="))
     {
         t = ComparisonOperatorToken.OperatorType.LessThanOrEqual;
         code += 2;
     }
     if (code.Matches("<"))
     {
         t = ComparisonOperatorToken.OperatorType.LessThan;
         code++;
     }
     if (code.Matches(">="))
     {
         t = ComparisonOperatorToken.OperatorType.GreaterThanOrEqual;
         code += 2;
     }
     if (code.Matches(">"))
     {
         t = ComparisonOperatorToken.OperatorType.GreaterThan;
         code++;
     }
     return t;
 }
开发者ID:iammitch,项目名称:Slimterpreter,代码行数:35,代码来源:ComparisonOperatorBuilder.cs

示例3: Build

 public override Token Build(Token lastToken, ScriptEngine engine, Script script, ref SourceCode sourceCode)
 {
     if (sourceCode.Matches("true"))
     {
         sourceCode += 5;
         return new BooleanToken(true);
     }
     else
     {
         sourceCode += 6;
         return new BooleanToken(false);
     }
 }
开发者ID:iammitch,项目名称:Slimterpreter,代码行数:13,代码来源:BooleanBuilder.cs

示例4: Build

 public override Token Build(Token lastToken, ScriptEngine engine, Script script, ref SourceCode sourceCode)
 {
     if (sourceCode.Matches("//"))
     {
         sourceCode += 2;
         sourceCode.NextLine();
     }
     else
     {
         sourceCode += 2;
         sourceCode.SeekToNext("*/");
         sourceCode += 2;
     }
     return new Token.DelayToken();
 }
开发者ID:iammitch,项目名称:Slimterpreter,代码行数:15,代码来源:CommentBuilder.cs

示例5: Build

 public override Token Build(Token lastToken, ScriptEngine engine, Script script, ref SourceCode sourceCode)
 {
     bool plus = sourceCode.Matches("++");
     sourceCode += 2;
     // Check and see if there is already a chunk to "change".
     if (engine.CurrentTokens.Count != 0)
     {
         var tokens = new List<Token>(engine.CurrentTokens);
         engine.CurrentTokens.Clear();
         return new PlusPlusMinusMinusToken(tokens, plus, false);
     }
     else
     {
         // Register with the builder that we need to be ran at the end of this.
         _typeStack.Push(plus);
         engine.WaitForChunkFinish(this);
         return new Token.DelayToken();
     }
     return null;
 }
开发者ID:iammitch,项目名称:Slimterpreter,代码行数:20,代码来源:PlusPlusMinusMinusBuilder.cs

示例6: ConditionMatch

 public override bool ConditionMatch(Token lastToken, SourceCode sourceCode)
 {
     return sourceCode.Matches("typeof");
 }
开发者ID:iammitch,项目名称:Slimterpreter,代码行数:4,代码来源:TypeOfBuilder.cs

示例7: ConditionMatch

 public override bool ConditionMatch(Token lastToken, SourceCode sourceCode)
 {
     return sourceCode.Matches("+") || sourceCode.Matches("-") || sourceCode.Matches("/") ||
            sourceCode.Matches("*") || sourceCode.Matches("%");
 }
开发者ID:iammitch,项目名称:Slimterpreter,代码行数:5,代码来源:MathBuilder.cs

示例8: ConditionMatch

 public override bool ConditionMatch(Token lastToken, SourceCode sourceCode)
 {
     return sourceCode.Matches("true") || sourceCode.Matches("false");
 }
开发者ID:iammitch,项目名称:Slimterpreter,代码行数:4,代码来源:BooleanBuilder.cs

示例9: ConditionMatch

 public override bool ConditionMatch(Token lastToken, SourceCode sourceCode)
 {
     return sourceCode.Matches("==") || sourceCode.Matches("!=") || sourceCode.Matches("<=") ||
            sourceCode.Matches(">=") || sourceCode.Matches(">") || sourceCode.Matches("<");
 }
开发者ID:iammitch,项目名称:Slimterpreter,代码行数:5,代码来源:ComparisonOperatorBuilder.cs

示例10: ConditionMatch

 public override bool ConditionMatch(Token lastToken, SourceCode sourceCode)
 {
     return sourceCode.Matches(_pattern);
 }
开发者ID:iammitch,项目名称:Slimterpreter,代码行数:4,代码来源:ConfigBuilder.cs


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