private static void TestText( string endLine, string[] strings, int index, int endCount, StatementPosition position ) { var textStatement2StartPos = string.Join( endLine, strings.Take( index ).ToArray() ).Length; var textStatement2EndPos = textStatement2StartPos + strings[index].Length + endCount * endLine.Length - 1; AssertHelper.AssertStatementPosition( textStatement2StartPos, textStatement2EndPos, position ); }
public ApplyStatement( StatementPosition position, string applyMethod, string parameters, string from ) : base(position) { this.applyMethod = applyMethod; this.parameters = parameters; this.from = from; }
public TextStatement( StatementPosition position, string text ) : base(position) { this.text = text; this.lines = ExtractLines( text, out this.cropLastLine ); this.Lines = this.lines.AsReadOnly(); }
public MethodStatement( StatementPosition position, Type returnType, string name, IList<Variable> variables, string code) : base(position) { this.returnType = returnType; this.name = name; this.variables = variables; this.code = code; }
public RuleMethodStatement( StatementPosition position, MatchMethodStatement matchMethodStatement, string name, IList<Variable> variables, IList<RuleStatement> statements) : base(position) { this.matchMethodStatement = matchMethodStatement; this.name = name; this.variables = variables ?? emptyVariableList; this.statements = statements ?? emptyRuleStatementList; if (this.matchMethodStatement != null) this.matchMethodStatement.RuleMethod = this; }
public JoinStatement( StatementPosition position, string @string, AppendType appendType, IList<RuleStatement> statements) : base(position) { this.@string = @string; this.appendType = appendType; this.statements = statements ?? new RuleStatement[0]; foreach (var statement in this.statements) { if (statement is ValueStatement) continue; if (statement is ApplyStatement) continue; if (statement is CallStatement) continue; throw new JoinBuildException( "Can't contain statement of type: " + statement.GetType() ); } }
public RuleClassStatement( StatementPosition position, string name, IList<UsingStatement> usingStatements, IList<RuleClassMethodStatement> ruleMethodStatements) : base(position) { this.name = name; this.usingStatements = usingStatements; this.ruleMethodStatements = ruleMethodStatements ?? emptyRuleMethodStatementList; this.matchMethodGroups = (from statement in this.ruleMethodStatements.OfType<RuleMethodStatement>() group statement by new { statement.Name, Count = statement.Variables != null ? statement.Variables.Count : 0 } into g select new RuleMethodGroup( g )).ToList().AsReadOnly(); }
public Type( StatementPosition position, string typeName, IList<Type> genericParameters ) : base(position) { this.typeName = typeName; this.genericParameters = genericParameters ?? emptyListGenericParameters; }
public Type( StatementPosition position, string typeName, params Type[] genericParameters ) : this(position, typeName, (IList<Type>)genericParameters) { }
public CallStatement( StatementPosition position, string name, string parameters ) : base(position) { this.name = name; this.parameters = parameters; }