示例#1
0
 public TransientCompilationUnit(string /*!*/ sourceCode, PhpSourceFile /*!*/ sourceFile, Encoding /*!*/ encoding, NamingContext namingContext, int line, int column, bool client)
 {
     Debug.Assert(sourceCode != null && sourceFile != null && encoding != null);
     Debug.Assert(!client);
     this.sourceUnit        = new SourceCodeUnit(this, sourceCode, sourceFile, encoding, line, column);
     this.sourceUnit.Naming = namingContext ?? new NamingContext(null, null);    // cant be null
 }
示例#2
0
 public TransientCompilationUnit(string /*!*/ sourceCode, PhpSourceFile /*!*/ sourceFile, Encoding /*!*/ encoding, NamingContext namingContext, int line, int column, bool client)
 {
     Debug.Assert(sourceCode != null && sourceFile != null && encoding != null);
     Debug.Assert(!client);
     this.sourceUnit = new SourceCodeUnit(this, sourceCode, sourceFile, encoding, line, column);
     this.sourceUnit.AddImportedNamespaces(namingContext);
 }
示例#3
0
        /// <summary>
        /// Fills a list by an eval trace starting with an eval of a specified id.
        /// </summary>
        /// <param name="evalId">The id of the eval which to start with.</param>
        /// <param name="result">The list of <see cref="ErrorStackInfo"/> to fill. </param>
        public void GetEvalFullTrace(int evalId, List <ErrorStackInfo> /*!*/ result)
        {
            TransientModule module = GetModule(evalId);

            Debug.Assert(module != null);

            do
            {
                SourceCodeUnit source_unit = module.TransientCompilationUnit.SourceUnit;

                result.Add(new ErrorStackInfo(source_unit.SourceFile.FullPath, module.GetErrorString(),
                                              source_unit.Line, source_unit.Column, false));

                module = module.ContainingModule;
            }while (module != null);
        }