-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Add Xmake language #7199
Add Xmake language #7199
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.
As this is only really a single file, we only need one sample. Please remove the others.
And I have installed github-linguist, but list-grammars does not work. ruki-2:linguist ruki$ gem install github-linguist
ruki-2:linguist ruki$ gem --version
3.6.2
ruki-2:linguist ruki$ ./script/list-grammars
Source locally installed gems is ignoring #<Bundler::StubSpecification name=websocket-driver version=0.7.1 platform=ruby> because it is missing extensions
Source locally installed gems is ignoring #<Bundler::StubSpecification name=nokogiri version=1.10.5 platform=ruby> because it is missing extensions
Source locally installed gems is ignoring #<Bundler::StubSpecification name=nio4r version=2.5.2 platform=ruby> because it is missing extensions
Source locally installed gems is ignoring #<Bundler::StubSpecification name=json version=1.8.6 platform=ruby> because it is missing extensions
Source locally installed gems is ignoring #<Bundler::StubSpecification name=gem-wrappers version=1.4.0 platform=ruby> because it is missing extensions
Source locally installed gems is ignoring #<Bundler::StubSpecification name=ffi version=1.11.2 platform=ruby> because it is missing extensions
Source locally installed gems is ignoring #<Bundler::StubSpecification name=ffi version=1.15.5 platform=ruby> because it is missing extensions
Source locally installed gems is ignoring #<Bundler::StubSpecification name=executable-hooks version=1.6.0 platform=ruby> because it is missing extensions
/usr/local/Cellar/ruby/3.4.1/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require': cannot load such file -- linguist/linguist (LoadError)
from /usr/local/Cellar/ruby/3.4.1/lib/ruby/3.4.0/bundled_gems.rb:82:in 'block (2 levels) in Kernel#replace_require'
from /Users/ruki/Downloads/linguist/lib/linguist/tokenizer.rb:2:in '<top (required)>'
from /usr/local/Cellar/ruby/3.4.1/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require'
from /usr/local/Cellar/ruby/3.4.1/lib/ruby/3.4.0/bundled_gems.rb:82:in 'block (2 levels) in Kernel#replace_require'
from /Users/ruki/Downloads/linguist/lib/linguist/classifier.rb:1:in '<top (required)>'
from /usr/local/Cellar/ruby/3.4.1/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require'
from /usr/local/Cellar/ruby/3.4.1/lib/ruby/3.4.0/bundled_gems.rb:82:in 'block (2 levels) in Kernel#replace_require'
from /Users/ruki/Downloads/linguist/lib/linguist/language.rb:9:in '<top (required)>'
from /usr/local/Cellar/ruby/3.4.1/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require'
from /usr/local/Cellar/ruby/3.4.1/lib/ruby/3.4.0/bundled_gems.rb:82:in 'block (2 levels) in Kernel#replace_require'
from /Users/ruki/Downloads/linguist/lib/linguist.rb:5:in '<top (required)>'
from /usr/local/Cellar/ruby/3.4.1/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require'
from /usr/local/Cellar/ruby/3.4.1/lib/ruby/3.4.0/bundled_gems.rb:82:in 'block (2 levels) in Kernel#replace_require'
from ./script/list-grammars:4:in '<main>' |
Installing the Linguist gem is not sufficient to setup the dev env. You need to follow the instructions in the CONTRIBUTING.md file. |
thanks, all tests are passed now. |
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.
🤔 why did you remove all of the samples? We need at least one.
Another question... why do we need a whole new language for this? A quick look suggests the current Lua classification is sufficient. |
If I add samples/xmake.lua it will be interfered by lua language and lead to wrong detection, because it will prioritize matching .lua extension instead of just matching xmake.lua file name.
we need only match filenames. so I moved Therefore, under the samples, there is still an xmake.lua, not none at all. Lines 96 to 108 in 1a30b0f
Although xmake.lua is based on lua, it has its own keywords, apis and syntax, and many native lua apis have been removed, so it is very different from lua, except for the most basic if else keywords. There are at least 80% differences. Therefore, it belongs to a new configuration language for the build system, not just lua. Just like meson, although based on python, it also has its own configuration language. There are also cmake, scons and ninja, all of which have their own configuration languages. I think xmake.lua should be regarded as a configuration language belonging to the xmake build system, and it should exist independently. |
Those errors are because you added the As we're only adding a filename, you only need to add a sample to |
oh, my mistake, I forgot to run Untracked files:
(use "git add <file>..." to include in what will be committed)
samples/Xmake/ |
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.
LGTM now. Thanks.
Important
The changes in this PR will not appear on GitHub until the next release has been made and deployed. See here for more details.
Description
This pull request adds support to Xmake buildsystem programming language. Here are some relevant resources:
Website: https://xmake.io/
GitHub Organization: xmake-io
Checklist:
#22a079