MCPcopy Index your code
hub / github.com/endbasic/endbasic / new

Method new

std/src/arrays.rs:76–123  ·  view source on GitHub ↗

Creates a new instance of the function.

()

Source from the content-addressed store, hash-verified

74impl LboundFunction {
75 /// Creates a new instance of the function.
76 pub fn new() -> Rc<Self> {
77 Rc::from(Self {
78 metadata: CallableMetadataBuilder::new("LBOUND")
79 .with_return_type(ExprType::Integer)
80 .with_syntax(&[
81 (
82 &[SingularArgSyntax::RequiredRef(
83 RequiredRefSyntax {
84 name: Cow::Borrowed("array"),
85 require_array: true,
86 define_undefined: false,
87 },
88 ArgSepSyntax::End,
89 )],
90 None,
91 ),
92 (
93 &[
94 SingularArgSyntax::RequiredRef(
95 RequiredRefSyntax {
96 name: Cow::Borrowed("array"),
97 require_array: true,
98 define_undefined: false,
99 },
100 ArgSepSyntax::Exactly(ArgSep::Long),
101 ),
102 SingularArgSyntax::RequiredValue(
103 RequiredValueSyntax {
104 name: Cow::Borrowed("dimension"),
105 vtype: ExprType::Integer,
106 },
107 ArgSepSyntax::End,
108 ),
109 ],
110 None,
111 ),
112 ])
113 .with_category(CATEGORY)
114 .with_description(
115 "Returns the lower bound for the given dimension of the array.
116The lower bound is the smallest available subscript that can be provided to array indexing \
117operations.
118For one-dimensional arrays, the dimension% is optional. For multi-dimensional arrays, the \
119dimension% is a 1-indexed integer.",
120 )
121 .build(),
122 })
123 }
124}
125
126impl Callable for LboundFunction {

Callers

nothing calls this directly

Calls 5

with_descriptionMethod · 0.80
with_categoryMethod · 0.80
with_syntaxMethod · 0.80
with_return_typeMethod · 0.80
buildMethod · 0.45

Tested by

no test coverage detected