Change spans to use byte offsets instead of char offsets

This commit is contained in:
Brian Anderson
2012-11-15 19:37:29 -08:00
parent 8cba337cce
commit 81d20156cd
12 changed files with 161 additions and 89 deletions

View File

@@ -6,7 +6,7 @@ use either::Either;
use diagnostic::span_handler;
use ast_util::{spanned, dummy_spanned};
use parse::comments::{doc_comment_style, strip_doc_comment_decoration};
use codemap::CharPos;
use codemap::BytePos;
// Constructors
export mk_name_value_item_str;
@@ -76,7 +76,7 @@ fn mk_attr(item: @ast::meta_item) -> ast::attribute {
}
fn mk_sugared_doc_attr(text: ~str,
+lo: CharPos, +hi: CharPos) -> ast::attribute {
+lo: BytePos, +hi: BytePos) -> ast::attribute {
let lit = spanned(lo, hi, ast::lit_str(@text));
let attr = {
style: doc_comment_style(text),