Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

reimplemented litmoon#217

Open
nonchip wants to merge 2 commits intoleafo:master from
nonchip:litmoon
Open

reimplemented litmoon #217
nonchip wants to merge 2 commits intoleafo:master from
nonchip:litmoon

Conversation

@nonchip
Copy link
Contributor

@nonchip nonchip commented Sep 28, 2015

there you go. using lpeg this time, because what the hell did I hack there before :P

tried to break as little as possible, and went with a factory approach where I always default to litmoon=false and generate the default functions in case someone was depending on them somewhere else.

general idea:

--declaration:
- some_func=(...) -> blah
+ some_func_factory(litmoon=false) -> (...) -> blah
+ some_func = some_func_factory!
--call:
- some_func ... -- this would still work elsewhere
+ some_func(litmoon) ...

also the mechanism for filtering is actually pretty simple: extend moonscript.parser.literals.EmptyLine on demand (using above factory design) and redefine Line as (CheckIndent * Statement + Space * #Stop) + EmptyLine

Copy link
Contributor Author

nonchip commented Sep 28, 2015

whoops, thanks travis, missed something there, i'll fix

Copy link
Contributor Author

nonchip commented Sep 28, 2015

done. Line must have EmptyLine at the end, not at the start.

@nonchip nonchip changed the title (削除) implemented litmoon (削除ここまで) (追記) reimplemented litmoon (追記ここまで) Sep 28, 2015
Copy link
Contributor Author

nonchip commented Oct 6, 2015

@leafo ping?

Copy link
Owner

leafo commented Oct 6, 2015

Haven't had a chance to review yet, this is a much bigger change.

Copy link
Contributor Author

nonchip commented Nov 24, 2015

will this be reviewed anytime soon? most of the changes are autocompiled lua anyway, busted passes (ofc i added a test for litmoon), and there's at least 2 projects already using it, so imho it'd be worth the time...

Copy link
Contributor Author

nonchip commented Mar 9, 2016

seriously, i don't see how this "bigger change" (consisting of some few adjustments in about 5 files and running make) can stall for half a year, given the fact you tweeted me about "looking into it real soon" last year...

concat moonpaths, ";"

to_lua = (text, options={}) ->
to_lua = (text, options={}, litmoon=false) ->
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think adding another argument specific to litmoon is a good change to this interface. (If we add more formats are we supposed to keep adding new arguments?) Any reason you didn't re-purpose options?

Copy link
Contributor Author

nonchip commented Apr 14, 2016

you're right, i'll try to reimplement this using the options tables instead.

did kinda mistake them for being strictly structured stuff i'd better not touch...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /