Skip to content

Commit dc62584

Browse files
committed
Relicensed under BSD 3-clause
1 parent 402f5e6 commit dc62584

File tree

3 files changed

+70
-36
lines changed

3 files changed

+70
-36
lines changed

LICENSE

+27-15
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,29 @@
1-
Permission is hereby granted, free of charge, to any person obtaining a copy
2-
of this software and associated documentation files (the "Software"), to deal
3-
in the Software without restriction, including without limitation the rights
4-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
5-
copies of the Software, and to permit persons to whom the Software is
6-
furnished to do so, subject to the following conditions:
1+
BSD 3-Clause License
72

8-
The above copyright notice and this permission notice shall be included in all
9-
copies or substantial portions of the Software.
3+
Copyright (c) 2022, Tony Bark
4+
All rights reserved.
105

11-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17-
SOFTWARE.
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
1. Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
2. Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
3. Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
# Sixam.CST
1+
# CSTNet
22

33
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](code_of_conduct.md)
44

5-
Caret-Separated Text (or CST) is a key-value pair format represented by digits or words as keys and the value as text enclosed between carets. (e.g. ``<key> ^<text>^``) Any text which is not enclosed with carets is considered a comment and ignored. Neither strings nor comments may use the caret character. Sixam.CST is a library for parsing the CST format.
5+
Caret-Separated Text (or CST) is a key-value pair format represented by digits or words as keys and the value as text enclosed between carets. (e.g. ``<key> ^<text>^``) Any text which is not enclosed with carets is considered a comment and ignored. Neither strings nor comments may use the caret character. CST.NET is a library for parsing the CST format.
6+
7+
CST.NET uses .NET's built-in indexing extension function to accomplish locating of each respective key. As a consequence, it does not matter what you use for keys. I added an additional normalization to the pipeline that converts the document's line endings to the system's, in order to prevent crashes.
68

79
## Usage
810

@@ -18,9 +20,9 @@ See [usage.md](./usage.md).
1820

1921
## Requirements
2022

21-
- [.NET](https://dotnet.microsoft.com/download) 6+.
23+
- [.NET](https://dotnet.microsoft.com/download) 6 or later.
2224
- [.NET Interactive](https://github.com/dotnet/interactive/blob/main/README.md) for notebooks (optional).
23-
- [VSCode Extension](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.dotnet-interactive-vscode) or [nteract](https://nteract.io/)
25+
- [VSCode Extension](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.dotnet-interactive-vscode) or [nteract](https://nteract.io/).
2426

2527
## License
2628

notebooks/cst.ipynb

+37-17
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,33 @@
1010
"\n",
1111
"## CST.NET\n",
1212
"\n",
13-
"CST.NET uses .NET's built-in indexing extension function to accomplish locating of each respective key. As a consequence, it does not matter what you use for keys. I added an additional normalizion to the pipeline that converts the document's line endings to the system's, in order to prevent crashes."
13+
"CST.NET uses .NET's built-in indexing extension function to accomplish locating of each respective key. As a consequence, it does not matter what you use for keys. I added an additional normalization to the pipeline that converts the document's line endings to the system's, in order to prevent crashes."
1414
]
1515
},
1616
{
1717
"cell_type": "code",
1818
"execution_count": 1,
19-
"metadata": {},
19+
"metadata": {
20+
"vscode": {
21+
"languageId": "csharp"
22+
}
23+
},
24+
"outputs": [],
2025
"source": [
2126
"using System.IO;\n",
2227
"using System.Collections.Generic;\n",
2328
"using System.Text.RegularExpressions;"
24-
],
25-
"outputs": []
29+
]
2630
},
2731
{
2832
"cell_type": "code",
2933
"execution_count": 1,
30-
"metadata": {},
34+
"metadata": {
35+
"vscode": {
36+
"languageId": "csharp"
37+
}
38+
},
39+
"outputs": [],
3140
"source": [
3241
"public static class CaretSeparatedText\n",
3342
"{\n",
@@ -114,13 +123,17 @@
114123
" return \"***MISSING***\";\n",
115124
" }\n",
116125
"}"
117-
],
118-
"outputs": []
126+
]
119127
},
120128
{
121129
"cell_type": "code",
122130
"execution_count": 1,
123-
"metadata": {},
131+
"metadata": {
132+
"vscode": {
133+
"languageId": "csharp"
134+
}
135+
},
136+
"outputs": [],
124137
"source": [
125138
"class ContentStrings\n",
126139
"{\n",
@@ -161,13 +174,17 @@
161174
" return CaretSeparatedText.Parse(file, key);\n",
162175
" }\n",
163176
"}"
164-
],
165-
"outputs": []
177+
]
166178
},
167179
{
168180
"cell_type": "code",
169181
"execution_count": 1,
170-
"metadata": {},
182+
"metadata": {
183+
"vscode": {
184+
"languageId": "csharp"
185+
}
186+
},
187+
"outputs": [],
171188
"source": [
172189
"var english = new ContentStrings();\n",
173190
"var v1Path = Path.Combine(Environment.CurrentDirectory, \"data\", \"v1.cst\");\n",
@@ -178,22 +195,25 @@
178195
"Console.WriteLine($\"One:{Environment.NewLine}{one}\");\n",
179196
"/*Console.WriteLine($\"Three:{Environment.NewLine}{three}\");\n",
180197
"Console.WriteLine($\"Four:{Environment.NewLine}{four}\"); */"
181-
],
182-
"outputs": []
198+
]
183199
},
184200
{
185201
"cell_type": "code",
186202
"execution_count": 1,
187-
"metadata": {},
203+
"metadata": {
204+
"vscode": {
205+
"languageId": "csharp"
206+
}
207+
},
208+
"outputs": [],
188209
"source": [
189210
"var v2Path = Path.Combine(Environment.CurrentDirectory, \"data\", \"v2.cst\");\n",
190211
"var v2File = File.ReadAllText(v2Path);\n",
191212
"var singleLineV2 = CaretSeparatedText.Parse(v2File, \"Singleline\");\n",
192213
"var multiLineV2 = CaretSeparatedText.Parse(v2File, \"Multiline\");\n",
193214
"Console.WriteLine($\"Single line v2:{Environment.NewLine}{singleLineV2}\");\n",
194215
"Console.WriteLine($\"Multiline v2:{Environment.NewLine}{multiLineV2}\");"
195-
],
196-
"outputs": []
216+
]
197217
}
198218
],
199219
"metadata": {
@@ -212,4 +232,4 @@
212232
},
213233
"nbformat": 4,
214234
"nbformat_minor": 4
215-
}
235+
}

0 commit comments

Comments
 (0)