diff options
author | John Hodge <tpg@ucc.asn.au> | 2017-03-18 19:01:40 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2017-03-18 19:01:40 +0800 |
commit | fd6e4e7ff613804d7fee5ce0a59cfa55a5ca6176 (patch) | |
tree | 900f7cf5499afd4519f0b869e331b7434ada5575 | |
parent | 3332a8379b7f20173ba5d63fe5ee40e47d57902a (diff) | |
download | mrust-fd6e4e7ff613804d7fee5ce0a59cfa55a5ca6176.tar.gz |
Expand - add column! macro
-rw-r--r-- | src/expand/file_line.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/expand/file_line.cpp b/src/expand/file_line.cpp index a485fe61..8dfb7e6d 100644 --- a/src/expand/file_line.cpp +++ b/src/expand/file_line.cpp @@ -27,6 +27,15 @@ class CExpanderLine: } }; +class CExpanderColumn: + public ExpandProcMacro +{ + ::std::unique_ptr<TokenStream> expand(const Span& sp, const AST::Crate& crate, const ::std::string& ident, const TokenTree& tt, AST::Module& mod) override + { + return box$( TTStreamO(TokenTree(Token((uint64_t)sp.start_ofs, CORETYPE_U32))) ); + } +}; + class CExpanderModulePath: public ExpandProcMacro { @@ -44,5 +53,6 @@ class CExpanderModulePath: STATIC_MACRO("file", CExpanderFile); STATIC_MACRO("line", CExpanderLine); +STATIC_MACRO("column", CExpanderColumn); STATIC_MACRO("module_path", CExpanderModulePath); |