mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 09:40:21 +00:00
Merge branch 'master' into memory_blob
This commit is contained in:
5
.gitmodules
vendored
5
.gitmodules
vendored
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
31
samples/FreeMarker/example.ftl
Normal file
31
samples/FreeMarker/example.ftl
Normal file
@@ -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>
|
||||
<ul>
|
||||
<#list results as result>
|
||||
<li>
|
||||
<strong>${result.title}</strong>
|
||||
<p>${result.description}</p>
|
||||
</li>
|
||||
</#list>
|
||||
</ul>
|
||||
</#if>
|
||||
|
||||
<#-- This is a FreeMarker comment -->
|
||||
<@currentTime />
|
||||
</@layout.page>
|
||||
|
||||
|
||||
<#macro currentTime>
|
||||
${.now?string.full}
|
||||
</#macro>
|
||||
32
samples/FreeMarker/layout.ftl
Normal file
32
samples/FreeMarker/layout.ftl
Normal file
@@ -0,0 +1,32 @@
|
||||
<#ftl strip_text=true />
|
||||
|
||||
<#macro page title>
|
||||
<!doctype html>
|
||||
<html lang="${.lang}">
|
||||
<head>
|
||||
<title>${title}</title>
|
||||
<@metaTags />
|
||||
</head>
|
||||
<body>
|
||||
<#nested />
|
||||
<@footer />
|
||||
</body>
|
||||
</html>
|
||||
</#macro>
|
||||
|
||||
|
||||
<#---
|
||||
Default meta tags
|
||||
-->
|
||||
<#macro metaTags>
|
||||
<#compress>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<meta name="format-detection" content="telephone=no">
|
||||
</#compress>
|
||||
</#macro>
|
||||
|
||||
<#macro footer>
|
||||
<p>This page is using FreeMarker v${.version}</p>
|
||||
</#macro>
|
||||
26
samples/HTML+EEX/index.html.erb
Normal file
26
samples/HTML+EEX/index.html.erb
Normal file
@@ -0,0 +1,26 @@
|
||||
<h1>Listing Books</h1>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Title</th>
|
||||
<th>Summary</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
<%= for book <- @books do %>
|
||||
<tr>
|
||||
<%# comment %>
|
||||
<td><%= book.title %></td>
|
||||
<td><%= book.content %></td>
|
||||
<td><%= link "Show", to: book_path(@conn, :show, book) %></td>
|
||||
<td><%= link "Edit", to: book_path(@conn, :edit, book) %></td>
|
||||
<td><%= link "Delete", to: book_path(@conn, :delete, book), method: :delete, data: [confirm: "Are you sure?"] %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
<br />
|
||||
|
||||
<%= link "New book", to: book_path(@conn, :new) %>
|
||||
99
samples/Metal/ITMVisualisationEngine.metal
Normal file
99
samples/Metal/ITMVisualisationEngine.metal
Normal file
@@ -0,0 +1,99 @@
|
||||
// Copyright 2014 Isis Innovation Limited and the authors of InfiniTAM
|
||||
|
||||
#include <metal_stdlib>
|
||||
|
||||
#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<ITMVoxel, ITMVoxelIndex>(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<ITMVoxel, ITMVoxelIndex>(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<false>(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<false>(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;
|
||||
}
|
||||
31
samples/PHP/mail.phps
Normal file
31
samples/PHP/mail.phps
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* This example shows sending a message using PHP's mail() function.
|
||||
*/
|
||||
|
||||
require '../PHPMailerAutoload.php';
|
||||
|
||||
//Create a new PHPMailer instance
|
||||
$mail = new PHPMailer;
|
||||
//Set who the message is to be sent from
|
||||
$mail->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!";
|
||||
}
|
||||
267
samples/Ruby/racc.rb
Normal file
267
samples/Ruby/racc.rb
Normal file
@@ -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
|
||||
@@ -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
|
||||
|
||||
1
vendor/grammars/FreeMarker.tmbundle
vendored
Submodule
1
vendor/grammars/FreeMarker.tmbundle
vendored
Submodule
Submodule vendor/grammars/FreeMarker.tmbundle added at 6b7b880c53
Reference in New Issue
Block a user