daniel-shimon / rpp

Rashi Plus Plus - the new Hebrew scripting language
MIT License
92 stars 6 forks source link

error on install #4

Open kkuivenhoven opened 4 years ago

kkuivenhoven commented 4 years ago

Trying to install on fedora (linux) and this is the error I received:

`[fac@localhost rpp]$ g++ -std=c++17 -O3 src/.h src/.cpp -o rpp src/Interpreter.cpp: In member function ‘virtual Value Interpreter::evaluateBinary(BinaryExpression)’: src/Interpreter.cpp:61:28: error: cannot convert ‘std::shared_ptr’ to ‘Token’ in assignment first->token = binary->op; ^~ src/Interpreter.cpp:63:29: error: cannot convert ‘std::shared_ptr’ to ‘Token’ in assignment second->token = binary->op; ^~ src/Interpreter.cpp:83:78: error: no matching function for call to ‘Interpreter::attributeError(std::shared_ptr&, std::cxx11::string, const char [15])’ attributeError(binary->op, first->toString(), AddOperator); ^ In file included from src/Interpreter.cpp:6: src/Interpreter.h:199:10: note: candidate: ‘void Interpreter::attributeError(Token*, std::cxx11::string, std::cxx11::string)’ void attributeError(Token token, string callee, string name); ^~~~~~ src/Interpreter.h:199:10: note: no known conversion for argument 1 from ‘std::shared_ptr’ to ‘Token’ src/Interpreter.cpp:108:66: error: no matching function for call to ‘Interpreter::createString(std::shared_ptr&, std::cxx11::string)’ return createString(binary->op, new string(value)); ^ In file included from src/Interpreter.cpp:6: src/Interpreter.h:194:12: note: candidate: ‘Value Interpreter::createString(Token, std::__cxx11::string)’ Value createString(Token token, string name); ^~~~ src/Interpreter.h:194:12: note: no known conversion for argument 1 from ‘std::shared_ptr’ to ‘Token’ src/Interpreter.h:195:19: note: candidate: ‘Value Interpreter::createString(std::__cxx11::string)’ inline Value createString(string name) ^~~~ src/Interpreter.h:195:19: note: candidate expects 1 argument, 2 provided src/Interpreter.cpp:116:28: error: no matching function for call to ‘Interpreter::runtimeError(std::shared_ptr&)’ runtimeError(binary->op); ^ In file included from src/Interpreter.cpp:6: src/Interpreter.h:197:10: note: candidate: ‘void Interpreter::runtimeError(std::cxx11::string)’ void runtimeError(string message = "unsupported operator"); ^~~~ src/Interpreter.h:197:10: note: no known conversion for argument 1 from ‘std::shared_ptr’ to ‘std::cxx11::string’ {aka ‘std::cxx11::basic_string’} src/Interpreter.h:204:17: note: candidate: ‘static void Interpreter::runtimeError(Token*, std::cxx11::string)’ static void runtimeError(Token token, string message = "unsupported operator"); ^~~~ src/Interpreter.h:204:17: note: no known conversion for argument 1 from ‘std::shared_ptr’ to ‘Token’ src/main.cpp: In function ‘int _execute(std::__cxx11::string&&, Interpreter&)’: src/main.cpp:27:68: error: no matching function for call to ‘Interpreter::execute(std::vector)’ Value value = interpreter.execute(parser.parse()); ^ In file included from src/main.cpp:6: src/Interpreter.h:180:36: note: candidate: ‘template Value Interpreter::execute(std::vector<Statement>)’ template Value execute(vector<Statement> statements); ^~~ src/Interpreter.h:180:36: note: template argument deduction/substitution failed: src/main.cpp:27:66: note: cannot convert ‘parser.Parser::parse()’ (type ‘std::vector’) to type ‘std::vector<Statement>’ Value* value = interpreter.execute(parser.parse());


src/main.cpp:31:54: error: no matching function for call to ‘Interpreter::execute<false>(std::vector<Statement>)’
             interpreter.execute<false>(parser.parse());
                                                      ^
In file included from src/main.cpp:6:
src/Interpreter.h:180:36: note: candidate: ‘template<bool evaluate> Value* Interpreter::execute(std::vector<Statement*>)’
     template<bool evaluate> Value* execute(vector<Statement*> statements);
                                    ^~~~~~~
src/Interpreter.h:180:36: note:   template argument deduction/substitution failed:
src/main.cpp:31:52: note:   cannot convert ‘parser.Parser::parse()’ (type ‘std::vector<Statement>’) to type ‘std::vector<Statement*>’
             interpreter.execute<false>(parser.parse());
                                        ~~~~~~~~~~~~^~
src/Parser.cpp: In member function ‘Expression* Parser::funktion()’:
src/Parser.cpp:26:43: error: no matching function for call to ‘std::vector<Token*>::push_back(std::shared_ptr<Token>)’
                 arguments.push_back(next());
                                           ^
In file included from /usr/include/c++/8/vector:64,
                 from src/utf8.h:10,
                 from src/Lexer.h:9,
                 from src/Parser.h:9,
                 from src/Parser.cpp:6:
/usr/include/c++/8/bits/stl_vector.h:1074:7: note: candidate: ‘void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = Token*; _Alloc = std::allocator<Token*>; std::vector<_Tp, _Alloc>::value_type = Token*]’
       push_back(const value_type& __x)
       ^~~~~~~~~
/usr/include/c++/8/bits/stl_vector.h:1074:7: note:   no known conversion for argument 1 from ‘std::shared_ptr<Token>’ to ‘Token* const&’
/usr/include/c++/8/bits/stl_vector.h:1090:7: note: candidate: ‘void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = Token*; _Alloc = std::allocator<Token*>; std::vector<_Tp, _Alloc>::value_type = Token*]’
       push_back(value_type&& __x)
       ^~~~~~~~~
/usr/include/c++/8/bits/stl_vector.h:1090:7: note:   no known conversion for argument 1 from ‘std::shared_ptr<Token>’ to ‘Token*&&’
src/Parser.cpp:33:63: error: no matching function for call to ‘FunctionExpression::FunctionExpression(std::shared_ptr<Token>&, std::vector<Token*>&, Statement*&)’
         return new FunctionExpression(token, arguments, action);
                                                               ^
In file included from src/Parser.cpp:6:
src/Parser.h:89:5: note: candidate: ‘FunctionExpression::FunctionExpression(Token*, std::vector<Token*>, Statement*)’
     FunctionExpression(Token* token, vector<Token*> arguments, Statement* action) :
     ^~~~~~~~~~~~~~~~~~
src/Parser.h:89:5: note:   no known conversion for argument 1 from ‘std::shared_ptr<Token>’ to ‘Token*’
src/Parser.h:82:7: note: candidate: ‘FunctionExpression::FunctionExpression(const FunctionExpression&)’
 class FunctionExpression: public Expression
       ^~~~~~~~~~~~~~~~~~
src/Parser.h:82:7: note:   candidate expects 1 argument, 3 provided
src/Parser.h:82:7: note: candidate: ‘FunctionExpression::FunctionExpression(FunctionExpression&&)’
src/Parser.h:82:7: note:   candidate expects 1 argument, 3 provided
src/Parser.cpp: In member function ‘Expression* Parser::unary()’:
src/Parser.cpp:89:50: error: no matching function for call to ‘UnaryExpression::UnaryExpression(std::shared_ptr<Token>&, Expression*&)’
         return new UnaryExpression(op, expression);
                                                  ^
In file included from src/Parser.cpp:6:
src/Parser.h:43:5: note: candidate: ‘UnaryExpression::UnaryExpression(Token*, Expression*)’
     UnaryExpression(Token* op, Expression* expression) : op(op), expression(expression) {};
     ^~~~~~~~~~~~~~~
src/Parser.h:43:5: note:   no known conversion for argument 1 from ‘std::shared_ptr<Token>’ to ‘Token*’
src/Parser.h:37:7: note: candidate: ‘constexpr UnaryExpression::UnaryExpression(const UnaryExpression&)’
 class UnaryExpression: public Expression
       ^~~~~~~~~~~~~~~
src/Parser.h:37:7: note:   candidate expects 1 argument, 2 provided
src/Parser.h:37:7: note: candidate: ‘constexpr UnaryExpression::UnaryExpression(UnaryExpression&&)’
src/Parser.h:37:7: note:   candidate expects 1 argument, 2 provided
src/Parser.cpp: In member function ‘Expression* Parser::call()’:
src/Parser.cpp:118:73: error: no matching function for call to ‘CallExpression::CallExpression(std::shared_ptr<Token>&, Expression*&, std::vector<Expression*>&)’
                     callee = new CallExpression(token, callee, arguments);
                                                                         ^
In file included from src/Parser.cpp:6:
src/Parser.h:78:5: note: candidate: ‘CallExpression::CallExpression(Token*, Expression*, std::vector<Expression*>, bool)’
     CallExpression(Token* token, Expression* callee, vector<Expression*> arguments, bool index = false) :
     ^~~~~~~~~~~~~~
src/Parser.h:78:5: note:   no known conversion for argument 1 from ‘std::shared_ptr<Token>’ to ‘Token*’
src/Parser.h:70:7: note: candidate: ‘CallExpression::CallExpression(const CallExpression&)’
 class CallExpression: public Expression
       ^~~~~~~~~~~~~~
src/Parser.h:70:7: note:   candidate expects 1 argument, 3 provided
src/Parser.h:70:7: note: candidate: ‘CallExpression::CallExpression(CallExpression&&)’
src/Parser.h:70:7: note:   candidate expects 1 argument, 3 provided
src/Parser.cpp:126:96: error: no matching function for call to ‘GetExpression::GetExpression(Expression*&, std::shared_ptr<Token>&, const char [9])’
                     callee = new CallExpression(token, new GetExpression(callee, token, GetItem), arguments, true);
                                                                                                ^
In file included from src/Parser.cpp:6:
src/Parser.h:110:5: note: candidate: ‘GetExpression::GetExpression(Expression*, Token*, std::__cxx11::string)’
     GetExpression(Expression* callee, Token* token, string name = "") :
     ^~~~~~~~~~~~~
src/Parser.h:110:5: note:   no known conversion for argument 2 from ‘std::shared_ptr<Token>’ to ‘Token*’
src/Parser.h:103:7: note: candidate: ‘GetExpression::GetExpression(const GetExpression&)’
 class GetExpression: public Expression
       ^~~~~~~~~~~~~
src/Parser.h:103:7: note:   candidate expects 1 argument, 3 provided
src/Parser.h:103:7: note: candidate: ‘GetExpression::GetExpression(GetExpression&&)’
src/Parser.h:103:7: note:   candidate expects 1 argument, 3 provided
src/Parser.cpp:134:54: error: no matching function for call to ‘GetExpression::GetExpression(Expression*&, std::shared_ptr<Token>)’
             callee = new GetExpression(callee, next());
                                                      ^
In file included from src/Parser.cpp:6:
src/Parser.h:110:5: note: candidate: ‘GetExpression::GetExpression(Expression*, Token*, std::__cxx11::string)’
     GetExpression(Expression* callee, Token* token, string name = "") :
     ^~~~~~~~~~~~~
src/Parser.h:110:5: note:   no known conversion for argument 2 from ‘std::shared_ptr<Token>’ to ‘Token*’
src/Parser.h:103:7: note: candidate: ‘GetExpression::GetExpression(const GetExpression&)’
 class GetExpression: public Expression
       ^~~~~~~~~~~~~
src/Parser.h:103:7: note:   candidate expects 1 argument, 2 provided
src/Parser.h:103:7: note: candidate: ‘GetExpression::GetExpression(GetExpression&&)’
src/Parser.h:103:7: note:   candidate expects 1 argument, 2 provided
src/Parser.cpp: In member function ‘Expression* Parser::primary()’:
src/Parser.cpp:144:44: error: no matching function for call to ‘LiteralExpression::LiteralExpression(std::shared_ptr<Token>)’
         return new LiteralExpression(next());
                                            ^
In file included from src/Parser.cpp:6:
src/Parser.h:51:5: note: candidate: ‘LiteralExpression::LiteralExpression(Token*)’
     LiteralExpression(Token* token) : token(token) {};
     ^~~~~~~~~~~~~~~~~
src/Parser.h:51:5: note:   no known conversion for argument 1 from ‘std::shared_ptr<Token>’ to ‘Token*’
src/Parser.h:46:7: note: candidate: ‘constexpr LiteralExpression::LiteralExpression(const LiteralExpression&)’
 class LiteralExpression: public Expression
       ^~~~~~~~~~~~~~~~~
src/Parser.h:46:7: note:   no known conversion for argument 1 from ‘std::shared_ptr<Token>’ to ‘const LiteralExpression&’
src/Parser.h:46:7: note: candidate: ‘constexpr LiteralExpression::LiteralExpression(LiteralExpression&&)’
src/Parser.h:46:7: note:   no known conversion for argument 1 from ‘std::shared_ptr<Token>’ to ‘LiteralExpression&&’
src/Parser.cpp:147:45: error: no matching function for call to ‘VariableExpression::VariableExpression(std::shared_ptr<Token>)’
         return new VariableExpression(next());
                                             ^
In file included from src/Parser.cpp:6:
src/Parser.h:67:5: note: candidate: ‘VariableExpression::VariableExpression(Token*)’
     VariableExpression(Token* token) : token(token) {};
     ^~~~~~~~~~~~~~~~~~
src/Parser.h:67:5: note:   no known conversion for argument 1 from ‘std::shared_ptr<Token>’ to ‘Token*’
src/Parser.h:62:7: note: candidate: ‘constexpr VariableExpression::VariableExpression(const VariableExpression&)’
 class VariableExpression: public Expression
       ^~~~~~~~~~~~~~~~~~
src/Parser.h:62:7: note:   no known conversion for argument 1 from ‘std::shared_ptr<Token>’ to ‘const VariableExpression&’
src/Parser.h:62:7: note: candidate: ‘constexpr VariableExpression::VariableExpression(VariableExpression&&)’
src/Parser.h:62:7: note:   no known conversion for argument 1 from ‘std::shared_ptr<Token>’ to ‘VariableExpression&&’
src/Parser.cpp: In member function ‘Statement* Parser::tryStatement()’:
src/Parser.cpp:227:79: error: no matching function for call to ‘std::pair<Token*, Statement*>::pair(std::shared_ptr<Token>&, Statement*&)’
             catches.push_back(pair<Token*, Statement*>(identifier, catchAction));
                                                                               ^
In file included from /usr/include/c++/8/bits/stl_algobase.h:64,
                 from /usr/include/c++/8/bits/char_traits.h:39,
                 from /usr/include/c++/8/ios:40,
                 from /usr/include/c++/8/ostream:38,
                 from /usr/include/c++/8/iterator:64,
                 from src/utf8/core.h:31,
                 from src/utf8/checked.h:31,
                 from src/utf8/utfcpp.h:31,
                 from src/utf8.h:8,
                 from src/Lexer.h:9,
                 from src/Parser.h:9,
                 from src/Parser.cpp:6:
/usr/include/c++/8/bits/stl_pair.h:431:9: note: candidate: ‘template<class ... _Args1, long unsigned int ..._Indexes1, class ... _Args2, long unsigned int ..._Indexes2> std::pair<_T1, _T2>::pair(std::tuple<_Args1 ...>&, std::tuple<_Args2 ...>&, std::_Index_tuple<_Indexes1 ...>, std::_Index_tuple<_Indexes2 ...>)’
         pair(tuple<_Args1...>&, tuple<_Args2...>&,
         ^~~~
/usr/include/c++/8/bits/stl_pair.h:431:9: note:   template argument deduction/substitution failed:
src/Parser.cpp:227:79: note:   ‘std::shared_ptr<Token>’ is not derived from ‘std::tuple<_Tps ...>’
             catches.push_back(pair<Token*, Statement*>(identifier, catchAction));
                                                                               ^
In file included from /usr/include/c++/8/bits/stl_algobase.h:64,
                 from /usr/include/c++/8/bits/char_traits.h:39,
                 from /usr/include/c++/8/ios:40,
                 from /usr/include/c++/8/ostream:38,
                 from /usr/include/c++/8/iterator:64,
                 from src/utf8/core.h:31,
                 from src/utf8/checked.h:31,
                 from src/utf8/utfcpp.h:31,
                 from src/utf8.h:8,
                 from src/Lexer.h:9,
                 from src/Parser.h:9,
                 from src/Parser.cpp:6:
/usr/include/c++/8/bits/stl_pair.h:364:9: note: candidate: ‘template<class ... _Args1, class ... _Args2> std::pair<_T1, _T2>::pair(std::piecewise_construct_t, std::tuple<_Args1 ...>, std::tuple<_Args2 ...>)’
         pair(piecewise_construct_t, tuple<_Args1...>, tuple<_Args2...>);
         ^~~~
/usr/include/c++/8/bits/stl_pair.h:364:9: note:   template argument deduction/substitution failed:
src/Parser.cpp:227:79: note:   mismatched types ‘std::tuple<_Tps ...>’ and ‘Statement*’
             catches.push_back(pair<Token*, Statement*>(identifier, catchAction));
                                                                               ^
In file included from /usr/include/c++/8/bits/stl_algobase.h:64,
                 from /usr/include/c++/8/bits/char_traits.h:39,
                 from /usr/include/c++/8/ios:40,
                 from /usr/include/c++/8/ostream:38,
                 from /usr/include/c++/8/iterator:64,
                 from src/utf8/core.h:31,
                 from src/utf8/checked.h:31,
                 from src/utf8/utfcpp.h:31,
                 from src/utf8.h:8,
                 from src/Lexer.h:9,
                 from src/Parser.h:9,
                 from src/Parser.cpp:6:
/usr/include/c++/8/bits/stl_pair.h:359:21: note: candidate: ‘template<class _U1, class _U2, typename std::enable_if<(std::_PCC<((! std::is_same<Token*, _U1>::value) || (! std::is_same<Statement*, _U2>::value)), Token*, Statement*>::_MoveConstructiblePair<_U1, _U2>() && (! std::_PCC<((! std::is_same<Token*, _U1>::value) || (! std::is_same<Statement*, _U2>::value)), Token*, Statement*>::_ImplicitlyMoveConvertiblePair<_U1, _U2>())), bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair(std::pair<_U1, _U2>&&)’
  explicit constexpr pair(pair<_U1, _U2>&& __p)
                     ^~~~
/usr/include/c++/8/bits/stl_pair.h:359:21: note:   template argument deduction/substitution failed:
src/Parser.cpp:227:79: note:   ‘std::shared_ptr<Token>’ is not derived from ‘std::pair<_T1, _T2>’
             catches.push_back(pair<Token*, Statement*>(identifier, catchAction));
                                                                               ^
In file included from /usr/include/c++/8/bits/stl_algobase.h:64,
                 from /usr/include/c++/8/bits/char_traits.h:39,
                 from /usr/include/c++/8/ios:40,
                 from /usr/include/c++/8/ostream:38,
                 from /usr/include/c++/8/iterator:64,
                 from src/utf8/core.h:31,
                 from src/utf8/checked.h:31,
                 from src/utf8/utfcpp.h:31,
                 from src/utf8.h:8,
                 from src/Lexer.h:9,
                 from src/Parser.h:9,
                 from src/Parser.cpp:6:
/usr/include/c++/8/bits/stl_pair.h:349:12: note: candidate: ‘template<class _U1, class _U2, typename std::enable_if<(std::_PCC<((! std::is_same<Token*, _U1>::value) || (! std::is_same<Statement*, _U2>::value)), Token*, Statement*>::_MoveConstructiblePair<_U1, _U2>() && std::_PCC<((! std::is_same<Token*, _U1>::value) || (! std::is_same<Statement*, _U2>::value)), Token*, Statement*>::_ImplicitlyMoveConvertiblePair<_U1, _U2>()), bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair(std::pair<_U1, _U2>&&)’
  constexpr pair(pair<_U1, _U2>&& __p)
            ^~~~
/usr/include/c++/8/bits/stl_pair.h:349:12: note:   template argument deduction/substitution failed:
src/Parser.cpp:227:79: note:   ‘std::shared_ptr<Token>’ is not derived from ‘std::pair<_T1, _T2>’
             catches.push_back(pair<Token*, Statement*>(identifier, catchAction));
                                                                               ^
In file included from /usr/include/c++/8/bits/stl_algobase.h:64,
                 from /usr/include/c++/8/bits/char_traits.h:39,
                 from /usr/include/c++/8/ios:40,
                 from /usr/include/c++/8/ostream:38,
                 from /usr/include/c++/8/iterator:64,
                 from src/utf8/core.h:31,
                 from src/utf8/checked.h:31,
                 from src/utf8/utfcpp.h:31,
                 from src/utf8.h:8,
                 from src/Lexer.h:9,
                 from src/Parser.h:9,
                 from src/Parser.cpp:6:
/usr/include/c++/8/bits/stl_pair.h:339:21: note: candidate: ‘template<class _U1, class _U2, typename std::enable_if<(_MoveConstructiblePair<_U1, _U2>() && (! _ImplicitlyMoveConvertiblePair<_U1, _U2>())), bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair(_U1&&, _U2&&)’
  explicit constexpr pair(_U1&& __x, _U2&& __y)
                     ^~~~
/usr/include/c++/8/bits/stl_pair.h:339:21: note:   template argument deduction/substitution failed:
/usr/include/c++/8/bits/stl_pair.h:338:38: error: no type named ‘type’ in ‘struct std::enable_if<false, bool>’
                          bool>::type=false>
                                      ^~~~~
/usr/include/c++/8/bits/stl_pair.h:330:12: note: candidate: ‘template<class _U1, class _U2, typename std::enable_if<(_MoveConstructiblePair<_U1, _U2>() && _ImplicitlyMoveConvertiblePair<_U1, _U2>()), bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair(_U1&&, _U2&&)’
  constexpr pair(_U1&& __x, _U2&& __y)
            ^~~~
/usr/include/c++/8/bits/stl_pair.h:330:12: note:   template argument deduction/substitution failed:
/usr/include/c++/8/bits/stl_pair.h:329:38: error: no type named ‘type’ in ‘struct std::enable_if<false, bool>’
                          bool>::type=true>
                                      ^~~~
/usr/include/c++/8/bits/stl_pair.h:321:17: note: candidate: ‘template<class _U2, typename std::enable_if<_CopyMovePair<false, Token*, _U2>(), bool>::type <anonymous> > std::pair<_T1, _T2>::pair(const _T1&, _U2&&)’
        explicit pair(const _T1& __x, _U2&& __y)
                 ^~~~
/usr/include/c++/8/bits/stl_pair.h:321:17: note:   template argument deduction/substitution failed:
src/Parser.cpp:227:79: note:   cannot convert ‘identifier’ (type ‘std::shared_ptr<Token>’) to type ‘Token* const&’
             catches.push_back(pair<Token*, Statement*>(identifier, catchAction));
                                                                               ^
In file included from /usr/include/c++/8/bits/stl_algobase.h:64,
                 from /usr/include/c++/8/bits/char_traits.h:39,
                 from /usr/include/c++/8/ios:40,
                 from /usr/include/c++/8/ostream:38,
                 from /usr/include/c++/8/iterator:64,
                 from src/utf8/core.h:31,
                 from src/utf8/checked.h:31,
                 from src/utf8/utfcpp.h:31,
                 from src/utf8.h:8,
                 from src/Lexer.h:9,
                 from src/Parser.h:9,
                 from src/Parser.cpp:6:
/usr/include/c++/8/bits/stl_pair.h:314:18: note: candidate: ‘template<class _U2, typename std::enable_if<_CopyMovePair<true, Token*, _U2>(), bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair(const _T1&, _U2&&)’
        constexpr pair(const _T1& __x, _U2&& __y)
                  ^~~~
/usr/include/c++/8/bits/stl_pair.h:314:18: note:   template argument deduction/substitution failed:
src/Parser.cpp:227:79: note:   cannot convert ‘identifier’ (type ‘std::shared_ptr<Token>’) to type ‘Token* const&’
             catches.push_back(pair<Token*, Statement*>(identifier, catchAction));
                                                                               ^
In file included from /usr/include/c++/8/bits/stl_algobase.h:64,
                 from /usr/include/c++/8/bits/char_traits.h:39,
                 from /usr/include/c++/8/ios:40,
                 from /usr/include/c++/8/ostream:38,
                 from /usr/include/c++/8/iterator:64,
                 from src/utf8/core.h:31,
                 from src/utf8/checked.h:31,
                 from src/utf8/utfcpp.h:31,
                 from src/utf8.h:8,
                 from src/Lexer.h:9,
                 from src/Parser.h:9,
                 from src/Parser.cpp:6:
/usr/include/c++/8/bits/stl_pair.h:307:27: note: candidate: ‘template<class _U1, typename std::enable_if<_MoveCopyPair<false, _U1, Statement*>(), bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair(_U1&&, const _T2&)’
        explicit constexpr pair(_U1&& __x, const _T2& __y)
                           ^~~~
/usr/include/c++/8/bits/stl_pair.h:307:27: note:   template argument deduction/substitution failed:
/usr/include/c++/8/bits/stl_pair.h:306:38: error: no type named ‘type’ in ‘struct std::enable_if<false, bool>’
                          bool>::type=false>
                                      ^~~~~
/usr/include/c++/8/bits/stl_pair.h:300:18: note: candidate: ‘template<class _U1, typename std::enable_if<_MoveCopyPair<true, _U1, Statement*>(), bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair(_U1&&, const _T2&)’
        constexpr pair(_U1&& __x, const _T2& __y)
                  ^~~~
/usr/include/c++/8/bits/stl_pair.h:300:18: note:   template argument deduction/substitution failed:
/usr/include/c++/8/bits/stl_pair.h:299:38: error: no type named ‘type’ in ‘struct std::enable_if<false, bool>’
                          bool>::type=true>
                                      ^~~~
/usr/include/c++/8/bits/stl_pair.h:293:17: note: candidate: ‘constexpr std::pair<_T1, _T2>::pair(std::pair<_T1, _T2>&&) [with _T1 = Token*; _T2 = Statement*]’
       constexpr pair(pair&&) = default;
                 ^~~~
/usr/include/c++/8/bits/stl_pair.h:293:17: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/8/bits/stl_pair.h:292:17: note: candidate: ‘constexpr std::pair<_T1, _T2>::pair(const std::pair<_T1, _T2>&) [with _T1 = Token*; _T2 = Statement*]’
       constexpr pair(const pair&) = default;
                 ^~~~
/usr/include/c++/8/bits/stl_pair.h:292:17: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/8/bits/stl_pair.h:289:21: note: candidate: ‘template<class _U1, class _U2, typename std::enable_if<(std::_PCC<((! std::is_same<Token*, _U1>::value) || (! std::is_same<Statement*, _U2>::value)), Token*, Statement*>::_ConstructiblePair<_U1, _U2>() && (! std::_PCC<((! std::is_same<Token*, _U1>::value) || (! std::is_same<Statement*, _U2>::value)), Token*, Statement*>::_ImplicitlyConvertiblePair<_U1, _U2>())), bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair(const std::pair<_U1, _U2>&)’
  explicit constexpr pair(const pair<_U1, _U2>& __p)
                     ^~~~
/usr/include/c++/8/bits/stl_pair.h:289:21: note:   template argument deduction/substitution failed:
src/Parser.cpp:227:79: note:   ‘std::shared_ptr<Token>’ is not derived from ‘const std::pair<_T1, _T2>’
             catches.push_back(pair<Token*, Statement*>(identifier, catchAction));
                                                                               ^
In file included from /usr/include/c++/8/bits/stl_algobase.h:64,
                 from /usr/include/c++/8/bits/char_traits.h:39,
                 from /usr/include/c++/8/ios:40,
                 from /usr/include/c++/8/ostream:38,
                 from /usr/include/c++/8/iterator:64,
                 from src/utf8/core.h:31,
                 from src/utf8/checked.h:31,
                 from src/utf8/utfcpp.h:31,
                 from src/utf8.h:8,
                 from src/Lexer.h:9,
                 from src/Parser.h:9,
                 from src/Parser.cpp:6:
/usr/include/c++/8/bits/stl_pair.h:280:19: note: candidate: ‘template<class _U1, class _U2, typename std::enable_if<(std::_PCC<((! std::is_same<Token*, _U1>::value) || (! std::is_same<Statement*, _U2>::value)), Token*, Statement*>::_ConstructiblePair<_U1, _U2>() && std::_PCC<((! std::is_same<Token*, _U1>::value) || (! std::is_same<Statement*, _U2>::value)), Token*, Statement*>::_ImplicitlyConvertiblePair<_U1, _U2>()), bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair(const std::pair<_U1, _U2>&)’
         constexpr pair(const pair<_U1, _U2>& __p)
                   ^~~~
/usr/include/c++/8/bits/stl_pair.h:280:19: note:   template argument deduction/substitution failed:
src/Parser.cpp:227:79: note:   ‘std::shared_ptr<Token>’ is not derived from ‘const std::pair<_T1, _T2>’
             catches.push_back(pair<Token*, Statement*>(identifier, catchAction));
                                                                               ^
In file included from /usr/include/c++/8/bits/stl_algobase.h:64,
                 from /usr/include/c++/8/bits/char_traits.h:39,
                 from /usr/include/c++/8/ios:40,
                 from /usr/include/c++/8/ostream:38,
                 from /usr/include/c++/8/iterator:64,
                 from src/utf8/core.h:31,
                 from src/utf8/checked.h:31,
                 from src/utf8/utfcpp.h:31,
                 from src/utf8.h:8,
                 from src/Lexer.h:9,
                 from src/Parser.h:9,
                 from src/Parser.cpp:6:
/usr/include/c++/8/bits/stl_pair.h:258:26: note: candidate: ‘template<class _U1, class _U2, typename std::enable_if<(_ConstructiblePair<_U1, _U2>() && (! _ImplicitlyConvertiblePair<_U1, _U2>())), bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair(const _T1&, const _T2&)’
       explicit constexpr pair(const _T1& __a, const _T2& __b)
                          ^~~~
/usr/include/c++/8/bits/stl_pair.h:258:26: note:   template argument deduction/substitution failed:
src/Parser.cpp:227:79: note:   cannot convert ‘identifier’ (type ‘std::shared_ptr<Token>’) to type ‘Token* const&’
             catches.push_back(pair<Token*, Statement*>(identifier, catchAction));
                                                                               ^
In file included from /usr/include/c++/8/bits/stl_algobase.h:64,
                 from /usr/include/c++/8/bits/char_traits.h:39,
                 from /usr/include/c++/8/ios:40,
                 from /usr/include/c++/8/ostream:38,
                 from /usr/include/c++/8/iterator:64,
                 from src/utf8/core.h:31,
                 from src/utf8/checked.h:31,
                 from src/utf8/utfcpp.h:31,
                 from src/utf8.h:8,
                 from src/Lexer.h:9,
                 from src/Parser.h:9,
                 from src/Parser.cpp:6:
/usr/include/c++/8/bits/stl_pair.h:249:17: note: candidate: ‘template<class _U1, class _U2, typename std::enable_if<(_ConstructiblePair<_U1, _U2>() && _ImplicitlyConvertiblePair<_U1, _U2>()), bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair(const _T1&, const _T2&)’
       constexpr pair(const _T1& __a, const _T2& __b)
                 ^~~~
/usr/include/c++/8/bits/stl_pair.h:249:17: note:   template argument deduction/substitution failed:
src/Parser.cpp:227:79: note:   cannot convert ‘identifier’ (type ‘std::shared_ptr<Token>’) to type ‘Token* const&’
             catches.push_back(pair<Token*, Statement*>(identifier, catchAction));
                                                                               ^
In file included from /usr/include/c++/8/bits/stl_algobase.h:64,
                 from /usr/include/c++/8/bits/char_traits.h:39,
                 from /usr/include/c++/8/ios:40,
                 from /usr/include/c++/8/ostream:38,
                 from /usr/include/c++/8/iterator:64,
                 from src/utf8/core.h:31,
                 from src/utf8/checked.h:31,
                 from src/utf8/utfcpp.h:31,
                 from src/utf8.h:8,
                 from src/Lexer.h:9,
                 from src/Parser.h:9,
                 from src/Parser.cpp:6:
/usr/include/c++/8/bits/stl_pair.h:231:26: note: candidate: ‘template<class _U1, class _U2, typename std::enable_if<std::__and_<std::is_default_constructible<_Tp>, std::is_default_constructible<_U2>, std::__not_<std::__and_<std::__is_implicitly_default_constructible<_U1>, std::__is_implicitly_default_constructible<_U2> > > >::value, bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair()’
       explicit constexpr pair()
                          ^~~~
/usr/include/c++/8/bits/stl_pair.h:231:26: note:   template argument deduction/substitution failed:
src/Parser.cpp:227:79: note:   candidate expects 0 arguments, 2 provided
             catches.push_back(pair<Token*, Statement*>(identifier, catchAction));
                                                                               ^
In file included from /usr/include/c++/8/bits/stl_algobase.h:64,
                 from /usr/include/c++/8/bits/char_traits.h:39,
                 from /usr/include/c++/8/ios:40,
                 from /usr/include/c++/8/ostream:38,
                 from /usr/include/c++/8/iterator:64,
                 from src/utf8/core.h:31,
                 from src/utf8/checked.h:31,
                 from src/utf8/utfcpp.h:31,
                 from src/utf8.h:8,
                 from src/Lexer.h:9,
                 from src/Parser.h:9,
                 from src/Parser.cpp:6:
/usr/include/c++/8/bits/stl_pair.h:218:26: note: candidate: ‘template<class _U1, class _U2, typename std::enable_if<std::__and_<std::__is_implicitly_default_constructible<_U1>, std::__is_implicitly_default_constructible<_U2> >::value, bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair()’
       _GLIBCXX_CONSTEXPR pair()
                          ^~~~
/usr/include/c++/8/bits/stl_pair.h:218:26: note:   template argument deduction/substitution failed:
src/Parser.cpp:227:79: note:   candidate expects 0 arguments, 2 provided
             catches.push_back(pair<Token*, Statement*>(identifier, catchAction));
                                                                               ^
src/Parser.cpp: In member function ‘Statement* Parser::commandStatement(bool)’:
src/Parser.cpp:280:47: error: no matching function for call to ‘CommandStatement::CommandStatement(std::shared_ptr<Token>&, Expression*&)’
     return new CommandStatement(command, value);
                                               ^
In file included from src/Parser.cpp:6:
src/Parser.h:146:5: note: candidate: ‘CommandStatement::CommandStatement(Token*, Expression*)’
     CommandStatement(Token* command, Expression* expression): command(command), expression(expression) {};
     ^~~~~~~~~~~~~~~~
src/Parser.h:146:5: note:   no known conversion for argument 1 from ‘std::shared_ptr<Token>’ to ‘Token*’
src/Parser.h:140:7: note: candidate: ‘constexpr CommandStatement::CommandStatement(const CommandStatement&)’
 class CommandStatement : public Statement
       ^~~~~~~~~~~~~~~~
src/Parser.h:140:7: note:   candidate expects 1 argument, 2 provided
src/Parser.h:140:7: note: candidate: ‘constexpr CommandStatement::CommandStatement(CommandStatement&&)’
src/Parser.h:140:7: note:   candidate expects 1 argument, 2 provided
src/Parser.cpp: In member function ‘Statement* Parser::blockStatement(bool)’:
src/Parser.cpp:285:42: error: conversion from ‘vector<Statement>’ to non-scalar type ‘vector<Statement*>’ requested
     vector<Statement*> statements = parse();
                                     ~~~~~^~
src/Parser.cpp: In member function ‘Statement* Parser::defStatement()’:
src/Parser.cpp:313:43: error: no matching function for call to ‘AssignStatement::AssignStatement(std::shared_ptr<Token>&, Expression*&)’
     return new AssignStatement(name, value);
                                           ^
In file included from src/Parser.cpp:6:
src/Parser.h:176:5: note: candidate: ‘AssignStatement::AssignStatement(Token*, Expression*)’
     AssignStatement(Token* identifier, Expression* value): token(identifier), value(value) {};
     ^~~~~~~~~~~~~~~
src/Parser.h:176:5: note:   no known conversion for argument 1 from ‘std::shared_ptr<Token>’ to ‘Token*’
src/Parser.h:170:7: note: candidate: ‘constexpr AssignStatement::AssignStatement(const AssignStatement&)’
 class AssignStatement : public Statement
       ^~~~~~~~~~~~~~~
src/Parser.h:170:7: note:   candidate expects 1 argument, 2 provided
src/Parser.h:170:7: note: candidate: ‘constexpr AssignStatement::AssignStatement(AssignStatement&&)’
src/Parser.h:170:7: note:   candidate expects 1 argument, 2 provided
src/Parser.cpp: In member function ‘Statement* Parser::classStatement()’:
src/Parser.cpp:320:43: error: no matching function for call to ‘AssignStatement::AssignStatement(std::shared_ptr<Token>&, Expression*&)’
     return new AssignStatement(name, value);
                                           ^
In file included from src/Parser.cpp:6:
src/Parser.h:176:5: note: candidate: ‘AssignStatement::AssignStatement(Token*, Expression*)’
     AssignStatement(Token* identifier, Expression* value): token(identifier), value(value) {};
     ^~~~~~~~~~~~~~~
src/Parser.h:176:5: note:   no known conversion for argument 1 from ‘std::shared_ptr<Token>’ to ‘Token*’
src/Parser.h:170:7: note: candidate: ‘constexpr AssignStatement::AssignStatement(const AssignStatement&)’
 class AssignStatement : public Statement
       ^~~~~~~~~~~~~~~
src/Parser.h:170:7: note:   candidate expects 1 argument, 2 provided
src/Parser.h:170:7: note: candidate: ‘constexpr AssignStatement::AssignStatement(AssignStatement&&)’
src/Parser.h:170:7: note:   candidate expects 1 argument, 2 provided
src/Parser.cpp: In member function ‘Statement* Parser::forStatement()’:
src/Parser.cpp:332:59: error: no matching function for call to ‘ForStatement::ForStatement(std::shared_ptr<Token>&, Expression*&, Statement*&)’
             return new ForStatement(name, iterator, action);
                                                           ^
In file included from src/Parser.cpp:6:
src/Parser.h:211:5: note: candidate: ‘ForStatement::ForStatement(Token*, Expression*, Statement*)’
     ForStatement(Token* name, Expression* iterator, Statement* action) :
     ^~~~~~~~~~~~
src/Parser.h:211:5: note:   no known conversion for argument 1 from ‘std::shared_ptr<Token>’ to ‘Token*’
src/Parser.h:204:7: note: candidate: ‘constexpr ForStatement::ForStatement(const ForStatement&)’
 class ForStatement : public Statement
       ^~~~~~~~~~~~
src/Parser.h:204:7: note:   candidate expects 1 argument, 3 provided
src/Parser.h:204:7: note: candidate: ‘constexpr ForStatement::ForStatement(ForStatement&&)’
src/Parser.h:204:7: note:   candidate expects 1 argument, 3 provided
src/Parser.cpp: In member function ‘Expression* Parser::parseBinary(std::function<Expression*()>, std::initializer_list<_TokenType>)’:
src/Parser.cpp:401:65: error: cannot bind rvalue reference of type ‘std::shared_ptr<Token>&&’ to lvalue of type ‘std::shared_ptr<Token>’
         expression = new BinaryExpression(expression, op, second);
                                                                 ^
In file included from src/Parser.cpp:6:
src/Parser.h:34:5: note:   initializing argument 2 of ‘BinaryExpression::BinaryExpression(Expression*, std::shared_ptr<Token>&&, Expression*)’
     BinaryExpression(Expression* first, shared_ptr<Token>&& op, Expression* second) : first(first), op(op), second(second) {};
     ^~~~~~~~~~~~~~~~
src/Parser.cpp: At global scope:
src/Parser.cpp:408:20: error: no declaration matches ‘std::vector<Statement*> Parser::parse()’
 vector<Statement*> Parser::parse() {
                    ^~~~~~
In file included from src/Parser.cpp:6:
src/Parser.h:293:23: note: candidate is: ‘std::vector<Statement> Parser::parse()’
     vector<Statement> parse();
                       ^~~~~
src/Parser.h:247:7: note: ‘class Parser’ defined here
 class Parser
       ^~~~~~
`
kkuivenhoven commented 4 years ago

