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

Update PHP highlighting #5677

Merged
merged 2 commits into from
Dec 8, 2021
Merged

Conversation

ondrejmirtes
Copy link
Contributor

Description

Based on #5668 I updated the repo that's used for PHP highlighting.

These are the features I added:

I tested these changes in the TextMate editor on macOS.

Checklist:

  • I am associating a language with a new file extension.

  • I am adding a new language.

  • I am fixing a misclassified language

    • I have included a new sample for the misclassified language:
      • Sample source(s):
        • [URL to each sample source, if applicable]
      • Sample license(s):
    • I have included a change to the heuristics to distinguish my language from others using the same extension.
  • I am changing the source of a syntax highlighting grammar

  • I am updating a grammar submodule

  • I am adding new or changing current functionality

    • I have added or updated the tests for the new or changed functionality.
  • I am changing the color associated with a language

    • I have obtained agreement from the wider language community on this color change.
      • [URL to public discussion]
      • [Optional: URL to official branding guidelines for the language]

@ondrejmirtes ondrejmirtes requested a review from a team as a code owner December 7, 2021 12:19
@ondrejmirtes ondrejmirtes changed the title Php submodule Update PHP highlighting Dec 7, 2021
Copy link
Member

@lildude lildude left a comment

Choose a reason for hiding this comment

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

Looks like you didn't use the add-grammar script as per the docs to switch out the grammars, or if you did you've forgotten to commit & push the updates to the grammars README and cached license files.

Please use that script to replace to grammars and or push the missing changed files.

Additionally, have you checked all the grammar changes correctly render on Lightshow? I ask because TextMate uses Oniguruma but GitHub uses PCRE and some of the Oniguruma syntax isn't 100% compatible.

@ondrejmirtes
Copy link
Contributor Author

Sorry, I haven't noticed that, I just thought that updating the submodule is sufficient.

I don't have much luck with the add-grammar script though, looks like it needs a specific local ruby setup and I'm not able to get it going.

This is the output I'm getting:

