Browse Source

Add standards document to sln + begin implementing standards

tags/v0.4
Starbeamrainbowlabs 3 years ago
parent
commit
353a67bef1
3 changed files with 12 additions and 6 deletions
  1. 7
    4
      README.md
  2. 1
    0
      cscz.sln
  3. 4
    2
      cscz/ClassGenerator.cs

+ 7
- 4
README.md View File

@@ -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
------------|---------------------------------

+ 1
- 0
cscz.sln View File

@@ -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

+ 4
- 2
cscz/ClassGenerator.cs View File

@@ -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("#"))

Loading…
Cancel
Save