Browse Source

Add standards document to sln + begin implementing standards

Starbeamrainbowlabs 2 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:
9 9
 
10 10
 ```csharp
11 11
 # Shop
12
-u c
12
+- c
13 13
 decimal balance
14 14
 float lat
15 15
 float long
@@ -19,8 +19,8 @@ List<TimeSpan> openingHours
19 19
 
20 20
 ```csharp
21 21
 # Model3D
22
-u OpenTK
23
-u OpenTK.Graphics
22
+- OpenTK
23
+- OpenTK.Graphics
24 24
 
25 25
 ModelUtility model
26 26
 ShaderUtility shaderProgram
@@ -29,8 +29,11 @@ Matrix4 transformation
29 29
 Vector3 position
30 30
 ```
31 31
 
32
+## Syntax
33
+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).
34
+
32 35
 ## Using Statement Shortcuts
33
-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:
36
+The C&sharp; Class Generator supports shortcuts in the using statement declarations (`- System`). Here's a table of all the shortcuts added so far:
34 37
 
35 38
 Shortcut	| Expansion
36 39
 ------------|---------------------------------

+ 1
- 0
cscz.sln View File

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

+ 4
- 2
cscz/ClassGenerator.cs View File

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

Loading…
Cancel
Save