本文整理汇总了C#中Span.InsertSpan方法的典型用法代码示例。如果您正苦于以下问题:C# Span.InsertSpan方法的具体用法?C# Span.InsertSpan怎么用?C# Span.InsertSpan使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Span
的用法示例。
在下文中一共展示了Span.InsertSpan方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NoteRange
private Span NoteRange(
Span span,
SourceRange range)
{
if (span == null || range.fileName == null)
return span;
span.WriteLine("{0}{1}", startSourceRange, range);
var subSpan = span.InsertSpan();
span.WriteLine(endSourceRange);
return subSpan;
}
示例2: PushErrorMask
public Span PushErrorMask(Span span, string error)
{
span.WriteLine("{0}{1}", PushErrorMaskString, error);
var subSpan = span.InsertSpan();
span.WriteLine(PopErrorMaskString);
return subSpan;
}
示例3: EmitMethodCPP
public EmitMethodCPP(
EmitClassCPP clazz,
string prefix,
string name,
string cconv,
IEmitType resultType,
Span headerSpan,
Span sourceSpan)
{
_class = clazz;
_name = name;
_cconv = cconv;
_resultType = resultType;
_headerSpan = headerSpan;
_sourceSpan = sourceSpan;
_headerSpan.Write( "static " );
_headerParamsSpan = CreateSignatureSpan(
_name,
_headerSpan);
_headerSpan.WriteLine(";");
_fullName = prefix + _name;
_sourceParamsSpan = CreateSignatureSpan(
prefix + _name,
_sourceSpan);
_sourceSpan.WriteLine();
_sourceSpan.WriteLine("{");
_bodySpan = _sourceSpan.IndentSpan();
_sourceSpan.WriteLine("}");
_thisParameter = (EmitValCPP) AddParameter(
Target.Pointer( clazz ),
"self" );
_entryBlock = new EmitBlockCPP(this, _bodySpan.InsertSpan());
}
示例4: CreateSignatureSpan
private Span CreateSignatureSpan(
string qualifiedName,
Span span )
{
var sigSpan = span.InsertSpan();
if (_resultType != null)
{
sigSpan.Write("{0} ", _resultType);
}
sigSpan.Write("{0} {1}(", _cconv, qualifiedName);
var paramsSpan = sigSpan.IndentSpan();
sigSpan.Write(")");
return paramsSpan;
}
示例5: EmitClassCPP
public EmitClassCPP(
EmitModuleCPP module,
string name,
EmitClassCPP baseClass,
Span headerSpan,
Span sourceSpan)
{
_module = module;
_name = name;
_base = baseClass;
_headerSpan = headerSpan;
_sourceSpan = sourceSpan;
string baseClassString = "";
if (baseClass != null)
baseClassString = string.Format(" : public {0}", baseClass._name);
_headerSpan.WriteLine("class {0}{1}", _name, baseClassString);
_headerSpan.WriteLine("{");
_headerSpan.WriteLine("public:");
_publicSpan = _headerSpan.IndentSpan();
_publicFieldsSpan = _publicSpan.InsertSpan();
_headerSpan.WriteLine("protected:");
_protectedSpan = _headerSpan.IndentSpan();
_headerSpan.WriteLine("public:");
_privateSpan = _headerSpan.IndentSpan();
_headerSpan.WriteLine("};");
_sourceSpan.WriteLine("// {0}", _name);
}