mirror of
https://codeberg.org/ProgramSnail/lang_2023.git
synced 2025-12-06 06:58:45 +00:00
print & read builtin functions, fixes. execution of programs partially works
This commit is contained in:
parent
27f643dfbc
commit
2556efcaba
16 changed files with 537 additions and 215 deletions
23
include/builtin_functions.hpp
Normal file
23
include/builtin_functions.hpp
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
// for clangd
|
||||
|
||||
namespace info::builtin {
|
||||
|
||||
template<typename T>
|
||||
inline void Print(const T& value) { // only for strings ??
|
||||
std::cout << "\x1b[1;32mOutput:\x1b[0m " << value << '\n';
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline T Read() {
|
||||
T value;
|
||||
std::cout << "\x1b[1;32mInput:\x1b[0m ";
|
||||
std::cin >> value;
|
||||
return value;
|
||||
}
|
||||
|
||||
} // namespace info
|
||||
Loading…
Add table
Add a link
Reference in a new issue