@@ -6,13 +6,13 @@ Core components for SobaScript. Extensible Modular Scripting Programming Languag
66
77https://github.com/3F/SobaScript
88
9- [ ![ Build status] ( https://ci.appveyor.com/api/projects/status/SobaScript.Z.Core /branch/master?svg=true )] ( https://ci.appveyor.com/project/3Fs/SobaScript.Z.Core /branch/master )
9+ [ ![ Build status] ( https://ci.appveyor.com/api/projects/status/i5lugbk4rgovi6ta /branch/master?svg=true )] ( https://ci.appveyor.com/project/3Fs/sobascript-z-core /branch/master )
1010[ ![ release-src] ( https://img.shields.io/github/release/3F/SobaScript.Z.Core.svg )] ( https://github.com/3F/SobaScript.Z.Core/releases/latest )
1111[ ![ License] ( https://img.shields.io/badge/License-MIT-74A5C2.svg )] ( https://github.com/3F/SobaScript.Z.Core/blob/master/License.txt )
1212[ ![ NuGet package] ( https://img.shields.io/nuget/v/SobaScript.Z.Core.svg )] ( https://www.nuget.org/packages/SobaScript.Z.Core/ )
13- [ ![ Tests] ( https://img.shields.io/appveyor/tests/3Fs/SobaScript.Z.Core /master.svg )] ( https://ci.appveyor.com/project/3Fs/SobaScript.Z.Core /build/tests )
13+ [ ![ Tests] ( https://img.shields.io/appveyor/tests/3Fs/sobascript-z-core /master.svg )] ( https://ci.appveyor.com/project/3Fs/sobascript-z-core /build/tests )
1414
15- [ ![ Build history] ( https://buildstats.info/appveyor/chart/3Fs/SobaScript.Z.Core?buildCount=20&includeBuildsFromPullRequest=true& showStats=true )] ( https://ci.appveyor.com/project/3Fs/SobaScript.Z.Core/history )
15+ [ ![ Build history] ( https://buildstats.info/appveyor/chart/3Fs/SobaScript.Z.Core?buildCount=20&showStats=true )] ( https://ci.appveyor.com/project/3Fs/SobaScript.Z.Core/history )
1616
1717## License
1818
@@ -26,3 +26,211 @@ Copyright (c) 2014-2019 Denis Kuzmin < x-3F@outlook.com > GitHub/3F
2626
2727SobaScript.Z.Core contributors: https://github.com/3F/SobaScript.Z.Core/graphs/contributors
2828
29+ ## Provides at least the following
30+
31+ ### ConditionComponent
32+
33+ Supports composite conditions with limited short-circuit evaluation (separately for all brackets)
34+
35+ Additional Operators:
36+
37+ ``` text
38+ ===, !==, ~=, ==, !=, >=, <=, !, >, <, ^=, =^
39+ ```
40+
41+
42+ ``` clojure
43+ #[( #[var count] > 10 || ($(isAllow ) && !false) ) {
44+ ...
45+ }
46+ else{
47+ ...
48+ }]
49+ ```
50+
51+ ``` clojure
52+ #[($(Configuration ) ~= Deb && $(count ) > 10 || $(Configuration ) == " Release" ) {
53+ ...
54+ }]
55+ ```
56+
57+ ``` clojure
58+ #[( (1 < 2 && 2 == 2 && ( true || ((false || 2 >= 2 ) && (1 > 7 && true )))) )
59+ {
60+ #[( #[var count] > 10 || ($(isAllow ) && !false) ) {
61+ ...
62+ }
63+ else{
64+ ...
65+ }]
66+ }]
67+ ```
68+
69+ ``` clojure
70+ #[( !(1 > 2 ) ) {
71+ is greater
72+ }]
73+ ```
74+
75+ ### EvMSBuildComponent
76+
77+ Through [ E-MSBuild] ( https://github.com/3F/E-MSBuild )
78+
79+ ``` clojure
80+ #[$(... )]
81+ ```
82+
83+ ``` clojure
84+ #[$(
85+ [System.Math]::Exp('$(
86+ [MSBuild]::Multiply(
87+ $([System.Math]::Log(10 )),
88+ 4
89+ ))'
90+ )
91+ )]
92+ ```
93+
94+ ``` clojure
95+ #[var revBuild = #[$(
96+ [System.TimeSpan]::FromTicks('$(
97+ [MSBuild]::Subtract(
98+ $(tNow ),
99+ $(tBase ))
100+ )')
101+ .TotalMinutes
102+ .ToString('0' ))]]
103+ ```
104+
105+ ### UserVariableComponent
106+
107+ Through [ Varhead] ( https://github.com/3F/Varhead ) .
108+
109+ ``` clojure
110+ #[var name = mixed value]
111+ #[var name]
112+ ```
113+
114+ ``` clojure
115+ #[var branchSha1 = #[IO sout("git", " rev-parse --short HEAD" )]]
116+ ```
117+
118+ Unset variable:
119+
120+ ``` clojure
121+ #[var -name]
122+ ```
123+
124+ Default value for variable:
125+
126+ ``` clojure
127+ #[var +name]
128+ ```
129+
130+ ### TryComponent
131+
132+ Protects from errors in try{...} block and handles it in catch{...}
133+
134+ ``` clojure
135+ #[try
136+ {
137+ ...
138+ }
139+ catch(err, msg)
140+ {
141+ $(err ) - Type of Exception
142+ $(msg ) - Error Message
143+ ...
144+ }]
145+ ```
146+
147+ ``` clojure
148+ #[try
149+ {
150+ #[IO copy.file("notreal.file", " artefact.t1" , false )]
151+ }
152+ catch(err, msg)
153+ {
154+ #[($(err ) == System.IO.FileNotFoundException) {
155+ #[OWP item("-Build-" ).writeLine(true ): Found error #[$(msg )]]
156+ }]
157+ }]
158+ ```
159+
160+ ``` clojure
161+ #[try {
162+
163+ #[Box data.pack("header", false ):
164+
165+ ...
166+ ]
167+
168+ }catch{ }]
169+ ```
170+
171+ ### CommentComponent
172+
173+ ``` clojure
174+ #["
175+ Example
176+ " Description 1 "
177+ " Description 2 "
178+ " ]
179+ ```
180+
181+ ``` clojure
182+ #[" Example " ]
183+ ```
184+
185+ ### BoxComponent
186+
187+ Container of data for operations such for templating, repeating, etc.
188+
189+ ``` clojure
190+ #[Box iterate(i = 0 ; $(i) < 10; i += 1):
191+ ...
192+ #[Box operators.sleep(250 )]
193+ ]
194+ ```
195+
196+ ```clojure
197+ #[Box repeat($(i ) < 10 ; true):
198+
199+ #[File append("test.txt" ):
200+ #[$(i )]
201+ ]
202+
203+ $(i = $([MSBuild]::Add($(i ), 1 )))
204+ ]
205+ ```
206+
207+ ```clojure
208+ #[Box repeat($(flag )): ...]
209+ #[Box iterate(; $(flag ); ): ...]
210+ ```
211+
212+
213+
214+ ```clojure
215+ #[try {
216+
217+ #[Box data.pack("header", false ):
218+
219+ #[$(data = " Hello $(user) !" )]
220+ #[File appendLine("$(fname )" ): ------ #[$(data)] ------ ]
221+ ]
222+
223+ }catch{ }]
224+
225+ #[$(fname = 'f1.txt')]
226+ #[$(user = 'UserA')]
227+ #[Box data.get(" header" , true)]
228+
229+ #[$(user = 'UserB')]
230+ #[Box data.get(" header" , true)]
231+ ```
232+
233+ ```
234+ ------ Hello UserA ! ------
235+ ------ Hello UserB ! ------
236+ ```
0 commit comments