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

Method new

std/src/strings.rs:152–173  ·  view source on GitHub ↗

Creates a new instance of the function.

()

Source from the content-addressed store, hash-verified

150impl AscFunction {
151 /// Creates a new instance of the function.
152 pub fn new() -> Rc<Self> {
153 Rc::from(Self {
154 metadata: CallableMetadataBuilder::new("ASC")
155 .with_return_type(ExprType::Integer)
156 .with_syntax(&[(
157 &[SingularArgSyntax::RequiredValue(
158 RequiredValueSyntax { name: Cow::Borrowed("char"), vtype: ExprType::Text },
159 ArgSepSyntax::End,
160 )],
161 None,
162 )])
163 .with_category(CATEGORY)
164 .with_description(
165 "Returns the UTF character code of the input character.
166The input char$ argument is a string that must be 1-character long.
167This is called ASC for historical reasons but supports more than just ASCII characters in this \
168implementation of BASIC.
169See CHR$() for the inverse of this function.",
170 )
171 .build(),
172 })
173 }
174}
175
176impl Callable for AscFunction {

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