mirror of
https://github.com/louisrubet/rpn
synced 2025-01-30 20:34:30 +01:00
Merge branch 'develop' into #268/c++20
This commit is contained in:
commit
5f4d0d7d0f
3 changed files with 19 additions and 0 deletions
|
@ -223,6 +223,7 @@ class Program : public deque<Object*>, public Lexer, public Object {
|
|||
void RpnStrsize();
|
||||
void RpnStrpos();
|
||||
void RpnStrsub();
|
||||
void RpnEndl();
|
||||
|
||||
// test-core
|
||||
void RpnTest();
|
||||
|
|
|
@ -94,3 +94,9 @@ void Program::RpnStrsub() {
|
|||
stack_.push(new String(stack_.value<String>(2).substr(first, len)));
|
||||
stack_.erase(1, 3);
|
||||
}
|
||||
|
||||
/// @brief endline character
|
||||
///
|
||||
void Program::RpnEndl() {
|
||||
stack_.push_front(new String("\n"));
|
||||
}
|
||||
|
|
|
@ -305,3 +305,15 @@
|
|||
-> stack should be "sub"
|
||||
|
||||
`del`
|
||||
|
||||
## endl 1
|
||||
`endl type`
|
||||
|
||||
-> stack should be "string"
|
||||
|
||||
`del`
|
||||
|
||||
## endl 2
|
||||
`endl num`
|
||||
|
||||
-> stack should be 10
|
||||
|
|
Loading…
Add table
Reference in a new issue