public Task ParseAsync(VBComponent component, CancellationToken token, TokenStreamRewriter rewriter = null)
{
_state.ClearDeclarations(component);
_state.SetModuleState(component, ParserState.Pending); // also clears module-exceptions
var linkedTokenSource = CancellationTokenSource.CreateLinkedTokenSource(_central.Token, token);
//var taskFactory = new TaskFactory(new StaTaskScheduler());
var task = new Task(() => ParseAsyncInternal(component, linkedTokenSource.Token, rewriter));
_currentTasks.TryAdd(component, Tuple.Create(task, linkedTokenSource));
Tuple<Task, CancellationTokenSource> removedTask;
task.ContinueWith(t => _currentTasks.TryRemove(component, out removedTask)); // default also executes on cancel
task.Start(/*taskFactory.Scheduler*/);
return task;
}