Efficiently tracks (line,column) information as text is added, and collects line mappings between the original and generated source code so we can generate correct debugging information later
Inheritance: System.IO.StringWriter
Esempio n. 1
0
        public SourceUnit GenerateCode(CodeMemberMethod codeDom, LanguageContext context, string path, SourceCodeKind kind)
        {
            ContractUtils.RequiresNotNull(codeDom, nameof(codeDom));
            ContractUtils.RequiresNotNull(context, nameof(context));
            ContractUtils.Requires(path == null || path.Length > 0, nameof(path));

            // Convert the CodeDom to source code
            Writer?.Close();
            Writer = new PositionTrackingWriter();

            WriteFunctionDefinition(codeDom);

            return(CreateSourceUnit(context, path, kind));
        }
Esempio n. 2
0
        public SourceUnit GenerateCode(CodeMemberMethod codeDom, LanguageContext context, string path, SourceCodeKind kind) {
            ContractUtils.RequiresNotNull(codeDom, "codeDom");
            ContractUtils.RequiresNotNull(context, "context");
            ContractUtils.Requires(path == null || path.Length > 0, "path");

            // Convert the CodeDom to source code
            if (_writer != null) {
                _writer.Close();
            }
            _writer = new PositionTrackingWriter();

            WriteFunctionDefinition(codeDom);

            return CreateSourceUnit(context, path, kind);
        }