diff --git a/.gitmodules b/.gitmodules
index 98dbcfb2..be2d7b30 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -646,7 +646,7 @@
url = https://github.com/SRI-CSL/SMT.tmbundle.git
[submodule "vendor/grammars/language-crystal"]
path = vendor/grammars/language-crystal
- url = https://github.com/k2b6s9j/language-crystal
+ url = https://github.com/atom-crystal/language-crystal
[submodule "vendor/grammars/language-xbase"]
path = vendor/grammars/language-xbase
url = https://github.com/hernad/atom-language-harbour
@@ -680,3 +680,6 @@
[submodule "vendor/grammars/Stata.tmbundle"]
path = vendor/grammars/Stata.tmbundle
url = https://github.com/pschumm/Stata.tmbundle
+[submodule "vendor/grammars/FreeMarker.tmbundle"]
+ path = vendor/grammars/FreeMarker.tmbundle
+ url = https://github.com/freemarker/FreeMarker.tmbundle
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 1d358957..56ef275f 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -12,7 +12,7 @@ We try only to add new extensions once they have some usage on GitHub. In most c
To add support for a new extension:
-0. Add your extension to the language entry in [`languages.yml`][languages].
+0. Add your extension to the language entry in [`languages.yml`][languages], keeping the extensions in alphabetical order.
0. Add at least one sample for your extension to the [samples directory][samples] in the correct subdirectory.
0. Open a pull request, linking to a [GitHub search result](https://github.com/search?utf8=%E2%9C%93&q=extension%3Aboot+NOT+nothack&type=Code&ref=searchresults) showing in-the-wild usage.
diff --git a/README.md b/README.md
index 2a4d3c31..33b976d2 100644
--- a/README.md
+++ b/README.md
@@ -17,7 +17,7 @@ The Language stats bar displays languages percentages for the files in the repos
0. Click on the name of the language in the stats bar to see a list of the files that are identified as that language.
0. If you see files that you didn't write, consider moving the files into one of the [paths for vendored code](/lib/linguist/vendor.yml), or use the [manual overrides](#overrides) feature to ignore them.
-0. If the files are being misclassified, search for [open issues][issues] to see if anyone else has already reported the issue. Any information you an add, especially links to public repositories, is helpful.
+0. If the files are being misclassified, search for [open issues][issues] to see if anyone else has already reported the issue. Any information you can add, especially links to public repositories, is helpful.
0. If there are no reported issues of this misclassification, [open an issue][new-issue] and include a link to the repository or a sample of the code that is being misclassified.
## Overrides
diff --git a/grammars.yml b/grammars.yml
index 4bd66f12..c2be7632 100644
--- a/grammars.yml
+++ b/grammars.yml
@@ -42,6 +42,8 @@ vendor/grammars/Docker.tmbundle:
- source.dockerfile
vendor/grammars/Elm.tmLanguage:
- source.elm
+vendor/grammars/FreeMarker.tmbundle:
+- text.html.ftl
vendor/grammars/G-Code/:
- source.LS
- source.MCPOST
@@ -248,6 +250,7 @@ vendor/grammars/elixir-tmbundle:
- source.elixir
- text.elixir
- text.html.elixir
+- text.html.eex
vendor/grammars/erlang.tmbundle:
- source.erlang
- text.html.erlang.yaws
diff --git a/lib/linguist/generated.rb b/lib/linguist/generated.rb
index d107e737..35766e4d 100644
--- a/lib/linguist/generated.rb
+++ b/lib/linguist/generated.rb
@@ -71,7 +71,8 @@ module Linguist
generated_jni_header? ||
vcr_cassette? ||
generated_module? ||
- generated_unity3d_meta?
+ generated_unity3d_meta? ||
+ generated_racc?
end
# Internal: Is the blob an Xcode file?
@@ -359,5 +360,18 @@ module Linguist
return false unless lines.count > 1
return lines[0].include?("fileFormatVersion: ")
end
+
+ # Internal: Is this a Racc-generated file?
+ #
+ # A Racc-generated file contains:
+ # # This file is automatically generated by Racc x.y.z
+ # on the third line.
+ #
+ # Return true or false
+ def generated_racc?
+ return false unless extname == '.rb'
+ return false unless lines.count > 2
+ return lines[2].start_with?("# This file is automatically generated by Racc")
+ end
end
end
diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml
index d7a3a18b..107dc3d1 100644
--- a/lib/linguist/languages.yml
+++ b/lib/linguist/languages.yml
@@ -1037,6 +1037,16 @@ Frege:
tm_scope: source.haskell
ace_mode: haskell
+FreeMarker:
+ type: programming
+ color: "#0050b2"
+ aliases:
+ - ftl
+ extensions:
+ - .ftl
+ tm_scope: text.html.ftl
+ ace_mode: ftl
+
G-code:
type: data
extensions:
@@ -1323,6 +1333,16 @@ HTML+Django:
- htmldjango
ace_mode: django
+HTML+EEX:
+ type: markup
+ tm_scope: text.html.eex
+ group: HTML
+ aliases:
+ - eex
+ extensions:
+ - .eex
+ ace_mode: html_eex
+
HTML+ERB:
type: markup
tm_scope: text.html.erb
@@ -2063,6 +2083,14 @@ Mercury:
tm_scope: source.mercury
ace_mode: prolog
+Metal:
+ type: programming
+ color: "#8f14e9"
+ extensions:
+ - .metal
+ tm_scope: source.c++
+ ace_mode: c_cpp
+
MiniD: # Legacy
type: programming
searchable: false
@@ -2441,6 +2469,7 @@ PHP:
- .php3
- .php4
- .php5
+ - .phps
- .phpt
filenames:
- Phakefile
diff --git a/samples/FreeMarker/example.ftl b/samples/FreeMarker/example.ftl
new file mode 100644
index 00000000..10a6ee95
--- /dev/null
+++ b/samples/FreeMarker/example.ftl
@@ -0,0 +1,31 @@
+<#import "layout.ftl" as layout>
+
+<#assign results = [
+ {
+ "title": "Example Result",
+ "description": "Lorem ipsum dolor sit amet, pede id pellentesque, sollicitudin turpis sed in sed sed, libero dictum."
+ }
+ ] />
+
+<@layout.page title="FreeMarker Example">
+ <#if results?size == 0>
+ There were no results.
+ <#else>
+
+ <#list results as result>
+ -
+ ${result.title}
+
${result.description}
+
+ #list>
+
+ #if>
+
+ <#-- This is a FreeMarker comment -->
+ <@currentTime />
+@layout.page>
+
+
+<#macro currentTime>
+ ${.now?string.full}
+#macro>
diff --git a/samples/FreeMarker/layout.ftl b/samples/FreeMarker/layout.ftl
new file mode 100644
index 00000000..18512dd6
--- /dev/null
+++ b/samples/FreeMarker/layout.ftl
@@ -0,0 +1,32 @@
+<#ftl strip_text=true />
+
+<#macro page title>
+
+
+
+ ${title}
+ <@metaTags />
+
+
+ <#nested />
+ <@footer />
+
+
+#macro>
+
+
+<#---
+ Default meta tags
+-->
+<#macro metaTags>
+ <#compress>
+
+
+
+
+ #compress>
+#macro>
+
+<#macro footer>
+ This page is using FreeMarker v${.version}
+#macro>
diff --git a/samples/HTML+EEX/index.html.erb b/samples/HTML+EEX/index.html.erb
new file mode 100644
index 00000000..5960a441
--- /dev/null
+++ b/samples/HTML+EEX/index.html.erb
@@ -0,0 +1,26 @@
+Listing Books
+
+
+
+ | Title |
+ Summary |
+ |
+ |
+ |
+
+
+<%= for book <- @books do %>
+
+ <%# comment %>
+ | <%= book.title %> |
+ <%= book.content %> |
+ <%= link "Show", to: book_path(@conn, :show, book) %> |
+ <%= link "Edit", to: book_path(@conn, :edit, book) %> |
+ <%= link "Delete", to: book_path(@conn, :delete, book), method: :delete, data: [confirm: "Are you sure?"] %> |
+
+<% end %>
+
+
+
+
+<%= link "New book", to: book_path(@conn, :new) %>
diff --git a/samples/Metal/ITMVisualisationEngine.metal b/samples/Metal/ITMVisualisationEngine.metal
new file mode 100644
index 00000000..a1372178
--- /dev/null
+++ b/samples/Metal/ITMVisualisationEngine.metal
@@ -0,0 +1,99 @@
+// Copyright 2014 Isis Innovation Limited and the authors of InfiniTAM
+
+#include
+
+#include "../../DeviceAgnostic/ITMSceneReconstructionEngine.h"
+#include "../../DeviceAgnostic/ITMVisualisationEngine.h"
+#include "ITMVisualisationEngine_Metal.h"
+
+using namespace metal;
+
+kernel void genericRaycastVH_device(DEVICEPTR(Vector4f) *pointsRay [[ buffer(0) ]],
+ const CONSTPTR(ITMVoxel) *voxelData [[ buffer(1) ]],
+ const CONSTPTR(typename ITMVoxelIndex::IndexData) *voxelIndex [[ buffer(2) ]],
+ const CONSTPTR(Vector2f) *minmaxdata [[ buffer(3) ]],
+ const CONSTPTR(CreateICPMaps_Params) *params [[ buffer(4) ]],
+ uint2 threadIdx [[ thread_position_in_threadgroup ]],
+ uint2 blockIdx [[ threadgroup_position_in_grid ]],
+ uint2 blockDim [[ threads_per_threadgroup ]])
+{
+ int x = threadIdx.x + blockIdx.x * blockDim.x, y = threadIdx.y + blockIdx.y * blockDim.y;
+
+ if (x >= params->imgSize.x || y >= params->imgSize.y) return;
+
+ int locId = x + y * params->imgSize.x;
+ int locId2 = (int)floor((float)x / minmaximg_subsample) + (int)floor((float)y / minmaximg_subsample) * params->imgSize.x;
+
+ castRay(pointsRay[locId], x, y, voxelData, voxelIndex, params->invM, params->invProjParams,
+ params->voxelSizes.y, params->lightSource.w, minmaxdata[locId2]);
+}
+
+kernel void genericRaycastVGMissingPoints_device(DEVICEPTR(Vector4f) *forwardProjection [[ buffer(0) ]],
+ const CONSTPTR(int) *fwdProjMissingPoints [[ buffer(1) ]],
+ const CONSTPTR(ITMVoxel) *voxelData [[ buffer(2) ]],
+ const CONSTPTR(typename ITMVoxelIndex::IndexData) *voxelIndex [[ buffer(3) ]],
+ const CONSTPTR(Vector2f) *minmaxdata [[ buffer(4) ]],
+ const CONSTPTR(CreateICPMaps_Params) *params [[ buffer(5) ]],
+ uint2 threadIdx [[ thread_position_in_threadgroup ]],
+ uint2 blockIdx [[ threadgroup_position_in_grid ]],
+ uint2 blockDim [[ threads_per_threadgroup ]])
+{
+ int pointId = threadIdx.x + blockIdx.x * blockDim.x;
+
+ if (pointId >= params->imgSize.z) return;
+
+ int locId = fwdProjMissingPoints[pointId];
+ int y = locId / params->imgSize.x, x = locId - y * params->imgSize.x;
+ int locId2 = (int)floor((float)x / minmaximg_subsample) + (int)floor((float)y / minmaximg_subsample) * params->imgSize.x;
+
+ castRay(forwardProjection[locId], x, y, voxelData, voxelIndex, params->invM, params->invProjParams,
+ params->voxelSizes.y, params->lightSource.w, minmaxdata[locId2]);
+}
+
+kernel void renderICP_device(const CONSTPTR(Vector4f) *pointsRay [[ buffer(0) ]],
+ DEVICEPTR(Vector4f) *pointsMap [[ buffer(1) ]],
+ DEVICEPTR(Vector4f) *normalsMap [[ buffer(2) ]],
+ DEVICEPTR(Vector4u) *outRendering [[ buffer(3) ]],
+ const CONSTPTR(CreateICPMaps_Params) *params [[ buffer(4) ]],
+ uint2 threadIdx [[ thread_position_in_threadgroup ]],
+ uint2 blockIdx [[ threadgroup_position_in_grid ]],
+ uint2 blockDim [[ threads_per_threadgroup ]])
+{
+ int x = threadIdx.x + blockIdx.x * blockDim.x, y = threadIdx.y + blockIdx.y * blockDim.y;
+
+ if (x >= params->imgSize.x || y >= params->imgSize.y) return;
+
+ processPixelICP(outRendering, pointsMap, normalsMap, pointsRay, params->imgSize.xy, x, y, params->voxelSizes.x, TO_VECTOR3(params->lightSource));
+}
+
+kernel void renderForward_device(DEVICEPTR(Vector4u) *outRendering [[ buffer(0) ]],
+ const CONSTPTR(Vector4f) *pointsRay [[ buffer(1) ]],
+ const CONSTPTR(CreateICPMaps_Params) *params [[ buffer(2) ]],
+ uint2 threadIdx [[ thread_position_in_threadgroup ]],
+ uint2 blockIdx [[ threadgroup_position_in_grid ]],
+ uint2 blockDim [[ threads_per_threadgroup ]])
+{
+ int x = threadIdx.x + blockIdx.x * blockDim.x, y = threadIdx.y + blockIdx.y * blockDim.y;
+
+ if (x >= params->imgSize.x || y >= params->imgSize.y) return;
+
+ processPixelForwardRender(outRendering, pointsRay, params->imgSize.xy, x, y, params->voxelSizes.x, TO_VECTOR3(params->lightSource));
+}
+
+kernel void forwardProject_device(DEVICEPTR(Vector4f) *forwardProjection [[ buffer(0) ]],
+ const CONSTPTR(Vector4f) *pointsRay [[ buffer(1) ]],
+ const CONSTPTR(CreateICPMaps_Params) *params [[ buffer(2) ]],
+ uint2 threadIdx [[ thread_position_in_threadgroup ]],
+ uint2 blockIdx [[ threadgroup_position_in_grid ]],
+ uint2 blockDim [[ threads_per_threadgroup ]])
+{
+ int x = (threadIdx.x + blockIdx.x * blockDim.x), y = (threadIdx.y + blockIdx.y * blockDim.y);
+
+ if (x >= params->imgSize.x || y >= params->imgSize.y) return;
+
+ int locId = x + y * params->imgSize.x;
+ Vector4f pixel = pointsRay[locId];
+
+ int locId_new = forwardProjectPixel(pixel * params->voxelSizes.x, params->M, params->projParams, params->imgSize.xy);
+ if (locId_new >= 0) forwardProjection[locId_new] = pixel;
+}
\ No newline at end of file
diff --git a/samples/PHP/mail.phps b/samples/PHP/mail.phps
new file mode 100644
index 00000000..8e129f47
--- /dev/null
+++ b/samples/PHP/mail.phps
@@ -0,0 +1,31 @@
+setFrom('from@example.com', 'First Last');
+//Set an alternative reply-to address
+$mail->addReplyTo('replyto@example.com', 'First Last');
+//Set who the message is to be sent to
+$mail->addAddress('whoto@example.com', 'John Doe');
+//Set the subject line
+$mail->Subject = 'PHPMailer mail() test';
+//Read an HTML message body from an external file, convert referenced images to embedded,
+//convert HTML into a basic plain-text alternative body
+$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));
+//Replace the plain text body with one created manually
+$mail->AltBody = 'This is a plain-text message body';
+//Attach an image file
+$mail->addAttachment('images/phpmailer_mini.png');
+
+//send the message, check for errors
+if (!$mail->send()) {
+ echo "Mailer Error: " . $mail->ErrorInfo;
+} else {
+ echo "Message sent!";
+}
diff --git a/samples/Ruby/racc.rb b/samples/Ruby/racc.rb
new file mode 100644
index 00000000..a3e7f51c
--- /dev/null
+++ b/samples/Ruby/racc.rb
@@ -0,0 +1,267 @@
+#
+# DO NOT MODIFY!!!!
+# This file is automatically generated by Racc 1.4.7
+# from Racc grammer file "".
+#
+
+require 'racc/parser.rb'
+module RJSON
+ class Parser < Racc::Parser
+
+
+ require 'rjson/handler'
+
+ attr_reader :handler
+
+ def initialize tokenizer, handler = Handler.new
+ @tokenizer = tokenizer
+ @handler = handler
+ super()
+ end
+
+ def next_token
+ @tokenizer.next_token
+ end
+
+ def parse
+ do_parse
+ handler
+ end
+##### State transition tables begin ###
+
+racc_action_table = [
+ 9, 33, 9, 11, 13, 16, 19, 22, 9, 7,
+ 23, 1, 9, 11, 13, 16, 19, 29, 30, 7,
+ 21, 1, 9, 11, 13, 16, 19, 31, nil, 7,
+ 21, 1, 23, 7, nil, 1 ]
+
+racc_action_check = [
+ 6, 27, 33, 33, 33, 33, 33, 3, 31, 33,
+ 6, 33, 29, 29, 29, 29, 29, 12, 22, 29,
+ 12, 29, 2, 2, 2, 2, 2, 25, nil, 2,
+ 2, 2, 25, 0, nil, 0 ]
+
+racc_action_pointer = [
+ 24, nil, 20, 7, nil, nil, -2, nil, nil, nil,
+ nil, nil, 10, nil, nil, nil, nil, nil, nil, nil,
+ nil, nil, 18, nil, nil, 20, nil, -7, nil, 10,
+ nil, 6, nil, 0, nil, nil, nil ]
+
+racc_action_default = [
+ -27, -12, -21, -27, -1, -2, -27, -10, -15, -26,
+ -8, -22, -27, -23, -17, -16, -24, -20, -18, -25,
+ -19, -11, -27, -13, -3, -27, -6, -27, -9, -21,
+ 37, -27, -4, -21, -14, -5, -7 ]
+
+racc_goto_table = [
+ 8, 26, 24, 27, 10, 3, 25, 5, 4, 12,
+ nil, nil, nil, nil, 28, nil, nil, nil, nil, nil,
+ nil, 32, nil, nil, nil, nil, 35, 34, 27, nil,
+ nil, 36 ]
+
+racc_goto_check = [
+ 9, 7, 5, 8, 11, 1, 6, 3, 2, 12,
+ nil, nil, nil, nil, 11, nil, nil, nil, nil, nil,
+ nil, 5, nil, nil, nil, nil, 7, 9, 8, nil,
+ nil, 9 ]
+
+racc_goto_pointer = [
+ nil, 5, 8, 7, nil, -4, 0, -5, -3, -2,
+ nil, 2, 7, nil, nil ]
+
+racc_goto_default = [
+ nil, nil, 14, 18, 6, nil, nil, nil, 20, nil,
+ 2, nil, nil, 15, 17 ]
+
+racc_reduce_table = [
+ 0, 0, :racc_error,
+ 1, 14, :_reduce_none,
+ 1, 14, :_reduce_none,
+ 2, 15, :_reduce_none,
+ 3, 15, :_reduce_none,
+ 3, 19, :_reduce_none,
+ 1, 19, :_reduce_none,
+ 3, 20, :_reduce_none,
+ 2, 16, :_reduce_none,
+ 3, 16, :_reduce_none,
+ 1, 23, :_reduce_10,
+ 1, 24, :_reduce_11,
+ 1, 17, :_reduce_12,
+ 1, 18, :_reduce_13,
+ 3, 25, :_reduce_none,
+ 1, 25, :_reduce_none,
+ 1, 22, :_reduce_none,
+ 1, 22, :_reduce_none,
+ 1, 22, :_reduce_none,
+ 1, 26, :_reduce_none,
+ 1, 26, :_reduce_20,
+ 0, 27, :_reduce_none,
+ 1, 27, :_reduce_22,
+ 1, 27, :_reduce_23,
+ 1, 27, :_reduce_24,
+ 1, 27, :_reduce_25,
+ 1, 21, :_reduce_26 ]
+
+racc_reduce_n = 27
+
+racc_shift_n = 37
+
+racc_token_table = {
+ false => 0,
+ :error => 1,
+ :STRING => 2,
+ :NUMBER => 3,
+ :TRUE => 4,
+ :FALSE => 5,
+ :NULL => 6,
+ "," => 7,
+ ":" => 8,
+ "[" => 9,
+ "]" => 10,
+ "{" => 11,
+ "}" => 12 }
+
+racc_nt_base = 13
+
+racc_use_result_var = true
+
+Racc_arg = [
+ racc_action_table,
+ racc_action_check,
+ racc_action_default,
+ racc_action_pointer,
+ racc_goto_table,
+ racc_goto_check,
+ racc_goto_default,
+ racc_goto_pointer,
+ racc_nt_base,
+ racc_reduce_table,
+ racc_token_table,
+ racc_shift_n,
+ racc_reduce_n,
+ racc_use_result_var ]
+
+Racc_token_to_s_table = [
+ "$end",
+ "error",
+ "STRING",
+ "NUMBER",
+ "TRUE",
+ "FALSE",
+ "NULL",
+ "\",\"",
+ "\":\"",
+ "\"[\"",
+ "\"]\"",
+ "\"{\"",
+ "\"}\"",
+ "$start",
+ "document",
+ "object",
+ "array",
+ "start_object",
+ "end_object",
+ "pairs",
+ "pair",
+ "string",
+ "value",
+ "start_array",
+ "end_array",
+ "values",
+ "scalar",
+ "literal" ]
+
+Racc_debug_parser = false
+
+##### State transition tables end #####
+
+# reduce 0 omitted
+
+# reduce 1 omitted
+
+# reduce 2 omitted
+
+# reduce 3 omitted
+
+# reduce 4 omitted
+
+# reduce 5 omitted
+
+# reduce 6 omitted
+
+# reduce 7 omitted
+
+# reduce 8 omitted
+
+# reduce 9 omitted
+
+def _reduce_10(val, _values, result)
+ @handler.start_array
+ result
+end
+
+def _reduce_11(val, _values, result)
+ @handler.end_array
+ result
+end
+
+def _reduce_12(val, _values, result)
+ @handler.start_object
+ result
+end
+
+def _reduce_13(val, _values, result)
+ @handler.end_object
+ result
+end
+
+# reduce 14 omitted
+
+# reduce 15 omitted
+
+# reduce 16 omitted
+
+# reduce 17 omitted
+
+# reduce 18 omitted
+
+# reduce 19 omitted
+
+def _reduce_20(val, _values, result)
+ @handler.scalar val[0]
+ result
+end
+
+# reduce 21 omitted
+
+def _reduce_22(val, _values, result)
+ n = val[0]; result = n.count('.') > 0 ? n.to_f : n.to_i
+ result
+end
+
+def _reduce_23(val, _values, result)
+ result = true
+ result
+end
+
+def _reduce_24(val, _values, result)
+ result = false
+ result
+end
+
+def _reduce_25(val, _values, result)
+ result = nil
+ result
+end
+
+def _reduce_26(val, _values, result)
+ @handler.scalar val[0].gsub(/^"|"$/, '')
+ result
+end
+
+def _reduce_none(val, _values, result)
+ val[0]
+end
+
+ end # class Parser
+ end # module RJSON
diff --git a/test/test_blob.rb b/test/test_blob.rb
index 1ba856de..352d4b07 100644
--- a/test/test_blob.rb
+++ b/test/test_blob.rb
@@ -218,6 +218,9 @@ class TestBlob < Minitest::Test
# Unity3D-generated metadata
assert sample_blob_memory("Unity3D Asset/Tiles.meta").generated?
+
+ # Racc-generated Ruby
+ assert sample_blob_memory("Ruby/racc.rb").generated?
end
def test_vendored
diff --git a/vendor/grammars/FreeMarker.tmbundle b/vendor/grammars/FreeMarker.tmbundle
new file mode 160000
index 00000000..6b7b880c
--- /dev/null
+++ b/vendor/grammars/FreeMarker.tmbundle
@@ -0,0 +1 @@
+Subproject commit 6b7b880c533626b8e943ed686007c06771da3b42