Turn Fact Splitting into Compiler Pass #8

Open
opened 2024-12-11 00:36:46 +00:00 by andnull · 0 comments
Owner

Currently LVERA preforms the following operation

|hello, world| goodbye, cruel world
|| hello, world

                |
             (parse)
                |
                V

{ { left = {"hello", "world"}
  , right = {"goodbye", "cruel world"
  }
, { left = {} 
  , right = {"hello", "world"}
}

               |
    (other compiler passes)
               |
               V

              ...

However, there may be value in doing the following:

|hello, world| goodbye, cruel world
|| hello, world

                |
             (parse)
                |
                V

{ { left = {"hello, world"}
  , right = {"goodbye, cruel world"}
  }
, { left = {}
  , right = {"hello, world"}
  }
}

                |
   (compiler pass: split facts)
                |
                V

{ { left = {"hello", "world"}
  , right = {"goodbye", "cruel world"
  }
, { left = {} 
  , right = {"hello", "world"}
}

               |
    (other compiler passes)
               |
               V

              ...

This now allows for customizing the fact delimiter and the ability to extract the verbatim text of the left and right hand sides. Compiler passes could happen before fact splitting allow for features that would benefit from this kind of "raw" form.

Currently LVERA preforms the following operation ``` |hello, world| goodbye, cruel world || hello, world | (parse) | V { { left = {"hello", "world"} , right = {"goodbye", "cruel world" } , { left = {} , right = {"hello", "world"} } | (other compiler passes) | V ... ``` However, there may be value in doing the following: ``` |hello, world| goodbye, cruel world || hello, world | (parse) | V { { left = {"hello, world"} , right = {"goodbye, cruel world"} } , { left = {} , right = {"hello, world"} } } | (compiler pass: split facts) | V { { left = {"hello", "world"} , right = {"goodbye", "cruel world" } , { left = {} , right = {"hello", "world"} } | (other compiler passes) | V ... ``` This now allows for customizing the fact delimiter and the ability to extract the verbatim text of the left and right hand sides. Compiler passes could happen before fact splitting allow for features that would benefit from this kind of "raw" form.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
vera/lvera#8
No description provided.