$ script/add-grammar --replace vendor/grammars/php.tmbundle https://github.com/ondrejmirtes/php.tmbundle
Checking Docker is installed and running
Deregistering submodule: vendor/grammars/php.tmbundle
Cleared directory 'vendor/grammars/php.tmbundle'
Submodule 'vendor/grammars/php.tmbundle' (https://github.com/textmate/php.tmbundle) unregistered for path 'vendor/grammars/php.tmbundle'
rm 'vendor/grammars/php.tmbundle'
Registering new submodule: https://github.com/ondrejmirtes/php.tmbundle.git
Reactivating local git directory for submodule 'vendor/grammars/php.tmbundle'
latest: Pulling from linguist/grammar-compiler
Digest: sha256:beea1cdeca326efc617bcf891584955e31f62cf3ec0947621454306452044dc0
Status: Image is up to date for linguist/grammar-compiler:latest
docker.io/linguist/grammar-compiler:latest
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
6 warnings found when compiling new grammar 'repository `vendor/grammars/php.tmbundle` (from https://github.com/ondrejmirtes/php.tmbundle)':
OK! added grammar source 'vendor/grammars/php.tmbundle'
	new scope: text.html.php
- Missing include in grammar: `text.html.php` (in `Syntaxes/PHP.plist`) attempts to include `text.html.basic` but the scope cannot be found
- Missing include in grammar: `text.html.php` (in `Syntaxes/PHP.plist`) attempts to include `source.sql` but the scope cannot be found
- Missing include in grammar: `text.html.php` (in `Syntaxes/PHP.plist`) attempts to include `text.xml` but the scope cannot be found
- Missing include in grammar: `text.html.php` (in `Syntaxes/PHP.plist`) attempts to include `source.js` but the scope cannot be found
- Missing include in grammar: `text.html.php` (in `Syntaxes/PHP.plist`) attempts to include `source.json` but the scope cannot be found
- Missing include in grammar: `text.html.php` (in `Syntaxes/PHP.plist`) attempts to include `source.css` but the scope cannot be found

These warnings are not fatal, but may mean the syntax highlighting on GitHub.com may not be as expected.

Caching grammar license
bundler: command not found: licensed
Install missing gem executables with `bundle install`

Why I try to run bundle install:

$ bundle install
Ignoring ffi-1.11.1 because its extensions are not built. Try: gem pristine ffi --version 1.11.1
Fetching gem metadata from https://rubygems.org/.......
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Using rake 13.0.6
Using public_suffix 4.0.6
Using addressable 2.8.0
Using bundler 1.17.2
Using byebug 11.1.3
Fetching charlock_holmes 0.7.7
Installing charlock_holmes 0.7.7 with native extensions
Errno::EACCES: Permission denied @ rb_sysopen -
/Users/ondrej/Development/linguist/vendor/bundle/ruby/2.6.0/gems/charlock_holmes-0.7.7/ext/charlock_holmes/common.h
An error occurred while installing charlock_holmes (0.7.7), and Bundler cannot continue.
Make sure that `gem install charlock_holmes -v '0.7.7' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  github-linguist was resolved to 7.17.0, which depends on
    charlock_holmes

With sudo I get some C compile errors looks like:

Output
$ sudo bundle install
Password:
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all
non-root users on this machine.
Ignoring ffi-1.11.1 because its extensions are not built. Try: gem pristine ffi --version 1.11.1
Fetching gem metadata from https://rubygems.org/.......
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Using rake 13.0.6
Using public_suffix 4.0.6
Using addressable 2.8.0
Using bundler 1.17.2
Using byebug 11.1.3
Fetching charlock_holmes 0.7.7
Installing charlock_holmes 0.7.7 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/ondrej/Development/linguist/vendor/bundle/ruby/2.6.0/gems/charlock_holmes-0.7.7/ext/charlock_holmes
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0
-r ./siteconf20211207-46753-rajdlv.rb extconf.rb
checking for -licui18n... yes
checking for unicode/ucnv.h... yes
checking for -lz... yes
checking for -licuuc... yes
checking for -licudata... yes
creating Makefile

current directory: /Users/ondrej/Development/linguist/vendor/bundle/ruby/2.6.0/gems/charlock_holmes-0.7.7/ext/charlock_holmes
make "DESTDIR=" clean

current directory: /Users/ondrej/Development/linguist/vendor/bundle/ruby/2.6.0/gems/charlock_holmes-0.7.7/ext/charlock_holmes
make "DESTDIR="
compiling converter.c
compiling encoding_detector.c
encoding_detector.c:31:32: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts
[-Wcompound-token-split-by-macro]
        rb_hash_aset(rb_match, ID2SYM(rb_intern("type")), ID2SYM(rb_intern("text")));
                                      ^~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1826:23:
note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                      ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:413:29:
note: expanded from macro 'ID2SYM'
#define ID2SYM(x) RB_ID2SYM(x)
                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:408:33:
note: expanded from macro 'RB_ID2SYM'
#define RB_ID2SYM(x) (rb_id2sym(x))
                                ^
encoding_detector.c:31:32: note: '{' token is here
        rb_hash_aset(rb_match, ID2SYM(rb_intern("type")), ID2SYM(rb_intern("text")));
                                      ^~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1826:24:
note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1811:5:
note: expanded from macro 'RUBY_CONST_ID_CACHE'
    {                                                   \
    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:413:29:
note: expanded from macro 'ID2SYM'
#define ID2SYM(x) RB_ID2SYM(x)
                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:408:33:
note: expanded from macro 'RB_ID2SYM'
#define RB_ID2SYM(x) (rb_id2sym(x))
                                ^
encoding_detector.c:31:32: warning: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts
[-Wcompound-token-split-by-macro]
        rb_hash_aset(rb_match, ID2SYM(rb_intern("type")), ID2SYM(rb_intern("text")));
                                      ^~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1826:24:
note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1816:5:
note: expanded from macro 'RUBY_CONST_ID_CACHE'
    }
    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:413:29:
note: expanded from macro 'ID2SYM'
#define ID2SYM(x) RB_ID2SYM(x)
                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:408:33:
note: expanded from macro 'RB_ID2SYM'
#define RB_ID2SYM(x) (rb_id2sym(x))
                                ^
encoding_detector.c:31:32: note: ')' token is here
        rb_hash_aset(rb_match, ID2SYM(rb_intern("type")), ID2SYM(rb_intern("text")));
                                      ^~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1826:56:
note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                                                       ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:413:29:
note: expanded from macro 'ID2SYM'
#define ID2SYM(x) RB_ID2SYM(x)
                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:408:33:
note: expanded from macro 'RB_ID2SYM'
#define RB_ID2SYM(x) (rb_id2sym(x))
                                ^
encoding_detector.c:31:59: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts
[-Wcompound-token-split-by-macro]
        rb_hash_aset(rb_match, ID2SYM(rb_intern("type")), ID2SYM(rb_intern("text")));
                                                                 ^~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1826:23:
note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                      ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:413:29:
note: expanded from macro 'ID2SYM'
#define ID2SYM(x) RB_ID2SYM(x)
                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:408:33:
note: expanded from macro 'RB_ID2SYM'
#define RB_ID2SYM(x) (rb_id2sym(x))
                                ^
encoding_detector.c:31:59: note: '{' token is here
        rb_hash_aset(rb_match, ID2SYM(rb_intern("type")), ID2SYM(rb_intern("text")));
                                                                 ^~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1826:24:
note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1811:5:
note: expanded from macro 'RUBY_CONST_ID_CACHE'
    {                                                   \
    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:413:29:
note: expanded from macro 'ID2SYM'
#define ID2SYM(x) RB_ID2SYM(x)
                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:408:33:
note: expanded from macro 'RB_ID2SYM'
#define RB_ID2SYM(x) (rb_id2sym(x))
                                ^
encoding_detector.c:31:59: warning: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts
[-Wcompound-token-split-by-macro]
        rb_hash_aset(rb_match, ID2SYM(rb_intern("type")), ID2SYM(rb_intern("text")));
                                                                 ^~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1826:24:
note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1816:5:
note: expanded from macro 'RUBY_CONST_ID_CACHE'
    }
    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:413:29:
note: expanded from macro 'ID2SYM'
#define ID2SYM(x) RB_ID2SYM(x)
                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:408:33:
note: expanded from macro 'RB_ID2SYM'
#define RB_ID2SYM(x) (rb_id2sym(x))
                                ^
encoding_detector.c:31:59: note: ')' token is here
        rb_hash_aset(rb_match, ID2SYM(rb_intern("type")), ID2SYM(rb_intern("text")));
                                                                 ^~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1826:56:
note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                                                       ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:413:29:
note: expanded from macro 'ID2SYM'
#define ID2SYM(x) RB_ID2SYM(x)
                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:408:33:
note: expanded from macro 'RB_ID2SYM'
#define RB_ID2SYM(x) (rb_id2sym(x))
                                ^
encoding_detector.c:34:32: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts
[-Wcompound-token-split-by-macro]
        rb_hash_aset(rb_match, ID2SYM(rb_intern("encoding")), enc_name);
                                      ^~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1826:23:
note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                      ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:413:29:
note: expanded from macro 'ID2SYM'
#define ID2SYM(x) RB_ID2SYM(x)
                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:408:33:
note: expanded from macro 'RB_ID2SYM'
#define RB_ID2SYM(x) (rb_id2sym(x))
                                ^
encoding_detector.c:34:32: note: '{' token is here
        rb_hash_aset(rb_match, ID2SYM(rb_intern("encoding")), enc_name);
                                      ^~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1826:24:
note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1811:5:
note: expanded from macro 'RUBY_CONST_ID_CACHE'
    {                                                   \
    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:413:29:
note: expanded from macro 'ID2SYM'
#define ID2SYM(x) RB_ID2SYM(x)
                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:408:33:
note: expanded from macro 'RB_ID2SYM'
#define RB_ID2SYM(x) (rb_id2sym(x))
                                ^
encoding_detector.c:34:32: warning: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts
[-Wcompound-token-split-by-macro]
        rb_hash_aset(rb_match, ID2SYM(rb_intern("encoding")), enc_name);
                                      ^~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1826:24:
note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1816:5:
note: expanded from macro 'RUBY_CONST_ID_CACHE'
    }
    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:413:29:
note: expanded from macro 'ID2SYM'
#define ID2SYM(x) RB_ID2SYM(x)
                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:408:33:
note: expanded from macro 'RB_ID2SYM'
#define RB_ID2SYM(x) (rb_id2sym(x))
                                ^
encoding_detector.c:34:32: note: ')' token is here
        rb_hash_aset(rb_match, ID2SYM(rb_intern("encoding")), enc_name);
                                      ^~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1826:56:
note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                                                       ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:413:29:
note: expanded from macro 'ID2SYM'
#define ID2SYM(x) RB_ID2SYM(x)
                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:408:33:
note: expanded from macro 'RB_ID2SYM'
#define RB_ID2SYM(x) (rb_id2sym(x))
                                ^
encoding_detector.c:39:33: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts
[-Wcompound-token-split-by-macro]
                rb_hash_aset(rb_match, ID2SYM(rb_intern("ruby_encoding")), compat_enc);
                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1826:23:
note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                      ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:413:29:
note: expanded from macro 'ID2SYM'
#define ID2SYM(x) RB_ID2SYM(x)
                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:408:33:
note: expanded from macro 'RB_ID2SYM'
#define RB_ID2SYM(x) (rb_id2sym(x))
                                ^
encoding_detector.c:39:33: note: '{' token is here
                rb_hash_aset(rb_match, ID2SYM(rb_intern("ruby_encoding")), compat_enc);
                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1826:24:
note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1811:5:
note: expanded from macro 'RUBY_CONST_ID_CACHE'
    {                                                   \
    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:413:29:
note: expanded from macro 'ID2SYM'
#define ID2SYM(x) RB_ID2SYM(x)
                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:408:33:
note: expanded from macro 'RB_ID2SYM'
#define RB_ID2SYM(x) (rb_id2sym(x))
                                ^
encoding_detector.c:39:33: warning: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts
[-Wcompound-token-split-by-macro]
                rb_hash_aset(rb_match, ID2SYM(rb_intern("ruby_encoding")), compat_enc);
                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1826:24:
note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1816:5:
note: expanded from macro 'RUBY_CONST_ID_CACHE'
    }
    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:413:29:
note: expanded from macro 'ID2SYM'
#define ID2SYM(x) RB_ID2SYM(x)
                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:408:33:
note: expanded from macro 'RB_ID2SYM'
#define RB_ID2SYM(x) (rb_id2sym(x))
                                ^
encoding_detector.c:39:33: note: ')' token is here
                rb_hash_aset(rb_match, ID2SYM(rb_intern("ruby_encoding")), compat_enc);
                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1826:56:
note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                                                       ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:413:29:
note: expanded from macro 'ID2SYM'
#define ID2SYM(x) RB_ID2SYM(x)
                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:408:33:
note: expanded from macro 'RB_ID2SYM'
#define RB_ID2SYM(x) (rb_id2sym(x))
                                ^
encoding_detector.c:42:32: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts
[-Wcompound-token-split-by-macro]
        rb_hash_aset(rb_match, ID2SYM(rb_intern("confidence")), INT2NUM(mconfidence));
                                      ^~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1826:23:
note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                      ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:413:29:
note: expanded from macro 'ID2SYM'
#define ID2SYM(x) RB_ID2SYM(x)
                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:408:33:
note: expanded from macro 'RB_ID2SYM'
#define RB_ID2SYM(x) (rb_id2sym(x))
                                ^
encoding_detector.c:42:32: note: '{' token is here
        rb_hash_aset(rb_match, ID2SYM(rb_intern("confidence")), INT2NUM(mconfidence));
                                      ^~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1826:24:
note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1811:5:
note: expanded from macro 'RUBY_CONST_ID_CACHE'
    {                                                   \
    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:413:29:
note: expanded from macro 'ID2SYM'
#define ID2SYM(x) RB_ID2SYM(x)
                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:408:33:
note: expanded from macro 'RB_ID2SYM'
#define RB_ID2SYM(x) (rb_id2sym(x))
                                ^
encoding_detector.c:42:32: warning: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts
[-Wcompound-token-split-by-macro]
        rb_hash_aset(rb_match, ID2SYM(rb_intern("confidence")), INT2NUM(mconfidence));
                                      ^~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1826:24:
note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1816:5:
note: expanded from macro 'RUBY_CONST_ID_CACHE'
    }
    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:413:29:
note: expanded from macro 'ID2SYM'
#define ID2SYM(x) RB_ID2SYM(x)
                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:408:33:
note: expanded from macro 'RB_ID2SYM'
#define RB_ID2SYM(x) (rb_id2sym(x))
                                ^
encoding_detector.c:42:32: note: ')' token is here
        rb_hash_aset(rb_match, ID2SYM(rb_intern("confidence")), INT2NUM(mconfidence));
                                      ^~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1826:56:
note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                                                       ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:413:29:
note: expanded from macro 'ID2SYM'
#define ID2SYM(x) RB_ID2SYM(x)
                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:408:33:
note: expanded from macro 'RB_ID2SYM'
#define RB_ID2SYM(x) (rb_id2sym(x))
                                ^
encoding_detector.c:45:33: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts
[-Wcompound-token-split-by-macro]
                rb_hash_aset(rb_match, ID2SYM(rb_intern("language")), charlock_new_str2(mlang));
                                              ^~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1826:23:
note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                      ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:413:29:
note: expanded from macro 'ID2SYM'
#define ID2SYM(x) RB_ID2SYM(x)
                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:408:33:
note: expanded from macro 'RB_ID2SYM'
#define RB_ID2SYM(x) (rb_id2sym(x))
                                ^
encoding_detector.c:45:33: note: '{' token is here
                rb_hash_aset(rb_match, ID2SYM(rb_intern("language")), charlock_new_str2(mlang));
                                              ^~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1826:24:
note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1811:5:
note: expanded from macro 'RUBY_CONST_ID_CACHE'
    {                                                   \
    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:413:29:
note: expanded from macro 'ID2SYM'
#define ID2SYM(x) RB_ID2SYM(x)
                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:408:33:
note: expanded from macro 'RB_ID2SYM'
#define RB_ID2SYM(x) (rb_id2sym(x))
                                ^
encoding_detector.c:45:33: warning: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts
[-Wcompound-token-split-by-macro]
                rb_hash_aset(rb_match, ID2SYM(rb_intern("language")), charlock_new_str2(mlang));
                                              ^~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1826:24:
note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1816:5:
note: expanded from macro 'RUBY_CONST_ID_CACHE'
    }
    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:413:29:
note: expanded from macro 'ID2SYM'
#define ID2SYM(x) RB_ID2SYM(x)
                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:408:33:
note: expanded from macro 'RB_ID2SYM'
#define RB_ID2SYM(x) (rb_id2sym(x))
                                ^
encoding_detector.c:45:33: note: ')' token is here
                rb_hash_aset(rb_match, ID2SYM(rb_intern("language")), charlock_new_str2(mlang));
                                              ^~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1826:56:
note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                                                       ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:413:29:
note: expanded from macro 'ID2SYM'
#define ID2SYM(x) RB_ID2SYM(x)
                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:408:33:
note: expanded from macro 'RB_ID2SYM'
#define RB_ID2SYM(x) (rb_id2sym(x))
                                ^
encoding_detector.c:55:32: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts
[-Wcompound-token-split-by-macro]
        rb_hash_aset(rb_match, ID2SYM(rb_intern("type")), ID2SYM(rb_intern("binary")));
                                      ^~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1826:23:
note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                      ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:413:29:
note: expanded from macro 'ID2SYM'
#define ID2SYM(x) RB_ID2SYM(x)
                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:408:33:
note: expanded from macro 'RB_ID2SYM'
#define RB_ID2SYM(x) (rb_id2sym(x))
                                ^
encoding_detector.c:55:32: note: '{' token is here
        rb_hash_aset(rb_match, ID2SYM(rb_intern("type")), ID2SYM(rb_intern("binary")));
                                      ^~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1826:24:
note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1811:5:
note: expanded from macro 'RUBY_CONST_ID_CACHE'
    {                                                   \
    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:413:29:
note: expanded from macro 'ID2SYM'
#define ID2SYM(x) RB_ID2SYM(x)
                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:408:33:
note: expanded from macro 'RB_ID2SYM'
#define RB_ID2SYM(x) (rb_id2sym(x))
                                ^
encoding_detector.c:55:32: warning: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts
[-Wcompound-token-split-by-macro]
        rb_hash_aset(rb_match, ID2SYM(rb_intern("type")), ID2SYM(rb_intern("binary")));
                                      ^~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1826:24:
note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1816:5:
note: expanded from macro 'RUBY_CONST_ID_CACHE'
    }
    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:413:29:
note: expanded from macro 'ID2SYM'
#define ID2SYM(x) RB_ID2SYM(x)
                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:408:33:
note: expanded from macro 'RB_ID2SYM'
#define RB_ID2SYM(x) (rb_id2sym(x))
                                ^
encoding_detector.c:55:32: note: ')' token is here
        rb_hash_aset(rb_match, ID2SYM(rb_intern("type")), ID2SYM(rb_intern("binary")));
                                      ^~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1826:56:
note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                                                       ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:413:29:
note: expanded from macro 'ID2SYM'
#define ID2SYM(x) RB_ID2SYM(x)
                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:408:33:
note: expanded from macro 'RB_ID2SYM'
#define RB_ID2SYM(x) (rb_id2sym(x))
                                ^
encoding_detector.c:55:59: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts
[-Wcompound-token-split-by-macro]
        rb_hash_aset(rb_match, ID2SYM(rb_intern("type")), ID2SYM(rb_intern("binary")));
                                                                 ^~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1826:23:
note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                      ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:413:29:
note: expanded from macro 'ID2SYM'
#define ID2SYM(x) RB_ID2SYM(x)
                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:408:33:
note: expanded from macro 'RB_ID2SYM'
#define RB_ID2SYM(x) (rb_id2sym(x))
                                ^
encoding_detector.c:55:59: note: '{' token is here
        rb_hash_aset(rb_match, ID2SYM(rb_intern("type")), ID2SYM(rb_intern("binary")));
                                                                 ^~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1826:24:
note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1811:5:
note: expanded from macro 'RUBY_CONST_ID_CACHE'
    {                                                   \
    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:413:29:
note: expanded from macro 'ID2SYM'
#define ID2SYM(x) RB_ID2SYM(x)
                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:408:33:
note: expanded from macro 'RB_ID2SYM'
#define RB_ID2SYM(x) (rb_id2sym(x))
                                ^
encoding_detector.c:55:59: warning: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts
[-Wcompound-token-split-by-macro]
        rb_hash_aset(rb_match, ID2SYM(rb_intern("type")), ID2SYM(rb_intern("binary")));
                                                                 ^~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1826:24:
note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1816:5:
note: expanded from macro 'RUBY_CONST_ID_CACHE'
    }
    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:413:29:
note: expanded from macro 'ID2SYM'
#define ID2SYM(x) RB_ID2SYM(x)
                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:408:33:
note: expanded from macro 'RB_ID2SYM'
#define RB_ID2SYM(x) (rb_id2sym(x))
                                ^
encoding_detector.c:55:59: note: ')' token is here
        rb_hash_aset(rb_match, ID2SYM(rb_intern("type")), ID2SYM(rb_intern("binary")));
                                                                 ^~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1826:56:
note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                                                       ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:413:29:
note: expanded from macro 'ID2SYM'
#define ID2SYM(x) RB_ID2SYM(x)
                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:408:33:
note: expanded from macro 'RB_ID2SYM'
#define RB_ID2SYM(x) (rb_id2sym(x))
                                ^
encoding_detector.c:56:32: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts
[-Wcompound-token-split-by-macro]
        rb_hash_aset(rb_match, ID2SYM(rb_intern("confidence")), INT2NUM(100));
                                      ^~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1826:23:
note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                      ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:413:29:
note: expanded from macro 'ID2SYM'
#define ID2SYM(x) RB_ID2SYM(x)
                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:408:33:
note: expanded from macro 'RB_ID2SYM'
#define RB_ID2SYM(x) (rb_id2sym(x))
                                ^
encoding_detector.c:56:32: note: '{' token is here
        rb_hash_aset(rb_match, ID2SYM(rb_intern("confidence")), INT2NUM(100));
                                      ^~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1826:24:
note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1811:5:
note: expanded from macro 'RUBY_CONST_ID_CACHE'
    {                                                   \
    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:413:29:
note: expanded from macro 'ID2SYM'
#define ID2SYM(x) RB_ID2SYM(x)
                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:408:33:
note: expanded from macro 'RB_ID2SYM'
#define RB_ID2SYM(x) (rb_id2sym(x))
                                ^
encoding_detector.c:56:32: warning: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts
[-Wcompound-token-split-by-macro]
        rb_hash_aset(rb_match, ID2SYM(rb_intern("confidence")), INT2NUM(100));
                                      ^~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1826:24:
note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1816:5:
note: expanded from macro 'RUBY_CONST_ID_CACHE'
    }
    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:413:29:
note: expanded from macro 'ID2SYM'
#define ID2SYM(x) RB_ID2SYM(x)
                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:408:33:
note: expanded from macro 'RB_ID2SYM'
#define RB_ID2SYM(x) (rb_id2sym(x))
                                ^
encoding_detector.c:56:32: note: ')' token is here
        rb_hash_aset(rb_match, ID2SYM(rb_intern("confidence")), INT2NUM(100));
                                      ^~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1826:56:
note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                                                       ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:413:29:
note: expanded from macro 'ID2SYM'
#define ID2SYM(x) RB_ID2SYM(x)
                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:408:33:
note: expanded from macro 'RB_ID2SYM'
#define RB_ID2SYM(x) (rb_id2sym(x))
                                ^
18 warnings generated.
compiling ext.c
compiling transliterator.cpp
In file included from transliterator.cpp:1:
In file included from ./common.h:9:
In file included from
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby.h:33:
In file included from
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:24:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/universal-darwin21/ruby/config.h:415:31:
error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]
#define RUBY_ARCH "universal-"RUBY_PLATFORM_OS
                              ^

/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/universal-darwin21/ruby/config.h:416:35:
error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]
#define RUBY_PLATFORM "universal."RUBY_PLATFORM_CPU"-"RUBY_PLATFORM_OS
                                  ^

/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/universal-darwin21/ruby/config.h:416:55:
error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]
#define RUBY_PLATFORM "universal."RUBY_PLATFORM_CPU"-"RUBY_PLATFORM_OS
                                                      ^

In file included from transliterator.cpp:1:
In file included from ./common.h:9:
In file included from
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby.h:33:
In file included from
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:2111:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/intern.h:56:19:
warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
void rb_mem_clear(register VALUE*, register long);
                  ^~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/intern.h:56:36:
warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
void rb_mem_clear(register VALUE*, register long);
                                   ^~~~~~~~~
transliterator.cpp:121:63: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts
[-Wcompound-token-split-by-macro]
  rb_eEncodingCompatibilityError = rb_const_get(rb_cEncoding, rb_intern("CompatibilityError"));
                                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1826:23:
note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                      ^
transliterator.cpp:121:63: note: '{' token is here
  rb_eEncodingCompatibilityError = rb_const_get(rb_cEncoding, rb_intern("CompatibilityError"));
                                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1826:24:
note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1811:5:
note: expanded from macro 'RUBY_CONST_ID_CACHE'
    {                                                   \
    ^
transliterator.cpp:121:63: warning: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts
[-Wcompound-token-split-by-macro]
  rb_eEncodingCompatibilityError = rb_const_get(rb_cEncoding, rb_intern("CompatibilityError"));
                                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1826:24:
note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1816:5:
note: expanded from macro 'RUBY_CONST_ID_CACHE'
    }
    ^
transliterator.cpp:121:63: note: ')' token is here
  rb_eEncodingCompatibilityError = rb_const_get(rb_cEncoding, rb_intern("CompatibilityError"));
                                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1826:56:
note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                                                       ^
4 warnings and 3 errors generated.
make: *** [transliterator.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/ondrej/Development/linguist/vendor/bundle/ruby/2.6.0/gems/charlock_holmes-0.7.7 for inspection.
Results logged to
/Users/ondrej/Development/linguist/vendor/bundle/ruby/2.6.0/extensions/universal-darwin-21/2.6.0/charlock_holmes-0.7.7/gem_make.out

An error occurred while installing charlock_holmes (0.7.7), and Bundler cannot continue.
Make sure that `gem install charlock_holmes -v '0.7.7' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  github-linguist was resolved to 7.17.0, which depends on
    charlock_holmes

And I don't know how to move forward with that :/

@lildude
Copy link
Member

lildude commented Dec 7, 2021

Ah, looks like you're hitting one of the many problems with the macOS-supplied version of Ruby, which is why we discourage its use in the first part of the CONTRIBUTING.md file.

You'll find all your problems disappear if you use a Ruby installed via one of the other means.

@ondrejmirtes
Copy link
Contributor Author

Alright, I installed ruby and gcc through Homebrew and looks like I'm getting further. Now the script is running something in Docker and it's taking a long time. It's something from this image linguist/grammar-compiler:latest and the output is:

 376 / 382   98.43% 1ss

 376 / 382   98.43%

 376 / 382   98.43%

 376 / 382   98.43%

 376 / 382   98.43%

 376 / 382   98.43%

 376 / 382   98.43%

 376 / 382   98.43%

 376 / 382   98.43%

 376 / 382   98.43%

Let's see if it finishes.

@ondrejmirtes
Copy link
Contributor Author

Alright, I got at the end but I realized I have to initialize and update all the submodules, otherwise the add-grammar script just deletes most of the grammars.yml file etc. I'll update the PR once I get to a sensible diff.

@ondrejmirtes
Copy link
Contributor Author

Should be fine now, thank you.

@ondrejmirtes
Copy link
Contributor Author

Build failed, so I updated vendor/licenses/git_submodule/php.tmbundle.dep.yml.

Copy link
Member

@lildude lildude left a comment

Choose a reason for hiding this comment

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

Thanks for taking on maintaining this grammar.

@lildude lildude merged commit 807be51 into github-linguist:master Dec 8, 2021
@ondrejmirtes
Copy link
Contributor Author

Awesome, thank you! 👏

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

2 participants