Skip to content
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

Compiler fixes #4215

Merged
merged 7 commits into from Aug 9, 2018
Merged

Compiler fixes #4215

merged 7 commits into from Aug 9, 2018

Conversation

kivikakk
Copy link
Contributor

Some fixes for the grammar compiler:

  • -linguist-path wasn't being used
  • some repositories have syntax files that don't declare a scope name (see ballerina.monarch.json) — these were being written to .json in the output directory, which will in turn crash prettylights when it tries to read .json from the grammar directory and can't find a scopeName in it.

/cc @vmg

@kivikakk
Copy link
Contributor Author

kivikakk commented Aug 1, 2018

Added:

  • Write a version file out with the version as stated in lib/linguist/version.rb so consumers of the grammars know what version of Linguist they correspond to.

@@ -248,13 +257,25 @@ func (conv *Converter) Report() error {
return nil
}

var VERSION_RE *regexp.Regexp = regexp.MustCompile("VERSION = \"(.+)\"")
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be a little cleaner to change version.rb to do VERSION = File.read("#{__dir__}/VERSION") to simplify this, but this is clever and works 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I prefer your suggestion 100%. Thank you!

It's actually 6.4.0, but I'm making a follow-up commit to bump "back" up to
6.3.9 so we have a single commit bumping the new version file usable as example
in CONTRIBUTING.md.  It makes sense, I swear.
@kivikakk kivikakk merged commit b9c934c into master Aug 9, 2018
@kivikakk kivikakk deleted the compiler-fixes branch August 9, 2018 05:47
@@ -1,3 +1,3 @@
module Linguist
VERSION = "6.4.0"
VERSION = File.read(File.expand_path("../VERSION", __FILE__)).strip
Copy link
Member

Choose a reason for hiding this comment

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

Nice. One less hack for the release script I've been slowly working on.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sweet!

@kivikakk kivikakk mentioned this pull request Aug 9, 2018
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.

None yet

4 participants