From 975167856ed0b11c2ede03c6eb750ca4e4a6a7fc Mon Sep 17 00:00:00 2001 From: Li Jin Date: Tue, 29 Oct 2019 11:25:27 +0800 Subject: complete moon compiler in C++. --- MoonParser/parser.hpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'MoonParser/parser.hpp') diff --git a/MoonParser/parser.hpp b/MoonParser/parser.hpp index a84b9a3..cbf0168 100644 --- a/MoonParser/parser.hpp +++ b/MoonParser/parser.hpp @@ -1,5 +1,4 @@ -#ifndef PARSER_HPP -#define PARSER_HPP +#pragma once //gcc chokes without rule::rule(const rule &), @@ -16,6 +15,8 @@ #include #include +namespace parserlib { + // const str hash helper functions inline constexpr size_t hash(char const* input) { @@ -35,9 +36,6 @@ typedef std::basic_string input; typedef input::iterator input_it; typedef std::wstring_convert> Converter; -namespace parserlib { - - class _private; class _expr; class _context; @@ -66,7 +64,7 @@ public: int m_col; ///null constructor. - pos() {} + pos():m_line(-1),m_col(0) {} /** constructor from input. @param i input. @@ -425,6 +423,3 @@ template T &operator << (T &stream, const input_range &ir) { } //namespace parserlib - - -#endif //PARSER_HPP -- cgit v1.2.3-55-g6feb