Website Summary Files Commits Branches @commit @diff @stats
path: root / JSImpl / src / Parser.cpp
diff options
context:
space:
mode:
Commit206b1bd6abb5841c5db65270d9ced2f3442ce19b (patch)
Author
 Dimitar Trendafilov <dimitar@coherent-labs.com>
2018-10-06 12:03:42 +0300
Committer
 Martin Dobrev <martindobrev0@gmail.com>
2018-10-06 14:23:46 +0300
Files59c39e65c917ddc758bfc49260186216650d9007 /JSImpl/src/Parser.cpp
IPL-206b1bd6abb5841c5db65270d9ced2f3442ce19b.tar
IPL-206b1bd6abb5841c5db65270d9ced2f3442ce19b.tar.gz
IPL-206b1bd6abb5841c5db65270d9ced2f3442ce19b.zip
Parentf016e92dfd9e340529fac9c7673b333077e8072b (diff)
Started Linux port for JSImpl
- Added genie build script - fixed build with g++
1 files changed, 7 insertions, 7 deletions
-rw-r--r--JSImpl/src/Parser.cpp14
diff --git a/JSImpl/src/Parser.cpp b/JSImpl/src/Parser.cpp
index feb302c..bbde7f1 100644
--- a/JSImpl/src/Parser.cpp
+++ b/JSImpl/src/Parser.cpp
@@ -4,7 +4,7 @@
class Parser
{
public:
- Parser(IPLVector<Token>& tokens, const std::function<void()>& onError = {});
+ Parser(const IPLVector<Token>& tokens, const std::function<void()>& onError = {});
ExpressionPtr Parse();
private:
bool MatchOneOf(IPLVector<TokenType> types);
@@ -56,15 +56,15 @@ private:
ExpressionPtr TopStatement();
Token& Prev() { return m_Tokens[m_Current - 1]; }
- std::function<void()> OnError;
- unsigned m_Current;
IPLVector<Token> m_Tokens;
+ unsigned m_Current;
+ std::function<void()> OnError;
};
-Parser::Parser(IPLVector<Token>& tokens, const std::function<void()>& onError)
+Parser::Parser(const IPLVector<Token>& tokens, const std::function<void()>& onError)
: m_Tokens(tokens)
- , OnError(onError)
, m_Current(0)
+ , OnError(onError)
{
}
@@ -1011,8 +1011,8 @@ ExpressionPtr Parser::TopStatement()
return result;
}
-ExpressionPtr Parse(IPLVector<Token>& tokens, const std::function<void()>& onError)
+ExpressionPtr Parse(const IPLVector<Token>& tokens, const std::function<void()>& onError)
{
Parser p(tokens, onError);
return p.Parse();
-} \ No newline at end of file
+}