about summary refs log tree commit diff
path: root/src/libsyntax/codemap.rs
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2014-12-11 01:48:23 +0530
committerManish Goregaokar <manishsmail@gmail.com>2015-01-08 13:40:50 +0530
commit0bd022c893b00e0bb76d84bbbf8ccf7f685aad9c (patch)
tree2661376204e573d7c1e6251f30c70d2a33edfe6d /src/libsyntax/codemap.rs
parentc41cafb10c3e1cd5063bcacd663d0fc17fddc8c3 (diff)
downloadrust-0bd022c893b00e0bb76d84bbbf8ccf7f685aad9c.tar.gz
rust-0bd022c893b00e0bb76d84bbbf8ccf7f685aad9c.zip
libsyntax: add COMMAND_LINE_SP and use it for spans generated from the command line
Diffstat (limited to 'src/libsyntax/codemap.rs')
-rw-r--r--src/libsyntax/codemap.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs
index d1768867f0d..9a422e17bb4 100644
--- a/src/libsyntax/codemap.rs
+++ b/src/libsyntax/codemap.rs
@@ -105,6 +105,11 @@ pub struct Span {
 
 pub const DUMMY_SP: Span = Span { lo: BytePos(0), hi: BytePos(0), expn_id: NO_EXPANSION };
 
+// Generic span to be used for code originating from the command line
+pub const COMMAND_LINE_SP: Span = Span { lo: BytePos(0),
+                                         hi: BytePos(0),
+                                         expn_id: COMMAND_LINE_EXPN };
+
 #[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)]
 pub struct Spanned<T> {
     pub node: T,
@@ -235,6 +240,8 @@ pub struct ExpnInfo {
 pub struct ExpnId(u32);
 
 pub const NO_EXPANSION: ExpnId = ExpnId(-1);
+// For code appearing from the command line
+pub const COMMAND_LINE_EXPN: ExpnId = ExpnId(-2);
 
 impl ExpnId {
     pub fn from_llvm_cookie(cookie: c_uint) -> ExpnId {