It appears to me that there are dependencies that need to be installed. If you could be so kind as to list them, that'd be great :)

Also, I am on Fedora 29.

kkuivenhoven commented 4 years ago

Also tried installing on my mac and ran into similar issues.

kkuivenhoven commented 4 years ago

Ah okay. So I tried checking out different commits (on Fedora 29 - linux) and none of those compiled either. @daniel-shimon @itaysabato

daniel-shimon commented 3 years ago

Hi, haven't been here for a while 😅 Could you try compiling on master now according to the new compilation instructions (using cmake)?

kkuivenhoven commented 3 years ago

Okay! What do I do after I clone it? I tried the following commands (separately): cmake .. gcc .. while in the rpp/ folder. I'm also on a mac.

daniel-shimon commented 3 years ago

Like it says in the readme:

mkdir build
​cd​ build
cmake ..
make

Make sure you're on the latest version of the project

kkuivenhoven commented 3 years ago

Alright! I cloned the link and did the commands as instructed. I did get an error though which I'm not sure what's going on. My computer is also older too. A 2016 mac (currently running macOS Sierra - version 10.12.6) so I'm not sure if that's the problem or not.

Screen Shot 2021-03-22 at 9 46 59 PM Screen Shot 2021-03-22 at 9 46 22 PM
daniel-shimon commented 3 years ago

Ok so apparently compiling static binaries isn't supported on MacOs! To fix this we need to avoid setting -static in the CmakeLists.txtfile when compiling on macos. https://stackoverflow.com/a/41026154/7339373 seems to be how to check whether we're in macos in cmake. You're welcome to make a pr! And you can just delete the -staticline in the cmake file and try compiling again :)

kkuivenhoven commented 3 years ago

That seemed to work! Thank you! I am assuming the below screen shot is the intended behavior.

Screen Shot 2021-03-25 at 6 17 21 PM
kkuivenhoven commented 3 years ago

I removed the entire folder and started from scratch (cloning repo). I submitted a PR with the changes made to CMakeLists.txt. The PR also shows which warnings pop up - I'm not sure if these warnings are normal to see. Thank you so much for all your help, Daniel.

kkuivenhoven commented 3 years ago

Okay, so I'm trying to use the interactive console and I'm typing up the example you have and this is what I get:

Screen Shot 2021-03-25 at 6 32 37 PM