| | 1 | | using Newtonsoft.Json.Linq; |
| | 2 | | using ValidateLib.ErrorsAndWarnings.Warnings; |
| | 3 | | using ValidateLib.Metadata.Descriptors; |
| | 4 | | using ValidateLib.Metadata.Properties.AtomicProperties; |
| | 5 | |
|
| | 6 | | namespace ValidateLib.Metadata.PropertyParsers.DIalect |
| | 7 | | { |
| | 8 | | internal class SkipInitialSpacePropertyParser : PropertyParserBase<DialectDescriptor>, IPropertyParser<DialectDescri |
| | 9 | | { |
| 1 | 10 | | public SkipInitialSpacePropertyParser(List<Warning> warnings, DialectDescriptor descriptor) : base(warnings, des |
| | 11 | | { |
| 1 | 12 | | } |
| | 13 | |
|
| | 14 | | public void ParseProperty(JProperty property) |
| | 15 | | { |
| 1 | 16 | | if (property.Value.Type != JTokenType.Boolean) |
| | 17 | | { |
| 1 | 18 | | Warnings.Add(WarningFactory.GetAtomicPropertyBoolWrongValueWarning(property.Value, property.Name, proper |
| 1 | 19 | | Descriptor.skipInitialSpace = new AtomicPropertyBoolean(false); |
| 1 | 20 | | if (Descriptor.trim is null) Descriptor.trim = new AtomicPropertyString("false"); |
| | 21 | | } |
| | 22 | | else |
| | 23 | | { |
| 1 | 24 | | bool boolValue = (bool)property.Value; |
| 1 | 25 | | Descriptor.skipInitialSpace = new AtomicPropertyBoolean(boolValue); |
| 1 | 26 | | if (Descriptor.trim is null) |
| 0 | 27 | | Descriptor.trim = new AtomicPropertyString(boolValue ? "start" : "false"); |
| | 28 | | } |
| 1 | 29 | | } |
| | 30 | | } |
| | 31 | | } |