KCL: stdlib macro should now assume all functions use keywords (#7158)

This has been enforced by the parser since #6639, so there's no need for `keywords = true` in every stdlib function anymore.
This commit is contained in:
Adam Chalmers
2025-05-21 16:10:40 -05:00
committed by GitHub
parent 0ea1e9a6da
commit f5c244dbb1
29 changed files with 24 additions and 197 deletions

View File

@ -260,7 +260,6 @@ pub async fn appearance(exec_state: &mut ExecState, args: Args) -> Result<KclVal
/// ```
#[stdlib {
name = "appearance",
keywords = true,
unlabeled_first = true,
args = {
solids = { docs = "The solid(s) whose appearance is being set" },

View File

@ -49,7 +49,6 @@ pub async fn assert(_exec_state: &mut ExecState, args: Args) -> Result<KclValue,
/// ```
#[stdlib{
name = "assertIs",
keywords = true,
unlabeled_first = true,
args = {
actual = { docs = "Value to check. If this is the boolean value true, assert passes. Otherwise it fails." },
@ -75,7 +74,6 @@ async fn inner_assert_is(actual: bool, error: Option<String>, args: &Args) -> Re
/// ```
#[stdlib {
name = "assert",
keywords = true,
unlabeled_first = true,
args = {
actual = { docs = "Value to check. It will be compared with one of the comparison arguments." },

View File

@ -106,7 +106,6 @@ pub async fn union(exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
#[stdlib {
name = "union",
feature_tree_operation = true,
keywords = true,
unlabeled_first = true,
args = {
solids = {docs = "The solids to union."},
@ -232,7 +231,6 @@ pub async fn intersect(exec_state: &mut ExecState, args: Args) -> Result<KclValu
#[stdlib {
name = "intersect",
feature_tree_operation = true,
keywords = true,
unlabeled_first = true,
args = {
solids = {docs = "The solids to intersect."},
@ -352,7 +350,6 @@ pub async fn subtract(exec_state: &mut ExecState, args: Args) -> Result<KclValue
#[stdlib {
name = "subtract",
feature_tree_operation = true,
keywords = true,
unlabeled_first = true,
args = {
solids = {docs = "The solids to use as the base to subtract from."},

View File

@ -53,7 +53,6 @@ pub async fn get_opposite_edge(exec_state: &mut ExecState, args: Args) -> Result
/// ```
#[stdlib {
name = "getOppositeEdge",
keywords = true,
unlabeled_first = true,
args = {
edge = { docs = "The tag of the edge you want to find the opposite edge of." },
@ -137,7 +136,6 @@ pub async fn get_next_adjacent_edge(exec_state: &mut ExecState, args: Args) -> R
/// ```
#[stdlib {
name = "getNextAdjacentEdge",
keywords = true,
unlabeled_first = true,
args = {
edge = { docs = "The tag of the edge you want to find the next adjacent edge of." },
@ -230,7 +228,6 @@ pub async fn get_previous_adjacent_edge(exec_state: &mut ExecState, args: Args)
/// ```
#[stdlib {
name = "getPreviousAdjacentEdge",
keywords = true,
unlabeled_first = true,
args = {
edge = { docs = "The tag of the edge you want to find the previous adjacent edge of." },
@ -318,7 +315,6 @@ pub async fn get_common_edge(exec_state: &mut ExecState, args: Args) -> Result<K
#[stdlib {
name = "getCommonEdge",
feature_tree_operation = false,
keywords = true,
unlabeled_first = false,
args = {
faces = { docs = "The tags of the faces you want to find the common edge between" },

View File

@ -148,7 +148,6 @@ pub async fn extrude(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
#[stdlib {
name = "extrude",
feature_tree_operation = true,
keywords = true,
unlabeled_first = true,
args = {
sketches = { docs = "Which sketch or sketches should be extruded"},

View File

@ -121,7 +121,6 @@ pub async fn loft(exec_state: &mut ExecState, args: Args) -> Result<KclValue, Kc
#[stdlib {
name = "loft",
feature_tree_operation = true,
keywords = true,
unlabeled_first = true,
args = {
sketches = {docs = "Which sketches to loft. Must include at least 2 sketches."},

View File

@ -578,7 +578,6 @@ pub async fn pattern_linear_2d(exec_state: &mut ExecState, args: Args) -> Result
/// ```
#[stdlib {
name = "patternLinear2d",
keywords = true,
unlabeled_first = true,
args = {
sketches = { docs = "The sketch(es) to duplicate" },
@ -742,7 +741,6 @@ pub async fn pattern_linear_3d(exec_state: &mut ExecState, args: Args) -> Result
#[stdlib {
name = "patternLinear3d",
feature_tree_operation = true,
keywords = true,
unlabeled_first = true,
args = {
solids = { docs = "The solid(s) to duplicate" },
@ -939,7 +937,6 @@ pub async fn pattern_circular_2d(exec_state: &mut ExecState, args: Args) -> Resu
/// ```
#[stdlib {
name = "patternCircular2d",
keywords = true,
unlabeled_first = true,
args = {
sketch_set = { docs = "Which sketch(es) to pattern" },
@ -1081,7 +1078,6 @@ pub async fn pattern_circular_3d(exec_state: &mut ExecState, args: Args) -> Resu
#[stdlib {
name = "patternCircular3d",
feature_tree_operation = true,
keywords = true,
unlabeled_first = true,
args = {
solids = { docs = "Which solid(s) to pattern" },

View File

@ -49,7 +49,6 @@ pub async fn segment_end(exec_state: &mut ExecState, args: Args) -> Result<KclVa
/// ```
#[stdlib {
name = "segEnd",
keywords = true,
unlabeled_first = true,
args = {
tag = { docs = "The line segment being queried by its tag"},
@ -94,7 +93,6 @@ pub async fn segment_end_x(exec_state: &mut ExecState, args: Args) -> Result<Kcl
/// ```
#[stdlib {
name = "segEndX",
keywords = true,
unlabeled_first = true,
args = {
tag = { docs = "The line segment being queried by its tag"},
@ -137,7 +135,6 @@ pub async fn segment_end_y(exec_state: &mut ExecState, args: Args) -> Result<Kcl
/// ```
#[stdlib {
name = "segEndY",
keywords = true,
unlabeled_first = true,
args = {
tag = { docs = "The line segment being queried by its tag"},
@ -191,7 +188,6 @@ pub async fn segment_start(exec_state: &mut ExecState, args: Args) -> Result<Kcl
/// ```
#[stdlib {
name = "segStart",
keywords = true,
unlabeled_first = true,
args = {
tag = { docs = "The line segment being queried by its tag"},
@ -236,7 +232,6 @@ pub async fn segment_start_x(exec_state: &mut ExecState, args: Args) -> Result<K
/// ```
#[stdlib {
name = "segStartX",
keywords = true,
unlabeled_first = true,
args = {
tag = { docs = "The line segment being queried by its tag"},
@ -279,7 +274,6 @@ pub async fn segment_start_y(exec_state: &mut ExecState, args: Args) -> Result<K
/// ```
#[stdlib {
name = "segStartY",
keywords = true,
unlabeled_first = true,
args = {
tag = { docs = "The line segment being queried by its tag"},
@ -322,7 +316,6 @@ pub async fn last_segment_x(exec_state: &mut ExecState, args: Args) -> Result<Kc
/// ```
#[stdlib {
name = "lastSegX",
keywords = true,
unlabeled_first = true,
args = {
sketch = { docs = "The sketch whose line segment is being queried"},
@ -369,7 +362,6 @@ pub async fn last_segment_y(exec_state: &mut ExecState, args: Args) -> Result<Kc
/// ```
#[stdlib {
name = "lastSegY",
keywords = true,
unlabeled_first = true,
args = {
sketch = { docs = "The sketch whose line segment is being queried"},
@ -419,7 +411,6 @@ pub async fn segment_length(exec_state: &mut ExecState, args: Args) -> Result<Kc
/// ```
#[stdlib {
name = "segLen",
keywords = true,
unlabeled_first = true,
args = {
tag = { docs = "The line segment being queried by its tag"},
@ -463,7 +454,6 @@ pub async fn segment_angle(exec_state: &mut ExecState, args: Args) -> Result<Kcl
/// ```
#[stdlib {
name = "segAng",
keywords = true,
unlabeled_first = true,
args = {
tag = { docs = "The line segment being queried by its tag"},
@ -565,7 +555,6 @@ pub async fn tangent_to_end(exec_state: &mut ExecState, args: Args) -> Result<Kc
/// ```
#[stdlib {
name = "tangentToEnd",
keywords = true,
unlabeled_first = true,
args = {
tag = { docs = "The line segment being queried by its tag"},

View File

@ -167,7 +167,6 @@ pub async fn circle_three_point(exec_state: &mut ExecState, args: Args) -> Resul
/// ```
#[stdlib {
name = "circleThreePoint",
keywords = true,
unlabeled_first = true,
args = {
sketch_surface_or_group = {docs = "Plane or surface to sketch on."},
@ -324,7 +323,6 @@ pub async fn polygon(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
/// ```
#[stdlib {
name = "polygon",
keywords = true,
unlabeled_first = true,
args = {
sketch_surface_or_group = { docs = "Plane or surface to sketch on" },

View File

@ -133,7 +133,6 @@ fn involute_curve(radius: f64, angle: f64) -> (f64, f64) {
/// ```
#[stdlib {
name = "involuteCircular",
keywords = true,
unlabeled_first = true,
args = {
sketch = { docs = "Which sketch should this path be added to?"},
@ -254,7 +253,6 @@ pub async fn line(exec_state: &mut ExecState, args: Args) -> Result<KclValue, Kc
/// ```
#[stdlib {
name = "line",
keywords = true,
unlabeled_first = true,
args = {
sketch = { docs = "Which sketch should this path be added to?"},
@ -426,7 +424,6 @@ pub async fn x_line(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
/// ```
#[stdlib {
name = "xLine",
keywords = true,
unlabeled_first = true,
args = {
sketch = { docs = "Which sketch should this path be added to?"},
@ -492,7 +489,6 @@ pub async fn y_line(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
/// ```
#[stdlib {
name = "yLine",
keywords = true,
unlabeled_first = true,
args = {
sketch = { docs = "Which sketch should this path be added to?"},
@ -575,7 +571,6 @@ pub async fn angled_line(exec_state: &mut ExecState, args: Args) -> Result<KclVa
/// ```
#[stdlib {
name = "angledLine",
keywords = true,
unlabeled_first = true,
args = {
sketch = { docs = "Which sketch should this path be added to?"},
@ -874,7 +869,6 @@ pub async fn angled_line_that_intersects(exec_state: &mut ExecState, args: Args)
/// ```
#[stdlib {
name = "angledLineThatIntersects",
keywords = true,
unlabeled_first = true,
args = {
sketch = { docs = "Which sketch should this path be added to?"},
@ -1152,7 +1146,6 @@ pub async fn start_sketch_on(exec_state: &mut ExecState, args: Args) -> Result<K
#[stdlib {
name = "startSketchOn",
feature_tree_operation = true,
keywords = true,
unlabeled_first = true,
args = {
plane_or_solid = { docs = "The plane or solid to sketch on"},
@ -1318,7 +1311,6 @@ pub async fn start_profile(exec_state: &mut ExecState, args: Args) -> Result<Kcl
/// ```
#[stdlib {
name = "startProfile",
keywords = true,
unlabeled_first = true,
args = {
sketch_surface = { docs = "What to start the profile on" },
@ -1461,7 +1453,6 @@ pub async fn profile_start_x(exec_state: &mut ExecState, args: Args) -> Result<K
/// ```
#[stdlib {
name = "profileStartX",
keywords = true,
unlabeled_first = true,
args = {
profile = {docs = "Profile whose start is being used"},
@ -1491,7 +1482,6 @@ pub async fn profile_start_y(exec_state: &mut ExecState, args: Args) -> Result<K
/// ```
#[stdlib {
name = "profileStartY",
keywords = true,
unlabeled_first = true,
args = {
profile = {docs = "Profile whose start is being used"},
@ -1524,7 +1514,6 @@ pub async fn profile_start(exec_state: &mut ExecState, args: Args) -> Result<Kcl
/// ```
#[stdlib {
name = "profileStart",
keywords = true,
unlabeled_first = true,
args = {
profile = {docs = "Profile whose start is being used"},
@ -1569,7 +1558,6 @@ pub async fn close(exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
/// ```
#[stdlib {
name = "close",
keywords = true,
unlabeled_first = true,
args = {
sketch = { docs = "The sketch you want to close"},
@ -1679,7 +1667,6 @@ pub async fn arc(exec_state: &mut ExecState, args: Args) -> Result<KclValue, Kcl
/// ```
#[stdlib {
name = "arc",
keywords = true,
unlabeled_first = true,
args = {
sketch = { docs = "Which sketch should this path be added to?" },
@ -1922,7 +1909,6 @@ pub async fn tangential_arc(exec_state: &mut ExecState, args: Args) -> Result<Kc
/// ```
#[stdlib {
name = "tangentialArc",
keywords = true,
unlabeled_first = true,
args = {
sketch = { docs = "Which sketch should this path be added to?"},
@ -2199,7 +2185,6 @@ pub async fn bezier_curve(exec_state: &mut ExecState, args: Args) -> Result<KclV
/// ```
#[stdlib {
name = "bezierCurve",
keywords = true,
unlabeled_first = true,
args = {
sketch = { docs = "Which sketch should this path be added to?"},
@ -2321,7 +2306,6 @@ pub async fn subtract_2d(exec_state: &mut ExecState, args: Args) -> Result<KclVa
#[stdlib {
name = "subtract2d",
feature_tree_operation = true,
keywords = true,
unlabeled_first = true,
args = {
sketch = { docs = "Which sketch should this path be added to?" },

View File

@ -160,7 +160,6 @@ pub async fn sweep(exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
#[stdlib {
name = "sweep",
feature_tree_operation = true,
keywords = true,
unlabeled_first = true,
args = {
sketches = { docs = "The sketch or set of sketches that should be swept in space" },

View File

@ -147,7 +147,6 @@ pub async fn scale(exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
#[stdlib {
name = "scale",
feature_tree_operation = false,
keywords = true,
unlabeled_first = true,
args = {
objects = {docs = "The solid, sketch, or set of solids or sketches to scale."},
@ -378,7 +377,6 @@ pub async fn translate(exec_state: &mut ExecState, args: Args) -> Result<KclValu
#[stdlib {
name = "translate",
feature_tree_operation = false,
keywords = true,
unlabeled_first = true,
args = {
objects = {docs = "The solid, sketch, or set of solids or sketches to move."},
@ -782,7 +780,6 @@ pub async fn rotate(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
#[stdlib {
name = "rotate",
feature_tree_operation = false,
keywords = true,
unlabeled_first = true,
args = {
objects = {docs = "The solid, sketch, or set of solids or sketches to rotate."},