diff options
author | John Hodge (bugs) <tpg@mutabah.net> | 2014-12-03 23:03:30 +0800 |
---|---|---|
committer | John Hodge (bugs) <tpg@mutabah.net> | 2014-12-03 23:03:30 +0800 |
commit | 627a71e3bff7ab13e4a472e2c3da7e917782edd9 (patch) | |
tree | 04cb1f2ed84ca9ad99fa73fc7eb13f55e0e6c2b8 /parse/root.cpp | |
parent | 3801b7afaf6a61bd4ac6d0b6568765852ce3dc75 (diff) | |
download | mrust-627a71e3bff7ab13e4a472e2c3da7e917782edd9.tar.gz |
Hacking in patterns
Diffstat (limited to 'parse/root.cpp')
-rw-r--r-- | parse/root.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/parse/root.cpp b/parse/root.cpp index f78e9c1f..642c538c 100644 --- a/parse/root.cpp +++ b/parse/root.cpp @@ -6,9 +6,8 @@ #include "common.hpp"
#include <cassert>
-AST::Path Parse_Path(TokenStream& lex, bool is_abs, bool generic_ok)
+AST::Path Parse_PathFrom(TokenStream& lex, AST::Path path, bool generic_ok)
{
- AST::Path path;
Token tok;
do
{
@@ -27,6 +26,14 @@ AST::Path Parse_Path(TokenStream& lex, bool is_abs, bool generic_ok) return path;
}
+AST::Path Parse_Path(TokenStream& lex, bool is_abs, bool generic_ok)
+{
+ if( is_abs )
+ return Parse_PathFrom(lex, AST::Path(AST::Path::TagAbsolute()), generic_ok);
+ else
+ return Parse_PathFrom(lex, AST::Path(), generic_ok);
+}
+
static const struct {
const char* name;
enum eCoreType type;
|