diff options
Diffstat (limited to 'src/expand/file_line.cpp')
-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); |