Skip to content

Support multi line interpreter directive comments #1470

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

Merged

Conversation

harendra-kumar
Copy link
Collaborator

Multi line block comments can now be used for additional stack arguments
when stack is used as script interpreter. Like this:

{- stack
  --verbosity silent
  --resolver lts-3.14
  --install-ghc
  runghc
  --package random
  --package system-argv0
-}

Newlines are ignored in the block comments. This allows for better
formatting of longer commands.

Previous single line format is supported as usual. The single line
syntax now allows a missing space between comment marker and the start
of command i.e. --stack ... too works now.

Updated the guide with complete syntax and semantics.

Closes #1394

Multi line block comments can now be used for additional stack arguments
when stack is used as script interpreter. Like this:

{- stack
  --verbosity silent
  --resolver lts-3.14
  --install-ghc
  runghc
  --package random
  --package system-argv0
-}

Newlines are ignored in the block comments. This allows for better
formatting of longer commands.

Previous single line format is supported as usual. The single line
syntax now allows a missing space between comment marker and the start
of command i.e. "--stack ..." too works now.

Updated the guide with complete syntax and semantics.

Closes commercialhaskell#1394
-- after validating the placement and formatting rules for a valid
-- interpreter specification.

interpParser :: String -> Parser Text String
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor nitpick: How about interpreterArgsParser? While we do abbreviate things here and there, it's a bit arbitrary to shorten interpreter to interp.

@mgsloan
Copy link
Contributor

mgsloan commented Dec 7, 2015

LGTM! Since all I've got is that minor nitpick, I'm going to just merge and add a commit with the rename

mgsloan added a commit that referenced this pull request Dec 7, 2015
Support multi line interpreter directive comments
@mgsloan mgsloan merged commit 3626a54 into commercialhaskell:master Dec 7, 2015
mgsloan added a commit that referenced this pull request Dec 7, 2015
@mgsloan
Copy link
Contributor

mgsloan commented Dec 7, 2015

I ended up making the following changes: e44d57c

@harendra-kumar
Copy link
Collaborator Author

Great! I was looking for the missing piece i.e. sinkParser but was not aware of its existence. Thanks for cleaning it up.

@harendra-kumar harendra-kumar deleted the interp-block-comments branch December 7, 2015 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support multiline script interpreter directive for better readability
2 participants