Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
C
clean-platform
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 16
    • Issues 16
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • clean-and-itasks
  • clean-platform
  • Merge Requests
  • !209

Merged
Opened Oct 14, 2018 by Camil Staps@cstaps🚀Owner

Fix exponentionality in Clean.Types.Parse

  • Overview 0
  • Commits 1
  • Pipelines 1
  • Changes 3

Previously, the time and heap needed for these start rules would grow exponentionally:

Start = parseType ['[(Int,{#Char},T)] -> [(Int,String,T)]']
Start = parseType ['[(Int,{#Char},T)] -> [(Int,String,T,T)]']
Start = parseType ['[(Int,{#Char},T)] -> [(Int,String,T,T,T)]']

This was due to pure [] <|> optContext in addContextAsConstFunction. This function adds context to a type which is not a function type (e.g., a | toString a), but should only be used when it cannot be added to a parent function type (e.g., a -> b | toString a must be parsed as ~Func [a] b [toString a] rather than ~Func [a] (Func [] b [toString a]) []; hence the pure [] <|> ....

The solution taken here is to add a pPeek which returns the current token stream, and have addContextAsConstFunction return immediately if the next token is not |.

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
Reference: clean-and-itasks/clean-platform!209
Source branch: clean.types.parse-exponentionality

Revert this merge request

This will create a new commit in order to revert the existing changes.

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.

Cherry-pick this merge request

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.