Skip to content

Function argument parameters #37

@b0mbie

Description

@b0mbie

Functions like net.Receive and concommand.Add have function parameters defined in function arguments' descriptions.

The arguments are defined in a bulleted list. Example for callback in concommand.Add in markup:

The function to run when the concommand is executed. Arguments passed are:
* <page>Player</page> ply - The player that ran the concommand. NULL entity if command was entered with the dedicated server console.
* <page>string</page> cmd - The concommand string (if one callback is used for several concommands).
* <page>table</page> args - A table of all string arguments.
* <page>string</page> argStr - The arguments as a string.

This, by hand, could be written as:

--- @param callback fun(ply: Player, cmd: string, args: table, argStr: string) # The function to run when the concommand is executed.

One possible problem with implementing this in the scraper is that the last sentence, Arguments passed are:, is meaningless if included in the argument description, thus it would have to be excluded. So, I think that functions with defined parameters can be hard-coded.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions