##// END OF EJS Templates
Fixed promise rejection when there is not specified error handler in the reaction....
Fixed promise rejection when there is not specified error handler in the reaction. FIXED SPELLING IN THE XML CONTAINER CONFIGURATION signleton->singleton Code cleanup Update tests make them working on dotnet core

File last commit:

r289:95896f882995 v3.0.14 v3
r295:28af686e24f7 default
Show More
RegularExpressionVisitorT.cs
37 lines | 1.2 KiB | text/x-csharp | CSharpLexer
cin
Added tests for Implab.ServiceHost.Unity configuration loader.
r289 using Implab;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
namespace Implab.Automaton.RegularExpressions {
/// <summary>
/// </summary>
public class RegularExpressionVisitor<TTag> : RegularExpressionVisitor {
readonly Dictionary<int, TTag> m_tags = new Dictionary<int, TTag>();
readonly ITaggedDFABuilder<TTag> m_builder;
public RegularExpressionVisitor(ITaggedDFABuilder<TTag> builder) : base(builder) {
m_builder = builder;
}
public override void Visit(EndToken token) {
base.Visit(token);
var tagged = token as EndToken<TTag>;
if (tagged != null)
m_tags.Add(Index, tagged.Tag);
}
protected override void MarkFinalState(HashSet<int> state) {
base.MarkFinalState(state);
m_builder.SetStateTag(Translate(state), GetStateTags(state));
}
TTag[] GetStateTags(IEnumerable<int> state) {
Debug.Assert(state != null);
return state.Where(m_tags.ContainsKey).Select(pos => m_tags[pos]).ToArray();
}
}
}