summaryrefslogtreecommitdiff
path: root/src/include/span.hpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-05-21 20:10:25 +0800
committerJohn Hodge <tpg@mutabah.net>2016-05-21 20:10:25 +0800
commitad93bc7fda1988e49b4e3a0d85344d7e3dc7df10 (patch)
treed4fee563f881b5a4ab90dfbb7b40be3486d01349 /src/include/span.hpp
parentbe0892fb5cd1442013ee9e761e60294a374f4566 (diff)
downloadmrust-ad93bc7fda1988e49b4e3a0d85344d7e3dc7df10.tar.gz
Parse - Updates for better memory efficiency (hopefully)
Diffstat (limited to 'src/include/span.hpp')
-rw-r--r--src/include/span.hpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/include/span.hpp b/src/include/span.hpp
index e5dd8ccc..f57fa8a9 100644
--- a/src/include/span.hpp
+++ b/src/include/span.hpp
@@ -5,9 +5,10 @@
* include/span.hpp
* - Spans and error handling
*/
-
#pragma once
+#include <rc_string.hpp>
+
enum ErrorType
{
E0000,
@@ -21,22 +22,22 @@ class Position;
struct ProtoSpan
{
- ::std::string filename;
+ RcString filename;
unsigned int start_line;
unsigned int start_ofs;
};
struct Span
{
- ::std::string filename;
+ RcString filename;
unsigned int start_line;
unsigned int start_ofs;
unsigned int end_line;
unsigned int end_ofs;
- Span(::std::string filename, unsigned int start_line, unsigned int start_ofs, unsigned int end_line, unsigned int end_ofs):
- filename(filename),
+ Span(RcString filename, unsigned int start_line, unsigned int start_ofs, unsigned int end_line, unsigned int end_ofs):
+ filename( ::std::move(filename) ),
start_line(start_line),
start_ofs(start_ofs),
end_line(end_line),