Skip to content

Commit

Permalink
Draft of SobaScript project. /Core (netstd2.0 + net40). Part of #55
Browse files Browse the repository at this point in the history
components still are part of vssbe
  • Loading branch information
3F committed Sep 1, 2019
1 parent f516df8 commit 9b54181
Show file tree
Hide file tree
Showing 171 changed files with 4,912 additions and 5,149 deletions.
1 change: 1 addition & 0 deletions E-MSBuild/E-MSBuild.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

Read the documentation with examples.
https://github.com/3F/E-MSBuild/blob/master/Readme.md

</Description>
<PackageOwners>reg</PackageOwners>
Expand Down
20 changes: 18 additions & 2 deletions E-MSBuild/EvEnvBlank.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,30 @@ internal sealed class EvEnvBlank: IEvEnv, IEvMin
private readonly IEvMin ev;
private readonly Project prj;

public string GetMutualPropValue(string name) => ev.GetMutualPropValue(name);
/// <summary>
/// An unified unscoped and out of Project instance the property value by its name.
/// Remarks: Any property values cannot be null.
/// </summary>
/// <param name="name">Property name.</param>
/// <returns>Found non-null property value or null if not.</returns>
public string GetMutualPropValue(string name) => ev?.GetMutualPropValue(name);

/// <summary>
/// Get Project instance for work with data inside specified scope.
/// </summary>
/// <param name="ident">Abstract identifier of the specified scope. It can be a GUID, or FullPath, or project name, etc.</param>
/// <returns>Expected the instance that is associated with the identifier or any default instance if not found any related to pushed ident.</returns>
public Project GetProject(object ident) => prj;

public EvEnvBlank()
{
prj = new Project();
}

public EvEnvBlank(IEvMin ev)
: this()
{
this.ev = ev ?? throw new ArgumentNullException(nameof(ev));
prj = new Project();
}
}
}
24 changes: 18 additions & 6 deletions E-MSBuild/EvMSBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,14 @@ void IEvMSBuildEx.DefProperties(Project project)
}
}

public EvMSBuilder(IEvEnv env, IUVars uvars)
public EvMSBuilder()
: this(new EvEnvBlank())
{
this.env = env ?? throw new ArgumentNullException(nameof(env));
UVars = uvars ?? throw new ArgumentNullException(nameof(uvars));

}

public EvMSBuilder(IEvEnv env)
: this(env, new UVars())
public EvMSBuilder(IUVars uvars)
: this(new EvEnvBlank(), uvars)
{

}
Expand All @@ -222,6 +222,18 @@ public EvMSBuilder(IEvMin ev, IUVars uvars)

}

public EvMSBuilder(IEvEnv env)
: this(env, new UVars())
{

}

public EvMSBuilder(IEvEnv env, IUVars uvars)
{
this.env = env ?? throw new ArgumentNullException(nameof(env));
UVars = uvars ?? throw new ArgumentNullException(nameof(uvars));
}

protected virtual bool IsSimpleProperty(ref string data)
=> data?.IndexOfAny(simprop) == -1;

Expand Down Expand Up @@ -545,7 +557,7 @@ private protected string ContainerIn(string data, StringHandler sh, uint limit)
{
if(step++ > limit) {
sh.Flush();
throw new LimitException("Restriction of supported containers '{0}' reached. Aborted.", limit);
throw new LimitException($"Restriction of supported containers '{limit}' reached. Aborted.", limit);
}

data = con.Replace
Expand Down
2 changes: 1 addition & 1 deletion E-MSBuild/Exceptions/IncorrectSyntaxException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
namespace net.r_eg.EvMSBuild.Exceptions
{
[Serializable]
public class IncorrectSyntaxException: UnspecifiedEvMSBuildException
public class IncorrectSyntaxException: UnspecEvMSBuildException
{
public IncorrectSyntaxException()
{
Expand Down
2 changes: 1 addition & 1 deletion E-MSBuild/Exceptions/PossibleLoopException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
namespace net.r_eg.EvMSBuild.Exceptions
{
[Serializable]
public class PossibleLoopException: UnspecifiedEvMSBuildException
public class PossibleLoopException: UnspecEvMSBuildException
{
public PossibleLoopException()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,20 @@
namespace net.r_eg.EvMSBuild.Exceptions
{
[Serializable]
public class UnspecifiedEvMSBuildException: Exception
public class UnspecEvMSBuildException: Exception
{
public UnspecifiedEvMSBuildException()
public UnspecEvMSBuildException()
{

}

public UnspecifiedEvMSBuildException(string message)
public UnspecEvMSBuildException(string message)
: base(message)
{

}

public UnspecifiedEvMSBuildException(string message, Exception innerException)
public UnspecEvMSBuildException(string message, Exception innerException)
: base(message, innerException)
{

Expand Down
13 changes: 13 additions & 0 deletions SobaScript/3rd-party
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
SobaScript - https://github.com/3F/SobaScript

Uses the following third-party components:

* [E-MSBuild](https://github.com/3F/E-MSBuild)

* [Varhead](https://github.com/3F/Varhead)

* [Json.NET](https://github.com/JamesNK/Newtonsoft.Json)
Actually, only for this line: `((JArray)data).ToObject(typeof(object[]))`.
This dependency is still being considered.

* [LSender](https://github.com/3F/LSender)
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
/*
* Copyright (c) 2013-2016,2019 Denis Kuzmin < entry.reg@gmail.com > GitHub/3F
* The MIT License (MIT)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* Copyright (c) 2014-2019 Denis Kuzmin < x-3F@outlook.com > GitHub/3F
* Copyright (c) SobaScript contributors: https://github.com/3F/Varhead/graphs/contributors
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

namespace net.r_eg.vsSBE.SBEScripts
namespace net.r_eg.SobaScript
{
/// <summary>
/// Specification of possible values for components and other places of the core
Expand All @@ -29,32 +37,40 @@ public enum CValueType
/// It's also used for binding the next Property/Method.
/// </summary>
Void,

/// <summary>
/// Value of different or untyped / uncertain types
/// </summary>
Mixed,

/// <summary>
/// Any stream data input.
/// It's also used for binding the multiline data for:
/// * Property: #[Component property: multiline data]
/// * Method: #[Component method("arg"): multiline data]
/// </summary>
Input,

/// <summary>
/// Predefined data
/// </summary>
Enum,

Const,

String,

Boolean,

Integer,

Float,

/// <summary>
/// Unsigned types
/// </summary>
UInteger,

UFloat,

/// <summary>
Expand Down
54 changes: 54 additions & 0 deletions SobaScript/ComponentCfg.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2019 Denis Kuzmin < x-3F@outlook.com > GitHub/3F
* Copyright (c) SobaScript contributors: https://github.com/3F/Varhead/graphs/contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

using System;

namespace net.r_eg.SobaScript
{
/// <summary>
/// Configure existing components
/// </summary>
[Obsolete]
public class ComponentCfg
{
/// <summary>
/// Identification by class name
/// </summary>
public string ClassName
{
get;
set;
}

/// <summary>
/// Activation status
/// </summary>
public bool Enabled
{
get;
set;
}
}
}
Loading

0 comments on commit 9b54181

Please sign in to comment.