-
Notifications
You must be signed in to change notification settings - Fork 46
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
Initial cleanup and refactoring of the parser #286
Merged
Merged
Changes from 24 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
e436c57
Add some documentation to cryptic Sub functions
shonfeder 3adc1da
Factor out string slice access functions
shonfeder 5955a32
Rename `Sub.tails` to `Sub.drop`
shonfeder 147b7d4
Rename "heads" to "take"
shonfeder 153bd13
Move `Sub` module into strSlice module file
shonfeder 2aaddb3
Add some comments and improve organization
shonfeder f7bc5b0
Factor out repeated length checks
shonfeder 9b98a62
Define peek_exn via peek
shonfeder 63a3709
Document the parser helpers
shonfeder ed6f2ae
Clean up sp3
shonfeder dabd83c
Remove (most) duplicates of ws testing logic
shonfeder 16747cd
Move char preds together
shonfeder e842b90
Add drop_while and drop_last_while
shonfeder ec0e52d
Factor out white space trimming
shonfeder fa6ae6c
Clarify comment
shonfeder 75805d8
Refactor thematic_break parsing
shonfeder d3535dc
Clean up setext_heading
shonfeder 60f750b
Add stdcmpat dependency
shonfeder 28b38e5
Remove unneeded disabled warning
shonfeder 46ee44c
Add index, split_at, and fold_left
shonfeder 7f88563
Further refactor thematic_break
shonfeder 4a17175
Simplify setext_heading again
shonfeder 4527c6a
Replace custom Compat module with Stdcompat
shonfeder 3cafd16
Fix formatting
shonfeder d2666ce
Use inline records for Lsetext_heading
shonfeder 6611e25
Remove enusre_chars_remain
shonfeder ff1799d
Drop use of "Sub" alias for StrSlice
shonfeder 7b1ea60
Add Compat module back
shonfeder 606e2c0
Try to fix name clsah
shonfeder e1f1f94
remove compat module
tatchi 612f35a
Raise minimum ocaml version to 4.08
shonfeder File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
open Ast | ||
module Sub = Parser.Sub | ||
module Sub = StrSlice | ||
|
||
module Pre = struct | ||
type container = | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not entirely sure what I should do about this naming. Is
Sub
a good name for the module? I find it cryptic and inaccurate, under the view that it's not really about substrings, per se, but about slices over a base. But maybe that's more of an implementation detail? Really, it's more like an alternative representation of strings based on the view of a slice...WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find
StrSlice
a better name thanParser.Sub
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool. I think I do too. I dropped the
Sub
alias.