Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement associative parsers #116

Merged
merged 5 commits into from
May 23, 2024
Merged

Implement associative parsers #116

merged 5 commits into from
May 23, 2024

Conversation

sebastienros
Copy link
Owner

No description provided.

@sebastienros
Copy link
Owner Author

@gumbarros this PR is adding helpers to implement left/right associative expressions (and unary), you might want to use that. It might also be missing some things, so please provide feedback in this case.

@gumbarros
Copy link
Contributor

Great idea, I'm refactoring the unary expressions with your branch new parsers.

I get the following exception with .Compile

--- EXCEPTION #1/1 [LoggerException]
Message = “Stack overflow exception occurred in test. Test run is aborted.”
ExceptionPath = Root
ClassName = JetBrains.Util.LoggerException
HResult = COR_E_APPLICATION=80131600
StackTraceString = “
  at JetBrains.Util.ILoggerEx.LogMessage(ILogger this, LoggingLevel level, String message) in LogMessage.il:line IL_002E mvid 6505
     at JetBrains.Util.ILoggerEx.Error(ILogger this, String message) in Error.il:line IL_0000 mvid 6505
     at JetBrains.ReSharper.UnitTestFramework.Execution.TestRunner.TestRunnerRunStrategy.AnalyseProcessCrash(ProcessExitedUnexpectedlyException ex, IUnitTestRun run) in AnalyseProcessCrash.il:line IL_0028 mvid FE8B
     at JetBrains.ReSharper.UnitTestFramework.Execution.TestRunner.TestRunnerRunStrategy.Run(IUnitTestRun run) in Run.il:line IL_01C8 mvid FE8B
     at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.ExecutionContextCallback(Object s) in ExecutionContextCallback.il:line IL_0000 mvid 477B
     at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in RunInternal.il:line IL_0040 mvid 477B
     at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext(Thread threadPoolThread) in MoveNext.il:line IL_0000 mvid 477B or MoveNext.il:line IL_0040 mvid 477B
     at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext() in MoveNext.il:line IL_0000 mvid 477B or MoveNext.il:line IL_0040 mvid 477B
     at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(IAsyncStateMachineBox box, Boolean allowInlining) in RunOrScheduleAction.il:line IL_003B mvid 477B
     at System.Threading.Tasks.Task.RunContinuations(Object continuationObject) in RunContinuations.il:line IL_0065 mvid 477B or RunContinuations.il:line IL_0090 mvid 477B
     at System.Threading.Tasks.Task.FinishSlow(Boolean userDelegateExecute) in FinishSlow.il:line IL_0003 mvid 477B
     at System.Threading.Tasks.Task.TrySetException(Object exceptionObject) in TrySetException.il:line IL_0022 mvid 477B
     at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetException(Exception exception, Task`1& taskField) in SetException.il:line IL_0025 mvid 477B
     at JetBrains.ReSharper.UnitTestFramework.Execution.TestRunner.TestRunnerAgentManager.TestRunnerExecutionAgent.RunTests(CancellationToken cancelCt, CancellationToken abortCt) in RunTests.il:line IL_00AE mvid FE8B
     at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.ExecutionContextCallback(Object s) in ExecutionContextCallback.il:line IL_0000 mvid 477B
     at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in RunInternal.il:line IL_0040 mvid 477B
     at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext(Thread threadPoolThread) in MoveNext.il:line IL_0000 mvid 477B or MoveNext.il:line IL_0040 mvid 477B
     at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext() in MoveNext.il:line IL_0000 mvid 477B or MoveNext.il:line IL_0040 mvid 477B
     at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(IAsyncStateMachineBox box, Boolean allowInlining) in RunOrScheduleAction.il:line IL_003B mvid 477B
     at System.Threading.Tasks.Task.RunContinuations(Object continuationObject) in RunContinuations.il:line IL_0065 mvid 477B or RunContinuations.il:line IL_0090 mvid 477B
     at System.Threading.Tasks.Task.FinishSlow(Boolean userDelegateExecute) in FinishSlow.il:line IL_0003 mvid 477B
     at System.Threading.Tasks.Task.TrySetException(Object exceptionObject) in TrySetException.il:line IL_0022 mvid 477B
     at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetException(Exception exception, Task`1& taskField) in SetException.il:line IL_0025 mvid 477B
     at JetBrains.ReSharper.UnitTestFramework.Common.Extensions.TaskExtensions.CancelIf(Task task, CancellationToken ct, TaskCreationOptions options) in CancelIf.il:line IL_0126 mvid FE8B
     at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.ExecutionContextCallback(Object s) in ExecutionContextCallback.il:line IL_0000 mvid 477B
     at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in RunInternal.il:line IL_0040 mvid 477B
     at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext(Thread threadPoolThread) in MoveNext.il:line IL_0000 mvid 477B or MoveNext.il:line IL_0040 mvid 477B
     at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext() in MoveNext.il:line IL_0000 mvid 477B or MoveNext.il:line IL_0040 mvid 477B
     at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(IAsyncStateMachineBox box, Boolean allowInlining) in RunOrScheduleAction.il:line IL_003B mvid 477B
     at System.Threading.Tasks.Task.RunContinuations(Object continuationObject) in RunContinuations.il:line IL_0065 mvid 477B or RunContinuations.il:line IL_0090 mvid 477B
     at System.Threading.Tasks.Task`1.TrySetResult(TResult result) in TrySetResult.il:line IL_004B mvid 477B
     at System.Threading.Tasks.Task.TwoTaskWhenAnyPromise`1.Invoke(Task completingTask) in Invoke.il:line IL_0088 mvid 477B
     at System.Threading.Tasks.Task.RunContinuations(Object continuationObject) in RunContinuations.il:line IL_0065 mvid 477B or RunContinuations.il:line IL_0090 mvid 477B
     at System.Threading.Tasks.Task.FinishSlow(Boolean userDelegateExecute) in FinishSlow.il:line IL_0003 mvid 477B
     at System.Threading.Tasks.Task.TrySetException(Object exceptionObject) in TrySetException.il:line IL_0022 mvid 477B
     at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetException(Exception exception, Task`1& taskField) in SetException.il:line IL_0025 mvid 477B
     at JetBrains.ReSharper.UnitTestFramework.Common.Extensions.TaskExtensions.ThrowIf[TException](Task task, Task signallingTask, Func`1 exceptionFactory) in ThrowIf.il:line IL_00A9 mvid FE8B
     at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.ExecutionContextCallback(Object s) in ExecutionContextCallback.il:line IL_0000 mvid 477B
     at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in RunInternal.il:line IL_0040 mvid 477B
     at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext(Thread threadPoolThread) in MoveNext.il:line IL_0000 mvid 477B or MoveNext.il:line IL_0040 mvid 477B
     at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext() in MoveNext.il:line IL_0000 mvid 477B or MoveNext.il:line IL_0040 mvid 477B
     at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(IAsyncStateMachineBox box, Boolean allowInlining) in RunOrScheduleAction.il:line IL_003B mvid 477B
     at System.Threading.Tasks.Task.RunContinuations(Object continuationObject) in RunContinuations.il:line IL_0065 mvid 477B or RunContinuations.il:line IL_0090 mvid 477B
     ...

Without .Compile is working fine probably, I'm just fixing the logic on my parser before committing to my branch

@sebastienros
Copy link
Owner Author

@gumbarros I can't see Parlot in the stacktrace, could you paste the part where it's involved?

@gumbarros
Copy link
Contributor

@gumbarros I can't see Parlot in the stacktrace, could you paste the part where it's involved?

Sorry, I think it was a bug in my IDE, it's working normally now with .Compile. But I swear it was not working with just .Compile()

@sebastienros sebastienros merged commit 9aa53da into main May 23, 2024
1 check passed
@sebastienros sebastienros deleted the sebros/asso branch May 23, 2024 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants