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

Function parse_coordinate_value

std/src/gfx/mod.rs:47–52  ·  view source on GitHub ↗

Parses an integer that represents a single coordinate.

(pos: LineCol, i: i32)

Source from the content-addressed store, hash-verified

45
46/// Parses an integer that represents a single coordinate.
47fn parse_coordinate_value(pos: LineCol, i: i32) -> CallResult<i16> {
48 match i16::try_from(i) {
49 Ok(i) => Ok(i),
50 Err(_) => Err(CallError::Syntax(pos, format!("Coordinate {} out of range", i))),
51 }
52}
53
54/// Parses a pair of expressions that represent an (x,y) coordinate pair.
55fn parse_coordinates(scope: &Scope<'_>, xarg: u8, yarg: u8) -> CallResult<PixelsXY> {

Callers 2

parse_coordinateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected