1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
use r_derive::*;

use crate::callable::core::*;
use crate::object::ExprList;
use crate::{formals, lang::*};

/// Quit
///
/// Quit from the R runtime.
///
/// # In-Language
///
/// ## Usage
///
/// ```custom,{class=r}
/// q()
/// ```
///
/// ## Arguments
///
/// _none_
///
/// ## Examples
///
/// ```custom,{class=r-repl}
/// q()
/// ```
///
#[doc(alias = "q")]
#[builtin(sym = "q")]
#[derive(Debug, Clone, PartialEq)]
pub struct PrimitiveQ;

formals!(PrimitiveQ, "()");

impl Callable for PrimitiveQ {
    fn call(&self, _args: ExprList, _stack: &mut CallStack) -> EvalResult {
        Err(Signal::Condition(Cond::Terminate))
    }
}