var searchIndex = {}; searchIndex["syntex_pos"] = {"doc":"The source positions and related helper functions","items":[[3,"Span","syntex_pos","Spans represent a region of code, used for error reporting. Positions in spans\nare *absolute* positions from the beginning of the codemap, not positions\nrelative to FileMaps. Methods on the CodeMap can be used to relate spans back\nto the original source.\nYou must be careful if the span crosses more than one file - you will not be\nable to use many of the functions on spans in codemap and you cannot assume\nthat the length of the span = hi - lo; there may be space in the BytePos\nrange between files.",null,null],[12,"lo","","",0,null],[12,"hi","","",0,null],[12,"expn_id","","Information about where the macro came from, if this piece of\ncode was created by a macro expansion.",0,null],[3,"MultiSpan","","A collection of spans. Spans have two orthogonal attributes:",null,null],[3,"SpanLabel","","",null,null],[12,"span","","The span we are going to include in the final snippet.",1,null],[12,"is_primary","","Is this a primary span? This is the "locus" of the message,\nand is indicated with a `^^^^` underline, versus `----`.",1,null],[12,"label","","What label should we attach to this span (if any)?",1,null],[3,"ExpnId","","",null,null],[12,"0","","",2,null],[3,"MultiByteChar","","Identifies an offset of a multi-byte character in a FileMap",null,null],[12,"pos","","The absolute offset of the character in the CodeMap",3,null],[12,"bytes","","The number of bytes, >=2",3,null],[3,"FileMap","","A single source in the CodeMap.",null,null],[12,"name","","The name of the file that the source came from, source that doesn't\noriginate from files has names between angle brackets by convention,\ne.g. `<anon>`",4,null],[12,"abs_path","","The absolute path of the file that the source came from.",4,null],[12,"src","","The complete source code",4,null],[12,"start_pos","","The start position of this source in the CodeMap",4,null],[12,"end_pos","","The end position of this source in the CodeMap",4,null],[12,"lines","","Locations of lines beginnings in the source code",4,null],[12,"multibyte_chars","","Locations of multi-byte characters in the source code",4,null],[3,"BytePos","","A byte offset. Keep this small (currently 32-bits), as AST contains\na lot of them.",null,null],[12,"0","","",5,null],[3,"CharPos","","A character offset. Because of multibyte utf8 characters, a byte offset\nis not equivalent to a character offset. The CodeMap will convert BytePos\nvalues to CharPos values as necessary.",null,null],[12,"0","","",6,null],[3,"Loc","","A source code location used for error reporting",null,null],[12,"file","","Information about the original source",7,null],[12,"line","","The (1-based) line number",7,null],[12,"col","","The (0-based) column offset",7,null],[3,"LocWithOpt","","A source code location used as the result of lookup_char_pos_adj",null,null],[12,"filename","","",8,null],[12,"line","","",8,null],[12,"col","","",8,null],[12,"file","","",8,null],[3,"FileMapAndLine","","",null,null],[12,"fm","","",9,null],[12,"line","","",9,null],[3,"FileMapAndBytePos","","",null,null],[12,"fm","","",10,null],[12,"pos","","",10,null],[3,"LineInfo","","",null,null],[12,"line_index","","Index of line, starting from 0.",11,null],[12,"start_col","","Column in line where span begins, starting from 0.",11,null],[12,"end_col","","Column in line where span ends, starting from 0, exclusive.",11,null],[3,"FileLines","","",null,null],[12,"file","","",12,null],[12,"lines","","",12,null],[3,"MacroBacktrace","","",null,null],[12,"call_site","","span where macro was applied to generate this code",13,null],[12,"macro_decl_name","","name of macro that was applied (e.g., "foo!" or "#[derive(Eq)]")",13,null],[12,"def_site_span","","span where macro was defined (if known)",13,null],[3,"DistinctSources","","",null,null],[12,"begin","","",14,null],[12,"end","","",14,null],[3,"MalformedCodemapPositions","","",null,null],[12,"name","","",15,null],[12,"source_len","","",15,null],[12,"begin_pos","","",15,null],[12,"end_pos","","",15,null],[4,"SpanLinesError","","",null,null],[13,"IllFormedSpan","","",16,null],[13,"DistinctSources","","",16,null],[4,"SpanSnippetError","","",null,null],[13,"IllFormedSpan","","",17,null],[13,"DistinctSources","","",17,null],[13,"MalformedForCodemap","","",17,null],[13,"SourceNotAvailable","","",17,null],[12,"filename","syntex_pos::SpanSnippetError","",17,null],[5,"mk_sp","syntex_pos","",null,{"inputs":[{"name":"bytepos"},{"name":"bytepos"}],"output":{"name":"span"}}],[6,"FileName","","",null,null],[6,"FileLinesResult","","",null,null],[7,"SPAN_DEBUG","","",null,null],[17,"DUMMY_SP","","",null,null],[17,"COMMAND_LINE_SP","","",null,null],[17,"NO_EXPANSION","","",null,null],[17,"COMMAND_LINE_EXPN","","",null,null],[8,"Pos","","",null,null],[10,"from_usize","","",18,{"inputs":[{"name":"usize"}],"output":{"name":"self"}}],[10,"to_usize","","",18,null],[11,"eq","","",0,null],[11,"ne","","",0,null],[11,"hash","","",0,null],[11,"clone","","",0,null],[11,"clone","","",19,null],[11,"end_point","","Returns a new span representing just the end-point of this span",0,null],[11,"substitute_dummy","","Returns `self` if `self` is not the dummy span, and `other` otherwise.",0,null],[11,"contains","","",0,null],[11,"source_equal","","Return true if the spans are equal with regards to the source text.",0,null],[11,"merge","","Returns `Some(span)`, a union of `self` and `other`, on overlap.",0,null],[11,"trim_start","","Returns `Some(span)`, where the start is trimmed by the end of `other`",0,null],[11,"fmt","","",1,null],[11,"clone","","",1,null],[11,"encode","","",0,null],[11,"decode","","",0,{"inputs":[{"name":"d"}],"output":{"name":"result"}}],[11,"fmt","","",0,null],[11,"new","","",19,{"inputs":[],"output":{"name":"multispan"}}],[11,"from_span","","",19,{"inputs":[{"name":"span"}],"output":{"name":"multispan"}}],[11,"from_spans","","",19,{"inputs":[{"name":"vec"}],"output":{"name":"multispan"}}],[11,"push_span_label","","",19,null],[11,"primary_span","","Selects the first primary span (if any)",19,null],[11,"primary_spans","","Returns all primary spans.",19,null],[11,"span_labels","","Returns the strings to highlight. We always ensure that there\nis an entry for each of the primary spans -- for each primary\nspan P, if there is at least one label with span P, we return\nthose labels (marked as primary). But otherwise we return\n`SpanLabel` instances with empty labels.",19,null],[11,"from","","",19,{"inputs":[{"name":"span"}],"output":{"name":"multispan"}}],[11,"decode","","",2,{"inputs":[{"name":"__d"}],"output":{"name":"result"}}],[11,"encode","","",2,null],[11,"hash","","",2,null],[11,"fmt","","",2,null],[11,"clone","","",2,null],[11,"eq","","",2,null],[11,"ne","","",2,null],[11,"from_u32","","",2,{"inputs":[{"name":"u32"}],"output":{"name":"expnid"}}],[11,"into_u32","","",2,null],[11,"eq","","",3,null],[11,"ne","","",3,null],[11,"decode","","",3,{"inputs":[{"name":"__d"}],"output":{"name":"result"}}],[11,"encode","","",3,null],[11,"clone","","",3,null],[11,"encode","","",4,null],[11,"decode","","",4,{"inputs":[{"name":"d"}],"output":{"name":"result"}}],[11,"fmt","","",4,null],[11,"next_line","","EFFECT: register a start-of-line offset in the\ntable of line-beginnings.\nUNCHECKED INVARIANT: these offsets must be added in the right\norder and must be in the right places; there is shared knowledge\nabout what ends a line between this file and parse.rs\nWARNING: pos param here is the offset relative to start of CodeMap,\nand CodeMap will append a newline when adding a filemap without a newline at the end,\nso the safe way to call this is with value calculated as\nfilemap.start_pos + newline_offset_relative_to_the_start_of_filemap.",4,null],[11,"get_line","","get a line from the list of pre-computed line-beginnings.\nline-number here is 0-based.",4,null],[11,"record_multibyte_char","","",4,null],[11,"is_real_file","","",4,null],[11,"is_imported","","",4,null],[11,"count_lines","","",4,null],[11,"fmt","","",5,null],[11,"cmp","","",5,null],[11,"partial_cmp","","",5,null],[11,"lt","","",5,null],[11,"le","","",5,null],[11,"gt","","",5,null],[11,"ge","","",5,null],[11,"hash","","",5,null],[11,"eq","","",5,null],[11,"ne","","",5,null],[11,"clone","","",5,null],[11,"fmt","","",6,null],[11,"cmp","","",6,null],[11,"partial_cmp","","",6,null],[11,"lt","","",6,null],[11,"le","","",6,null],[11,"gt","","",6,null],[11,"ge","","",6,null],[11,"hash","","",6,null],[11,"eq","","",6,null],[11,"ne","","",6,null],[11,"clone","","",6,null],[11,"from_usize","","",5,{"inputs":[{"name":"usize"}],"output":{"name":"bytepos"}}],[11,"to_usize","","",5,null],[11,"add","","",5,null],[11,"sub","","",5,null],[11,"encode","","",5,null],[11,"decode","","",5,{"inputs":[{"name":"d"}],"output":{"name":"result"}}],[11,"from_usize","","",6,{"inputs":[{"name":"usize"}],"output":{"name":"charpos"}}],[11,"to_usize","","",6,null],[11,"add","","",6,null],[11,"sub","","",6,null],[11,"fmt","","",7,null],[11,"fmt","","",8,null],[11,"fmt","","",9,null],[11,"fmt","","",10,null],[11,"eq","","",11,null],[11,"ne","","",11,null],[11,"fmt","","",11,null],[11,"clone","","",11,null],[11,"fmt","","",16,null],[11,"eq","","",16,null],[11,"ne","","",16,null],[11,"clone","","",16,null],[11,"fmt","","",17,null],[11,"eq","","",17,null],[11,"ne","","",17,null],[11,"clone","","",17,null],[11,"fmt","","",14,null],[11,"eq","","",14,null],[11,"ne","","",14,null],[11,"clone","","",14,null],[11,"fmt","","",15,null],[11,"eq","","",15,null],[11,"ne","","",15,null],[11,"clone","","",15,null]],"paths":[[3,"Span"],[3,"SpanLabel"],[3,"ExpnId"],[3,"MultiByteChar"],[3,"FileMap"],[3,"BytePos"],[3,"CharPos"],[3,"Loc"],[3,"LocWithOpt"],[3,"FileMapAndLine"],[3,"FileMapAndBytePos"],[3,"LineInfo"],[3,"FileLines"],[3,"MacroBacktrace"],[3,"DistinctSources"],[3,"MalformedCodemapPositions"],[4,"SpanLinesError"],[4,"SpanSnippetError"],[8,"Pos"],[3,"MultiSpan"]]}; initSearch(searchIndex);