-
Notifications
You must be signed in to change notification settings - Fork 2
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
Refactor AST/Environment #3
Conversation
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 won't be able to review this in-depth until Friday or Saturday at the earliest, but I do have some initial, high-level thoughts.
@colinodell any further thoughts on this? |
My apologies! I still owe you a review and feedback on everything else here - I'll try to get that done this weekend. I appreciate the ping! |
I'll give you some initial, high-level feedback now :) At this point, I don't have a strong desire to split parts of In terms of parsing input, I'm thinking about this mostly in the context of how it would fit integrate with
In the first case, your parser tells the engine to stop at any I believe the following hold true for both cases:
For those reasons, I don't think your input parsing approach or AST has to align with I have not reviewed the environment stuff here, and I'm sure I missed a few points you mentioned above, so I'll circle back to those (and any other thoughts you have) later this week. |
A lot of this work was based on the previous conversations we had about extracting non-commonmark specific code. Things, like environment and config, are certainly not commonmark specific. In any case, if there's no interest in sharing code then I can certainly simplify it to be less abstract here. My goal was only to stop having to constantly create many of these common requirements. In hindsight and given the amount of time that has passed, it probably makes more sense to (at least now) to not try and change everything. Re: parsing/line splitting, the primary goal of this particular project is to be a standalone implementation for parsing and converting emojis, emoticons and shortcodes. This has nothing really to do with commonmark and users may need/want to parse a multiline document on its own. While we could parse things in commonmark at a character level, I believe it's just easier to register |
I've gone ahead and extracted the configuration stuff into its own repo/project and added you as an admin: https://github.com/unicorn-fail/configuration Once you deem that it's ready, it should be relatively easy to transfer into the |
49e530d
to
63b164b
Compare
I'm starting to pair down the environment stuff and went ahead and added a Twemoji extension so we can use a real use case scenario to help build it out to determine what is actually needed. Needless to say, this is still a WIP, so I'll ping you once its ready again so you don't accidentally waste your time reviewing. |
b53d161
to
95d4d91
Compare
95d4d91
to
daa46e9
Compare
07e3c17
to
f8f8662
Compare
All tests/coverage is 100% again locally. Need to figure out what's going on with GH actions. I think it may be due to a PHP version/serialization discrepancy (pretty sure the archives need to be serialized in PHP 7.2 as things changed in 7.4). @colinodell I know this is a lot of code to review, so I'm thinking I'm going to go ahead and merge it and we can follow-up with smaller issues/PRs moving forward? edit: I re-read a lot of your comments and made adjustments accordingly to simplify and "flatten" the AST. There's still a lot of boiler code, but that's mainly due to the necessity for extensions (Twemoji). |
@colinodell this is more or less what I was thinking. It would be nice if there were a common namespace that both projects could inherit from, that way other libraries could pass along their own
Node
objects. As it stands now, I think this may be the direction I want to go in, cause it would allow us to create aTwemojiExtension
that adds a custom renderer for all\UnicornFail\Emoji\Node\Inline\Unicode
objects.