Scot.Massie.Calls
2.0.0
Prefix Reserved
dotnet add package Scot.Massie.Calls --version 2.0.0
NuGet\Install-Package Scot.Massie.Calls -Version 2.0.0
<PackageReference Include="Scot.Massie.Calls" Version="2.0.0" />
<PackageVersion Include="Scot.Massie.Calls" Version="2.0.0" />
<PackageReference Include="Scot.Massie.Calls" />
paket add Scot.Massie.Calls --version 2.0.0
#r "nuget: Scot.Massie.Calls, 2.0.0"
#:package Scot.Massie.Calls@2.0.0
#addin nuget:?package=Scot.Massie.Calls&version=2.0.0
#tool nuget:?package=Scot.Massie.Calls&version=2.0.0
Massie Calls
A small library for saving, loading, and handling the a call-like syntax, in the form of Name, Name(Args),
Name[Annotations], or Name[Annotations](Args).
How to install
From Nuget
Include the package Scot.Massie.Calls
From Github
- Go to https://github.com/c-massie/Massie-Calls/releases
- Download the latest
.dllversion of the library and the accompanying.xmlfile, containing documentation for the library. Place them together in the same desired directory. - Right-click the project you want to add this to, go to
Add Reference...in VS,Add... > Add Reference...in Rider. - Click the "Add from..."/"Browse" button in the window that opens, and navigate to the .dll file downloaded.
How to use
Create a new CallNode with the constructors, or by passing the string representation of one in the appropriate format
to its static parse methods. (Parse(string) or TryParse(string, out CallNode))
ToString() provides a string representation of a call, which can be parsed.
Format
The call format looks like this: Label: Name[Annotations](Args), where:
- "Label" is a prefix to the name.
- "Name" is the name of the node.
- "Annotations" is a comma-separated list of inner nodes, enclosed in square brackets.
- "Args" is a comma-separated list of inner nodes, enclosed in round brackets.
- The colon and the text before it may be omitted altogether to indicate a lack of a label.
- The square brackets may be omitted altogether to indicate a lack of annotations.
- The round brackets may be omitted altogether to indicate a lack of arguments.
The label and name may be enclosed in quotation marks. (e.g. "Name", "Name"(Args), or "Label": Name)
Special characters
- Brackets, square brackets, commas, and backslashes (
()[],\) must be preceded by a backslash to count as the literal characters rather than their syntactical meaning. - Quotes (
") must always be preceded by a backlash to count as the literal quote character. - Colons (
:) must be preceded by a backslash to count as a literal character in labels, or in unlabelled names. They may be left unescaped in named that have labelled. - Non-space whitespace must be represented with the following escape sequences:
\nfor newlines.\rfor carriage returns.\tfor tabs.
- Spaces may be represented with the escape sequence
\s. - Spaces surrounding the name, square brackets, round brackets, annotations, or children are trimmed. To represent
leading or trailing spaces literally, either use quotes (e.g.
"Name "(Args)) or the\sescape sequence. (e.g.Name \s(Args))
Why
I needed a single-line human-readable representation of something like function calls, for use in config files. This
lets me define things like if[condition](action) in my config files.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.