Add standards document to sln + begin implementing standards

This commit is contained in:
Starbeamrainbowlabs 2016-08-04 11:49:57 +01:00
父節點 80217f2387
當前提交 353a67bef1
共有 3 個檔案被更改,包括 12 行新增6 行删除

查看文件

@ -9,7 +9,7 @@ Example definitions:
```csharp
# Shop
u c
- c
decimal balance
float lat
float long
@ -19,8 +19,8 @@ List<TimeSpan> openingHours
```csharp
# Model3D
u OpenTK
u OpenTK.Graphics
- OpenTK
- OpenTK.Graphics
ModelUtility model
ShaderUtility shaderProgram
@ -29,8 +29,11 @@ Matrix4 transformation
Vector3 position
```
## Syntax
The examples above should be enough to get you started, but if you want a formal standard document for the syntax, I've written one in [CSCZ.Standard.md](https://git.starbeamrainbowlabs.com/sbrl/cscz/src/master/CSCZ.Standard.md).
## Using Statement Shortcuts
The C&sharp; Class Generator supports shortcuts in the using statement declarations (`u System`). Here's a table of all the shortcuts added so far:
The C&sharp; Class Generator supports shortcuts in the using statement declarations (`- System`). Here's a table of all the shortcuts added so far:
Shortcut | Expansion
------------|---------------------------------

查看文件

@ -9,6 +9,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
LICENSE = LICENSE
README.md = README.md
Changelog.md = Changelog.md
CSCZ.Standard.md = CSCZ.Standard.md
EndProjectSection
EndProject
Global

查看文件

@ -75,10 +75,12 @@ namespace cscz
if(nextLine == null) break;
if(nextLine.Length == 0) continue;
nextLine = nextLine.Trim();
// It's a using statement
if(nextLine.StartsWith("u "))
if(nextLine.StartsWith("- "))
{
string[] parts = Regex.Split(nextLine.Trim(), @"\s+");
string[] parts = Regex.Split(nextLine, @"\s+");
UsingStatements.Add(parts[1]);
}
else if(nextLine.StartsWith("#"))