Add standards document to sln + begin implementing standards

This commit is contained in:
Starbeamrainbowlabs 2016-08-04 11:49:57 +01:00
parent 80217f2387
commit 353a67bef1
3 changed files with 12 additions and 6 deletions

View file

@ -9,7 +9,7 @@ Example definitions:
```csharp ```csharp
# Shop # Shop
u c - c
decimal balance decimal balance
float lat float lat
float long float long
@ -19,8 +19,8 @@ List<TimeSpan> openingHours
```csharp ```csharp
# Model3D # Model3D
u OpenTK - OpenTK
u OpenTK.Graphics - OpenTK.Graphics
ModelUtility model ModelUtility model
ShaderUtility shaderProgram ShaderUtility shaderProgram
@ -29,8 +29,11 @@ Matrix4 transformation
Vector3 position 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 ## 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 Shortcut | Expansion
------------|--------------------------------- ------------|---------------------------------

View file

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

View file

@ -75,10 +75,12 @@ namespace cscz
if(nextLine == null) break; if(nextLine == null) break;
if(nextLine.Length == 0) continue; if(nextLine.Length == 0) continue;
nextLine = nextLine.Trim();
// It's a using statement // 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]); UsingStatements.Add(parts[1]);
} }
else if(nextLine.StartsWith("#")) else if(nextLine.StartsWith("#"))