mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Compare commits
84 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
78d4abe808 | ||
|
|
cb97417af8 | ||
|
|
d1c94c75ea | ||
|
|
0c8c6c9814 | ||
|
|
3270a8896d | ||
|
|
20f19bf049 | ||
|
|
0cc33fd560 | ||
|
|
fa54fc2735 | ||
|
|
216e0457ff | ||
|
|
678f90acf7 | ||
|
|
dd0d5c08bb | ||
|
|
3837fed59e | ||
|
|
e4ce4edd5c | ||
|
|
a0fb54fe70 | ||
|
|
e946ceaa6f | ||
|
|
285af6512e | ||
|
|
5ae5108a69 | ||
|
|
02ae60f434 | ||
|
|
03dc4e1ff4 | ||
|
|
c39b42abba | ||
|
|
661972f585 | ||
|
|
078aff6ee3 | ||
|
|
4fed108b2c | ||
|
|
fc9beb58aa | ||
|
|
4623b4a83e | ||
|
|
2ba6ecefe5 | ||
|
|
91c2a4682d | ||
|
|
738be195ef | ||
|
|
5dcc4d74ec | ||
|
|
4213bec62a | ||
|
|
babe733bf4 | ||
|
|
ab5f60555e | ||
|
|
b61e33a49e | ||
|
|
a0d5a8338b | ||
|
|
eec321f013 | ||
|
|
e538f72b63 | ||
|
|
44c3d47b30 | ||
|
|
f1d3f396bb | ||
|
|
65ae444791 | ||
|
|
e9916c644d | ||
|
|
1940a9ea92 | ||
|
|
c9f8a2677a | ||
|
|
5b6b3f74b5 | ||
|
|
f9ccac4240 | ||
|
|
aa7aae7808 | ||
|
|
7c66301583 | ||
|
|
a5b0b333b0 | ||
|
|
7df872eb7f | ||
|
|
6a4f4c724c | ||
|
|
76828c45c7 | ||
|
|
27215f148b | ||
|
|
77d52463ad | ||
|
|
0f6c2afbf6 | ||
|
|
cbaa3ca6f4 | ||
|
|
63f54bdf06 | ||
|
|
b302863a4d | ||
|
|
ec46b1a92e | ||
|
|
ed65040539 | ||
|
|
cc1a420bc5 | ||
|
|
8555b20380 | ||
|
|
6462ba70f9 | ||
|
|
1ac43e0d7d | ||
|
|
6ac51968c6 | ||
|
|
cbcadf8e45 | ||
|
|
74b111501d | ||
|
|
67e4212f64 | ||
|
|
55559a1020 | ||
|
|
b103232e0e | ||
|
|
b587379f4a | ||
|
|
ba654b2a1d | ||
|
|
ae39475133 | ||
|
|
5f647f2236 | ||
|
|
50db5c012e | ||
|
|
dcb14d0fc7 | ||
|
|
419cfe54e0 | ||
|
|
ce1f51a34f | ||
|
|
5fd7992f98 | ||
|
|
fda0f2a042 | ||
|
|
6af4ab6db1 | ||
|
|
6aab682728 | ||
|
|
a364e4a2dc | ||
|
|
1bb639617c | ||
|
|
068c8a341d | ||
|
|
96c2f86613 |
6
.gitmodules
vendored
6
.gitmodules
vendored
@@ -645,3 +645,9 @@
|
||||
[submodule "vendor/grammars/perl.tmbundle"]
|
||||
path = vendor/grammars/perl.tmbundle
|
||||
url = https://github.com/textmate/perl.tmbundle
|
||||
[submodule "vendor/grammars/sublime-netlinx"]
|
||||
path = vendor/grammars/sublime-netlinx
|
||||
url = https://github.com/amclain/sublime-netlinx
|
||||
[submodule "vendor/grammars/Sublime-Red"]
|
||||
path = vendor/grammars/Sublime-Red
|
||||
url = https://github.com/Oldes/Sublime-Red
|
||||
|
||||
@@ -14,9 +14,9 @@ Gem::Specification.new do |s|
|
||||
s.executables << 'linguist'
|
||||
|
||||
s.add_dependency 'charlock_holmes', '~> 0.7.3'
|
||||
s.add_dependency 'escape_utils', '~> 1.0.1'
|
||||
s.add_dependency 'escape_utils', '~> 1.1.0'
|
||||
s.add_dependency 'mime-types', '>= 1.19'
|
||||
s.add_dependency 'rugged', '~> 0.22.0b4'
|
||||
s.add_dependency 'rugged', '~> 0.23.0b1'
|
||||
|
||||
s.add_development_dependency 'minitest', '>= 5.0'
|
||||
s.add_development_dependency 'mocha'
|
||||
|
||||
@@ -113,6 +113,8 @@ vendor/grammars/Sublime-QML:
|
||||
- source.qml
|
||||
vendor/grammars/Sublime-REBOL:
|
||||
- source.rebol
|
||||
vendor/grammars/Sublime-Red:
|
||||
- source.red
|
||||
vendor/grammars/Sublime-SQF-Language:
|
||||
- source.sqf
|
||||
vendor/grammars/Sublime-Text-2-OpenEdge-ABL:
|
||||
@@ -475,6 +477,9 @@ vendor/grammars/sublime-idris:
|
||||
- source.idris
|
||||
vendor/grammars/sublime-mask:
|
||||
- source.mask
|
||||
vendor/grammars/sublime-netlinx:
|
||||
- source.netlinx
|
||||
- source.netlinx.erb
|
||||
vendor/grammars/sublime-nginx:
|
||||
- source.nginx
|
||||
vendor/grammars/sublime-nix:
|
||||
|
||||
@@ -58,6 +58,7 @@ module Linguist
|
||||
godeps? ||
|
||||
generated_by_zephir? ||
|
||||
minified_files? ||
|
||||
source_map? ||
|
||||
compiled_coffeescript? ||
|
||||
generated_parser? ||
|
||||
generated_net_docfile? ||
|
||||
@@ -96,6 +97,20 @@ module Linguist
|
||||
end
|
||||
end
|
||||
|
||||
# Internal: Is the blob a generated source map?
|
||||
#
|
||||
# Source Maps usually have .css.map or .js.map extensions. In case they
|
||||
# are not following the name convention, detect them based on the content.
|
||||
#
|
||||
# Returns true or false.
|
||||
def source_map?
|
||||
return false unless extname.downcase == '.map'
|
||||
|
||||
name =~ /(\.css|\.js)\.map$/i || # Name convention
|
||||
lines[0] =~ /^{"version":\d+,/ || # Revision 2 and later begin with the version number
|
||||
lines[0] =~ /^\/\*\* Begin line maps\. \*\*\/{/ # Revision 1 begins with a magic comment
|
||||
end
|
||||
|
||||
# Internal: Is the blob of JS generated by CoffeeScript?
|
||||
#
|
||||
# CoffeeScript is meant to output JS that would be difficult to
|
||||
|
||||
@@ -172,13 +172,15 @@ module Linguist
|
||||
end
|
||||
end
|
||||
|
||||
disambiguate "F#", "Forth", "GLSL" do |data|
|
||||
disambiguate "F#", "Forth", "GLSL", "Filterscript" do |data|
|
||||
if /^(: |new-device)/.match(data)
|
||||
Language["Forth"]
|
||||
elsif /^\s*(#light|import|let|module|namespace|open|type)/.match(data)
|
||||
Language["F#"]
|
||||
elsif /^\s*(#include|#pragma|precision|uniform|varying|void)/.match(data)
|
||||
elsif /^\s*(#version|precision|uniform|varying|vec[234])/.match(data)
|
||||
Language["GLSL"]
|
||||
elsif /#include|#pragma\s+(rs|version)|__attribute__/.match(data)
|
||||
Language["Filterscript"]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -270,5 +272,20 @@ module Linguist
|
||||
end
|
||||
end
|
||||
|
||||
disambiguate "NL", "NewLisp" do |data|
|
||||
if /^g3 /.match(data)
|
||||
Language["NL"]
|
||||
else
|
||||
Language["NewLisp"]
|
||||
end
|
||||
end
|
||||
|
||||
disambiguate "Rust", "RenderScript" do |data|
|
||||
if data.include?("^(use |fn |mod |pub |macro_rules|impl|#!?\[)")
|
||||
Language["Rust"]
|
||||
elsif /#include|#pragma\s+(rs|version)|__attribute__/.match(data)
|
||||
Language["RenderScript"]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -118,7 +118,8 @@ Ada:
|
||||
- .ada
|
||||
- .ads
|
||||
aliases:
|
||||
- ada95ada2005
|
||||
- ada95
|
||||
- ada2005
|
||||
ace_mode: ada
|
||||
|
||||
Agda:
|
||||
@@ -515,6 +516,7 @@ Clojure:
|
||||
color: "#db5855"
|
||||
extensions:
|
||||
- .clj
|
||||
- .boot
|
||||
- .cl2
|
||||
- .cljc
|
||||
- .cljs
|
||||
@@ -710,6 +712,8 @@ DM:
|
||||
|
||||
DTrace:
|
||||
type: programming
|
||||
aliases:
|
||||
- dtrace-script
|
||||
extensions:
|
||||
- .d
|
||||
interpreters:
|
||||
@@ -718,7 +722,7 @@ DTrace:
|
||||
ace_mode: c_cpp
|
||||
|
||||
Darcs Patch:
|
||||
type: programming
|
||||
type: data
|
||||
search_term: dpatch
|
||||
aliases:
|
||||
- dpatch
|
||||
@@ -736,13 +740,14 @@ Dart:
|
||||
ace_mode: dart
|
||||
|
||||
Diff:
|
||||
type: programming
|
||||
type: data
|
||||
color: "#88dddd"
|
||||
extensions:
|
||||
- .diff
|
||||
- .patch
|
||||
aliases:
|
||||
- udiff
|
||||
tm_scope: source.diff
|
||||
ace_mode: diff
|
||||
|
||||
Dockerfile:
|
||||
@@ -820,6 +825,8 @@ Elixir:
|
||||
- .ex
|
||||
- .exs
|
||||
ace_mode: elixir
|
||||
filenames:
|
||||
- mix.lock
|
||||
|
||||
Elm:
|
||||
type: programming
|
||||
@@ -931,6 +938,14 @@ Fantom:
|
||||
tm_scope: source.fan
|
||||
ace_mode: text
|
||||
|
||||
Filterscript:
|
||||
type: programming
|
||||
group: RenderScript
|
||||
extensions:
|
||||
- .fs
|
||||
tm_scope: none
|
||||
ace_mode: text
|
||||
|
||||
Formatted:
|
||||
type: data
|
||||
extensions:
|
||||
@@ -1156,7 +1171,7 @@ Graphviz (DOT):
|
||||
ace_mode: text
|
||||
|
||||
Groff:
|
||||
type: programming
|
||||
type: markup
|
||||
extensions:
|
||||
- .man
|
||||
- '.1'
|
||||
@@ -1726,7 +1741,7 @@ LoomScript:
|
||||
Lua:
|
||||
type: programming
|
||||
ace_mode: lua
|
||||
color: "#fa1fa1"
|
||||
color: "#000080"
|
||||
extensions:
|
||||
- .lua
|
||||
- .fcgi
|
||||
@@ -1953,6 +1968,24 @@ Nemerle:
|
||||
- .n
|
||||
ace_mode: text
|
||||
|
||||
NetLinx:
|
||||
type: programming
|
||||
color: "#0000ff"
|
||||
extensions:
|
||||
- .axs
|
||||
- .axi
|
||||
tm_scope: source.netlinx
|
||||
ace_mode: text
|
||||
|
||||
NetLinx+ERB:
|
||||
type: programming
|
||||
color: "#407fff"
|
||||
extensions:
|
||||
- .axs.erb
|
||||
- .axi.erb
|
||||
tm_scope: source.netlinx.erb
|
||||
ace_mode: text
|
||||
|
||||
NetLogo:
|
||||
type: programming
|
||||
color: "#ff2b2b"
|
||||
@@ -2053,6 +2086,10 @@ OCaml:
|
||||
- .mli
|
||||
- .mll
|
||||
- .mly
|
||||
interpreters:
|
||||
- ocaml
|
||||
- ocamlrun
|
||||
tm_scope: source.ocaml
|
||||
|
||||
ObjDump:
|
||||
type: data
|
||||
@@ -2592,6 +2629,8 @@ Racket:
|
||||
- .rktd
|
||||
- .rktl
|
||||
- .scrbl
|
||||
interpreters:
|
||||
- racket
|
||||
tm_scope: source.racket
|
||||
ace_mode: lisp
|
||||
|
||||
@@ -2626,6 +2665,7 @@ Rebol:
|
||||
- .r3
|
||||
- .rebol
|
||||
ace_mode: text
|
||||
tm_scope: source.rebol
|
||||
|
||||
Red:
|
||||
type: programming
|
||||
@@ -2635,7 +2675,7 @@ Red:
|
||||
- .reds
|
||||
aliases:
|
||||
- red/system
|
||||
tm_scope: none
|
||||
tm_scope: source.red
|
||||
ace_mode: text
|
||||
|
||||
Redcode:
|
||||
@@ -2645,6 +2685,14 @@ Redcode:
|
||||
tm_scope: none
|
||||
ace_mode: text
|
||||
|
||||
RenderScript:
|
||||
type: programming
|
||||
extensions:
|
||||
- .rs
|
||||
- .rsh
|
||||
tm_scope: none
|
||||
ace_mode: text
|
||||
|
||||
RobotFramework:
|
||||
type: programming
|
||||
extensions:
|
||||
@@ -2845,7 +2893,6 @@ Scheme:
|
||||
- .ss
|
||||
interpreters:
|
||||
- guile
|
||||
- racket
|
||||
- bigloo
|
||||
- chicken
|
||||
ace_mode: scheme
|
||||
@@ -2954,6 +3001,7 @@ SourcePawn:
|
||||
|
||||
Squirrel:
|
||||
type: programming
|
||||
color: "#800000"
|
||||
extensions:
|
||||
- .nut
|
||||
tm_scope: source.c++
|
||||
@@ -3086,6 +3134,8 @@ Tea:
|
||||
Text:
|
||||
type: prose
|
||||
wrap: true
|
||||
aliases:
|
||||
- fundamental
|
||||
extensions:
|
||||
- .txt
|
||||
- .fr
|
||||
@@ -3202,12 +3252,15 @@ VimL:
|
||||
search_term: vim
|
||||
aliases:
|
||||
- vim
|
||||
- nvim
|
||||
extensions:
|
||||
- .vim
|
||||
filenames:
|
||||
- .nvimrc
|
||||
- .vimrc
|
||||
- _vimrc
|
||||
- gvimrc
|
||||
- nvimrc
|
||||
- vimrc
|
||||
ace_mode: text
|
||||
|
||||
@@ -3293,6 +3346,7 @@ XML:
|
||||
- .mxml
|
||||
- .nproj
|
||||
- .nuspec
|
||||
- .odd
|
||||
- .osm
|
||||
- .plist
|
||||
- .pluginspec
|
||||
@@ -3303,6 +3357,7 @@ XML:
|
||||
- .rss
|
||||
- .scxml
|
||||
- .srdf
|
||||
- .storyboard
|
||||
- .stTheme
|
||||
- .sublime-snippet
|
||||
- .targets
|
||||
@@ -3326,6 +3381,7 @@ XML:
|
||||
- .x3d
|
||||
- .xacro
|
||||
- .xaml
|
||||
- .xib
|
||||
- .xlf
|
||||
- .xliff
|
||||
- .xmi
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module Linguist
|
||||
module Strategy
|
||||
class Modeline
|
||||
EmacsModeline = /-\*-\s*mode:\s*(\w+);?\s*-\*-/i
|
||||
EmacsModeline = /-\*-\s*(?:(?!mode)[\w-]+\s*:\s*(?:[\w+-]+)\s*;?\s*)*(?:mode\s*:)?\s*([\w+-]+)\s*(?:;\s*(?!mode)[\w-]+\s*:\s*[\w+-]+\s*)*;?\s*-\*-/i
|
||||
VimModeline = /\/\*\s*vim:\s*set\s*(?:ft|filetype)=(\w+):\s*\*\//i
|
||||
|
||||
# Public: Detects language based on Vim and Emacs modelines
|
||||
|
||||
@@ -24,6 +24,9 @@
|
||||
- (^|/)config.guess$
|
||||
- (^|/)config.sub$
|
||||
|
||||
# Linters
|
||||
- cpplint.py
|
||||
|
||||
# Node dependencies
|
||||
- node_modules/
|
||||
|
||||
@@ -143,6 +146,9 @@
|
||||
|
||||
## Python ##
|
||||
|
||||
# Sphinx
|
||||
- (^|/)docs?/_?(build|themes?|templates?|static)/
|
||||
|
||||
# django
|
||||
- (^|/)admin_media/
|
||||
|
||||
@@ -221,7 +227,7 @@
|
||||
- ^readme$
|
||||
|
||||
# Test fixtures
|
||||
- ^[Tt]est/fixtures/
|
||||
- ^[Tt]ests?/fixtures/
|
||||
|
||||
# PhoneGap/Cordova
|
||||
- (^|/)cordova([^.]*)\.js$
|
||||
@@ -233,7 +239,7 @@
|
||||
# Vagrant
|
||||
- ^Vagrantfile$
|
||||
|
||||
# .DS_Store's
|
||||
# .DS_Stores
|
||||
- .[Dd][Ss]_[Ss]tore$
|
||||
|
||||
# R packages
|
||||
@@ -252,5 +258,8 @@
|
||||
- proguard.pro
|
||||
- proguard-rules.pro
|
||||
|
||||
# PuPHPet
|
||||
- ^puphpet/
|
||||
|
||||
# Android Google APIs
|
||||
- (^|/)\.google_apis/
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
module Linguist
|
||||
VERSION = "4.5.2"
|
||||
VERSION = "4.5.4"
|
||||
end
|
||||
|
||||
15
samples/Clojure/build.boot
Normal file
15
samples/Clojure/build.boot
Normal file
@@ -0,0 +1,15 @@
|
||||
;; from: https://github.com/boot-clj/boot#configure-task-options
|
||||
|
||||
(set-env!
|
||||
:source-paths #{"src"}
|
||||
:dependencies '[[me.raynes/conch "0.8.0"]])
|
||||
|
||||
(task-options!
|
||||
pom {:project 'my-project
|
||||
:version "0.1.0"}
|
||||
jar {:manifest {"Foo" "bar"}})
|
||||
|
||||
(deftask build
|
||||
"Build my project."
|
||||
[]
|
||||
(comp (pom) (jar) (install)))
|
||||
@@ -1,4 +1,4 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* -*- Mode: dtrace-script; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
|
||||
10
samples/Elixir/filenames/mix.lock
Normal file
10
samples/Elixir/filenames/mix.lock
Normal file
@@ -0,0 +1,10 @@
|
||||
%{"cowboy": {:hex, :cowboy, "1.0.0"},
|
||||
"cowlib": {:hex, :cowlib, "1.0.1"},
|
||||
"hackney": {:hex, :hackney, "0.14.3"},
|
||||
"hound": {:hex, :hound, "0.6.0"},
|
||||
"httpoison": {:hex, :httpoison, "0.5.0"},
|
||||
"idna": {:hex, :idna, "1.0.1"},
|
||||
"phoenix": {:hex, :phoenix, "0.10.0"},
|
||||
"plug": {:hex, :plug, "0.11.1"},
|
||||
"poison": {:hex, :poison, "1.3.1"},
|
||||
"ranch": {:hex, :ranch, "1.0.0"}}
|
||||
35
samples/Filterscript/colormatrix.fs
Normal file
35
samples/Filterscript/colormatrix.fs
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (C) 2012 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "ip.rsh"
|
||||
|
||||
static rs_matrix4x4 Mat;
|
||||
|
||||
void init() {
|
||||
rsMatrixLoadIdentity(&Mat);
|
||||
}
|
||||
|
||||
void setMatrix(rs_matrix4x4 m) {
|
||||
Mat = m;
|
||||
}
|
||||
|
||||
uchar4 __attribute__((kernel)) root(uchar4 in) {
|
||||
float4 f = convert_float4(in);
|
||||
f = rsMatrixMultiply(&Mat, f);
|
||||
f = clamp(f, 0.f, 255.f);
|
||||
return convert_uchar4(f);
|
||||
}
|
||||
|
||||
18
samples/Filterscript/fs_kernel.fs
Normal file
18
samples/Filterscript/fs_kernel.fs
Normal file
@@ -0,0 +1,18 @@
|
||||
#pragma version(1)
|
||||
#pragma rs java_package_name(foo)
|
||||
|
||||
int __attribute__((kernel)) root(uint32_t ain) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void __attribute__((kernel)) in_only(uint32_t ain) {
|
||||
}
|
||||
|
||||
int __attribute__((kernel)) out_only() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int __attribute__((kernel)) everything(uint32_t ain, uint32_t x, uint32_t y) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
78
samples/NetLinx+ERB/sample.axi.erb
Normal file
78
samples/NetLinx+ERB/sample.axi.erb
Normal file
@@ -0,0 +1,78 @@
|
||||
(***********************************************************
|
||||
Sample File
|
||||
|
||||
For testing syntax highlighting
|
||||
************************************************************)
|
||||
|
||||
#if_not_defined Sample
|
||||
#define Sample 1
|
||||
(***********************************************************)
|
||||
(* System Type : NetLinx *)
|
||||
(***********************************************************)
|
||||
(* DEVICE NUMBER DEFINITIONS GO BELOW *)
|
||||
(***********************************************************)
|
||||
DEFINE_DEVICE
|
||||
|
||||
(***********************************************************)
|
||||
(* CONSTANT DEFINITIONS GO BELOW *)
|
||||
(***********************************************************)
|
||||
DEFINE_CONSTANT
|
||||
|
||||
<% global_constant_justify = 20 -%>
|
||||
// Video Source Select Buttons
|
||||
<%=
|
||||
video_sources = {
|
||||
BTN_VID_FOH_PC: { btn: 11, input: :VID_SRC_FOH_PC },
|
||||
BTN_VID_STAGE_PC: { btn: 12, input: :VID_SRC_STAGE_PC },
|
||||
BTN_VID_BLURAY: { btn: 13, input: :VID_SRC_BLURAY },
|
||||
}
|
||||
|
||||
print_constant_hash video_sources.remap(:btn),
|
||||
justify: global_constant_justify
|
||||
%>
|
||||
|
||||
(***********************************************************)
|
||||
(* INCLUDES GO BELOW *)
|
||||
(***********************************************************)
|
||||
|
||||
(***********************************************************)
|
||||
(* DATA TYPE DEFINITIONS GO BELOW *)
|
||||
(***********************************************************)
|
||||
DEFINE_TYPE
|
||||
|
||||
(***********************************************************)
|
||||
(* VARIABLE DEFINITIONS GO BELOW *)
|
||||
(***********************************************************)
|
||||
DEFINE_VARIABLE
|
||||
|
||||
(***********************************************************)
|
||||
(* SUBROUTINE/FUNCTION DEFINITIONS GO BELOW *)
|
||||
(***********************************************************)
|
||||
|
||||
(***********************************************************)
|
||||
(* STARTUP CODE GOES BELOW *)
|
||||
(***********************************************************)
|
||||
DEFINE_START
|
||||
|
||||
(***********************************************************)
|
||||
(* THE EVENTS GO BELOW *)
|
||||
(***********************************************************)
|
||||
DEFINE_EVENT
|
||||
|
||||
// Video Source Select
|
||||
<%=
|
||||
justify group(video_sources.remap :input) { |name, input|
|
||||
"[#{@dvTP}, #{name}] = (outputs[VID_DEST_PROJECTOR].input == #{input});"
|
||||
}
|
||||
%>
|
||||
|
||||
(***********************************************************)
|
||||
(* THE MAINLINE GOES BELOW *)
|
||||
(***********************************************************)
|
||||
DEFINE_PROGRAM
|
||||
|
||||
(***********************************************************)
|
||||
(* END OF PROGRAM *)
|
||||
(* DO NOT PUT ANY CODE BELOW THIS COMMENT *)
|
||||
(***********************************************************)
|
||||
#end_if
|
||||
78
samples/NetLinx+ERB/sample.axs.erb
Normal file
78
samples/NetLinx+ERB/sample.axs.erb
Normal file
@@ -0,0 +1,78 @@
|
||||
(***********************************************************
|
||||
Sample File
|
||||
|
||||
For testing syntax highlighting
|
||||
************************************************************)
|
||||
|
||||
#if_not_defined Sample
|
||||
#define Sample 1
|
||||
(***********************************************************)
|
||||
(* System Type : NetLinx *)
|
||||
(***********************************************************)
|
||||
(* DEVICE NUMBER DEFINITIONS GO BELOW *)
|
||||
(***********************************************************)
|
||||
DEFINE_DEVICE
|
||||
|
||||
(***********************************************************)
|
||||
(* CONSTANT DEFINITIONS GO BELOW *)
|
||||
(***********************************************************)
|
||||
DEFINE_CONSTANT
|
||||
|
||||
<% global_constant_justify = 20 -%>
|
||||
// Video Source Select Buttons
|
||||
<%=
|
||||
video_sources = {
|
||||
BTN_VID_FOH_PC: { btn: 11, input: :VID_SRC_FOH_PC },
|
||||
BTN_VID_STAGE_PC: { btn: 12, input: :VID_SRC_STAGE_PC },
|
||||
BTN_VID_BLURAY: { btn: 13, input: :VID_SRC_BLURAY },
|
||||
}
|
||||
|
||||
print_constant_hash video_sources.remap(:btn),
|
||||
justify: global_constant_justify
|
||||
%>
|
||||
|
||||
(***********************************************************)
|
||||
(* INCLUDES GO BELOW *)
|
||||
(***********************************************************)
|
||||
|
||||
(***********************************************************)
|
||||
(* DATA TYPE DEFINITIONS GO BELOW *)
|
||||
(***********************************************************)
|
||||
DEFINE_TYPE
|
||||
|
||||
(***********************************************************)
|
||||
(* VARIABLE DEFINITIONS GO BELOW *)
|
||||
(***********************************************************)
|
||||
DEFINE_VARIABLE
|
||||
|
||||
(***********************************************************)
|
||||
(* SUBROUTINE/FUNCTION DEFINITIONS GO BELOW *)
|
||||
(***********************************************************)
|
||||
|
||||
(***********************************************************)
|
||||
(* STARTUP CODE GOES BELOW *)
|
||||
(***********************************************************)
|
||||
DEFINE_START
|
||||
|
||||
(***********************************************************)
|
||||
(* THE EVENTS GO BELOW *)
|
||||
(***********************************************************)
|
||||
DEFINE_EVENT
|
||||
|
||||
// Video Source Select
|
||||
<%=
|
||||
justify group(video_sources.remap :input) { |name, input|
|
||||
"[#{@dvTP}, #{name}] = (outputs[VID_DEST_PROJECTOR].input == #{input});"
|
||||
}
|
||||
%>
|
||||
|
||||
(***********************************************************)
|
||||
(* THE MAINLINE GOES BELOW *)
|
||||
(***********************************************************)
|
||||
DEFINE_PROGRAM
|
||||
|
||||
(***********************************************************)
|
||||
(* END OF PROGRAM *)
|
||||
(* DO NOT PUT ANY CODE BELOW THIS COMMENT *)
|
||||
(***********************************************************)
|
||||
#end_if
|
||||
132
samples/NetLinx/projector.axi
Normal file
132
samples/NetLinx/projector.axi
Normal file
@@ -0,0 +1,132 @@
|
||||
(***********************************************************
|
||||
Mock Projector
|
||||
|
||||
For testing syntax highlighting
|
||||
************************************************************)
|
||||
|
||||
#if_not_defined MOCK_PROJECTOR
|
||||
#define MOCK_PROJECTOR 1
|
||||
(***********************************************************)
|
||||
(* System Type : NetLinx *)
|
||||
(***********************************************************)
|
||||
(* DEVICE NUMBER DEFINITIONS GO BELOW *)
|
||||
(***********************************************************)
|
||||
DEFINE_DEVICE
|
||||
|
||||
dvPROJECTOR = 5001:1:0;
|
||||
|
||||
(***********************************************************)
|
||||
(* CONSTANT DEFINITIONS GO BELOW *)
|
||||
(***********************************************************)
|
||||
DEFINE_CONSTANT
|
||||
|
||||
// Power States
|
||||
POWER_STATE_ON = 0;
|
||||
POWER_STATE_OFF = 1;
|
||||
POWER_STATE_WARMING = 2;
|
||||
POWER_STATE_COOLING = 3;
|
||||
|
||||
// Inputs
|
||||
INPUT_HDMI = 0;
|
||||
INPUT_VGA = 1;
|
||||
INPUT_COMPOSITE = 2;
|
||||
INPUT_SVIDEO = 3;
|
||||
|
||||
(***********************************************************)
|
||||
(* INCLUDES GO BELOW *)
|
||||
(***********************************************************)
|
||||
|
||||
#include 'amx-lib-log'
|
||||
|
||||
(***********************************************************)
|
||||
(* DATA TYPE DEFINITIONS GO BELOW *)
|
||||
(***********************************************************)
|
||||
DEFINE_TYPE
|
||||
|
||||
struct projector_t
|
||||
{
|
||||
integer power_state;
|
||||
integer input;
|
||||
integer lamp_hours;
|
||||
}
|
||||
|
||||
(***********************************************************)
|
||||
(* VARIABLE DEFINITIONS GO BELOW *)
|
||||
(***********************************************************)
|
||||
DEFINE_VARIABLE
|
||||
|
||||
volatile projector_t proj_1;
|
||||
|
||||
(***********************************************************)
|
||||
(* SUBROUTINE/FUNCTION DEFINITIONS GO BELOW *)
|
||||
(***********************************************************)
|
||||
|
||||
define_function initialize(projector_t self)
|
||||
{
|
||||
self.power_state = POWER_STATE_OFF;
|
||||
self.input = INPUT_HDMI;
|
||||
self.lamp_hours = 0;
|
||||
}
|
||||
|
||||
define_function switch_input(projector_t self, integer input)
|
||||
{
|
||||
self.input = input;
|
||||
print(LOG_LEVEL_INFO, "'Projector set to input: ', itoa(input)");
|
||||
}
|
||||
|
||||
(***********************************************************)
|
||||
(* STARTUP CODE GOES BELOW *)
|
||||
(***********************************************************)
|
||||
DEFINE_START
|
||||
|
||||
initialize(proj_1);
|
||||
|
||||
(***********************************************************)
|
||||
(* THE EVENTS GO BELOW *)
|
||||
(***********************************************************)
|
||||
DEFINE_EVENT
|
||||
|
||||
data_event[dvPROJECTOR]
|
||||
{
|
||||
string:
|
||||
{
|
||||
parse_message(data.text);
|
||||
}
|
||||
|
||||
command: {}
|
||||
online: {}
|
||||
offline: {}
|
||||
}
|
||||
|
||||
button_event[dvTP, BTN_HDMI]
|
||||
button_event[dvTP, BTN_VGA]
|
||||
button_event[dvTP, BTN_COMPOSITE]
|
||||
button_event[dvTP, BTN_SVIDEO]
|
||||
{
|
||||
push:
|
||||
{
|
||||
switch (button.input.channel)
|
||||
{
|
||||
case BTN_HDMI: switch_input(proj_1, INPUT_HDMI);
|
||||
case BTN_VGA: switch_input(proj_1, INPUT_VGA);
|
||||
case BTN_COMPOSITE: switch_input(proj_1, INPUT_COMPOSITE);
|
||||
case BTN_SVIDEO: switch_input(proj_1, INPUT_SVIDEO);
|
||||
}
|
||||
}
|
||||
|
||||
release: {}
|
||||
}
|
||||
|
||||
(***********************************************************)
|
||||
(* THE MAINLINE GOES BELOW *)
|
||||
(***********************************************************)
|
||||
DEFINE_PROGRAM
|
||||
|
||||
[dvTP, BTN_POWER_ON] = (proj_1.power_state == POWER_STATE_ON);
|
||||
[dvTP, BTN_POWER_OFF] = (proj_1.power_state == POWER_STATE_OFF);
|
||||
|
||||
(***********************************************************)
|
||||
(* END OF PROGRAM *)
|
||||
(* DO NOT PUT ANY CODE BELOW THIS COMMENT *)
|
||||
(***********************************************************)
|
||||
#end_if
|
||||
158
samples/NetLinx/volume-array.axs
Normal file
158
samples/NetLinx/volume-array.axs
Normal file
@@ -0,0 +1,158 @@
|
||||
(***********************************************************
|
||||
AMX VOLUME CONTROL
|
||||
VOLUME ARRAY EXAMPLE
|
||||
|
||||
Website: https://sourceforge.net/projects/amx-lib-volume/
|
||||
|
||||
|
||||
This application demonstrates the use of volume control
|
||||
arrays using the amx-lib-volume library.
|
||||
|
||||
Volume control operation can be viewed by watching the
|
||||
master's internal diagnostic output.
|
||||
|
||||
I/O PORT CONNECTIONS:
|
||||
Ch 1: Volume Up Button
|
||||
Ch 2: Volume Down Button
|
||||
************************************************************
|
||||
Copyright 2011, 2012, 2014 Alex McLain
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
************************************************************)
|
||||
|
||||
PROGRAM_NAME='volume array'
|
||||
(***********************************************************)
|
||||
(***********************************************************)
|
||||
(* System Type : NetLinx *)
|
||||
(***********************************************************)
|
||||
(* REV HISTORY: *)
|
||||
(***********************************************************)
|
||||
(*
|
||||
$History: See version control repository.
|
||||
*)
|
||||
(***********************************************************)
|
||||
(* INCLUDES GO BELOW *)
|
||||
(***********************************************************)
|
||||
|
||||
// Include the volume control library.
|
||||
#include 'amx-lib-volume'
|
||||
|
||||
(***********************************************************)
|
||||
(* DEVICE NUMBER DEFINITIONS GO BELOW *)
|
||||
(***********************************************************)
|
||||
DEFINE_DEVICE
|
||||
|
||||
dvDebug = 0:0:0; // For debug output.
|
||||
|
||||
dvIO = 36000:1:0; // Volume up/down button connections.
|
||||
|
||||
(***********************************************************)
|
||||
(* CONSTANT DEFINITIONS GO BELOW *)
|
||||
(***********************************************************)
|
||||
DEFINE_CONSTANT
|
||||
|
||||
// Volume control indexes.
|
||||
MIC1 = 1; // Microphone 1.
|
||||
MIC2 = 2; // Microphone 2.
|
||||
MIC3 = 3; // Microphone 3.
|
||||
MIC4 = 4; // Microphone 4.
|
||||
WLS1 = 5; // Wireless mic 1.
|
||||
WLS2 = 6; // Wireless mic 2.
|
||||
IPOD = 7; // iPod input.
|
||||
CD = 8; // CD player input.
|
||||
|
||||
(***********************************************************)
|
||||
(* DATA TYPE DEFINITIONS GO BELOW *)
|
||||
(***********************************************************)
|
||||
DEFINE_TYPE
|
||||
|
||||
(***********************************************************)
|
||||
(* VARIABLE DEFINITIONS GO BELOW *)
|
||||
(***********************************************************)
|
||||
DEFINE_VARIABLE
|
||||
|
||||
// Define a volume control array for the input devices.
|
||||
volume inputs[8];
|
||||
|
||||
(***********************************************************)
|
||||
(* LATCHING DEFINITIONS GO BELOW *)
|
||||
(***********************************************************)
|
||||
DEFINE_LATCHING
|
||||
|
||||
(***********************************************************)
|
||||
(* MUTUALLY EXCLUSIVE DEFINITIONS GO BELOW *)
|
||||
(***********************************************************)
|
||||
DEFINE_MUTUALLY_EXCLUSIVE
|
||||
|
||||
(***********************************************************)
|
||||
(* SUBROUTINE/FUNCTION DEFINITIONS GO BELOW *)
|
||||
(***********************************************************)
|
||||
(* EXAMPLE: DEFINE_FUNCTION <RETURN_TYPE> <NAME> (<PARAMETERS>) *)
|
||||
(* EXAMPLE: DEFINE_CALL '<NAME>' (<PARAMETERS>) *)
|
||||
|
||||
(***********************************************************)
|
||||
(* STARTUP CODE GOES BELOW *)
|
||||
(***********************************************************)
|
||||
DEFINE_START
|
||||
|
||||
// Initialize the array of volume controls.
|
||||
volArrayInit(inputs, 0, VOL_UNMUTED, 10000, 20000, 5);
|
||||
|
||||
(***********************************************************)
|
||||
(* THE EVENTS GO BELOW *)
|
||||
(***********************************************************)
|
||||
DEFINE_EVENT
|
||||
|
||||
// Volume Up
|
||||
button_event[dvIO, 1]
|
||||
{
|
||||
PUSH:
|
||||
{
|
||||
volArrayIncrement(inputs); // Increment the volume up a step.
|
||||
send_string dvDebug, "'Volume Up MIC1: ', itoa(volGetLevel(inputs[MIC1]))";
|
||||
send_string dvDebug, "'Volume Up MIC2: ', itoa(volGetLevel(inputs[MIC2]))";
|
||||
send_string dvDebug, "'Volume Up MIC3: ', itoa(volGetLevel(inputs[MIC3]))";
|
||||
send_string dvDebug, "'Volume Up MIC4: ', itoa(volGetLevel(inputs[MIC4]))";
|
||||
send_string dvDebug, "'Volume Up WLS1: ', itoa(volGetLevel(inputs[WLS1]))";
|
||||
send_string dvDebug, "'Volume Up WLS2: ', itoa(volGetLevel(inputs[WLS2]))";
|
||||
send_string dvDebug, "'Volume Up IPOD: ', itoa(volGetLevel(inputs[IPOD]))";
|
||||
send_string dvDebug, "'Volume Up CD: ', itoa(volGetLevel(inputs[CD]))";
|
||||
}
|
||||
}
|
||||
|
||||
// Volume Down
|
||||
button_event[dvIO, 2]
|
||||
{
|
||||
PUSH:
|
||||
{
|
||||
volArrayDecrement(inputs); // Decrement the volume down a step.
|
||||
send_string dvDebug, "'Volume Dn MIC1: ', itoa(volGetLevel(inputs[MIC1]))";
|
||||
send_string dvDebug, "'Volume Dn MIC2: ', itoa(volGetLevel(inputs[MIC2]))";
|
||||
send_string dvDebug, "'Volume Dn MIC3: ', itoa(volGetLevel(inputs[MIC3]))";
|
||||
send_string dvDebug, "'Volume Dn MIC4: ', itoa(volGetLevel(inputs[MIC4]))";
|
||||
send_string dvDebug, "'Volume Dn WLS1: ', itoa(volGetLevel(inputs[WLS1]))";
|
||||
send_string dvDebug, "'Volume Dn WLS2: ', itoa(volGetLevel(inputs[WLS2]))";
|
||||
send_string dvDebug, "'Volume Dn IPOD: ', itoa(volGetLevel(inputs[IPOD]))";
|
||||
send_string dvDebug, "'Volume Dn CD: ', itoa(volGetLevel(inputs[CD]))";
|
||||
}
|
||||
}
|
||||
|
||||
(***********************************************************)
|
||||
(* THE ACTUAL PROGRAM GOES BELOW *)
|
||||
(***********************************************************)
|
||||
DEFINE_PROGRAM
|
||||
|
||||
(***********************************************************)
|
||||
(* END OF PROGRAM *)
|
||||
(* DO NOT PUT ANY CODE BELOW THIS COMMENT *)
|
||||
(***********************************************************)
|
||||
67
samples/RenderScript/convolve3x3.rs
Normal file
67
samples/RenderScript/convolve3x3.rs
Normal file
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Copyright (C) 2012 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma version(1)
|
||||
#pragma rs java_package_name(com.android.gallery3d.filtershow.filters)
|
||||
#pragma rs_fp_relaxed
|
||||
|
||||
int32_t gWidth;
|
||||
int32_t gHeight;
|
||||
const uchar4 *gPixels;
|
||||
rs_allocation gIn;
|
||||
|
||||
float gCoeffs[9];
|
||||
|
||||
void root(const uchar4 *in, uchar4 *out, const void *usrData, uint32_t x, uint32_t y) {
|
||||
uint32_t x1 = min((int32_t)x+1, gWidth-1);
|
||||
uint32_t x2 = max((int32_t)x-1, 0);
|
||||
uint32_t y1 = min((int32_t)y+1, gHeight-1);
|
||||
uint32_t y2 = max((int32_t)y-1, 0);
|
||||
|
||||
float4 p00 = rsUnpackColor8888(gPixels[x1 + gWidth * y1]);
|
||||
float4 p01 = rsUnpackColor8888(gPixels[x + gWidth * y1]);
|
||||
float4 p02 = rsUnpackColor8888(gPixels[x2 + gWidth * y1]);
|
||||
float4 p10 = rsUnpackColor8888(gPixels[x1 + gWidth * y]);
|
||||
float4 p11 = rsUnpackColor8888(gPixels[x + gWidth * y]);
|
||||
float4 p12 = rsUnpackColor8888(gPixels[x2 + gWidth * y]);
|
||||
float4 p20 = rsUnpackColor8888(gPixels[x1 + gWidth * y2]);
|
||||
float4 p21 = rsUnpackColor8888(gPixels[x + gWidth * y2]);
|
||||
float4 p22 = rsUnpackColor8888(gPixels[x2 + gWidth * y2]);
|
||||
|
||||
p00 *= gCoeffs[0];
|
||||
p01 *= gCoeffs[1];
|
||||
p02 *= gCoeffs[2];
|
||||
p10 *= gCoeffs[3];
|
||||
p11 *= gCoeffs[4];
|
||||
p12 *= gCoeffs[5];
|
||||
p20 *= gCoeffs[6];
|
||||
p21 *= gCoeffs[7];
|
||||
p22 *= gCoeffs[8];
|
||||
|
||||
p00 += p01;
|
||||
p02 += p10;
|
||||
p11 += p12;
|
||||
p20 += p21;
|
||||
|
||||
p22 += p00;
|
||||
p02 += p11;
|
||||
|
||||
p20 += p22;
|
||||
p20 += p02;
|
||||
|
||||
p20 = clamp(p20, 0.f, 1.f);
|
||||
*out = rsPackColorTo8888(p20.r, p20.g, p20.b);
|
||||
}
|
||||
323
samples/RenderScript/scenegraph_objects.rsh
Normal file
323
samples/RenderScript/scenegraph_objects.rsh
Normal file
@@ -0,0 +1,323 @@
|
||||
// Copyright (C) 2011-2012 The Android Open Source Project
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#pragma version(1)
|
||||
|
||||
#pragma rs java_package_name(com.android.scenegraph)
|
||||
|
||||
#ifndef _TRANSFORM_DEF_
|
||||
#define _TRANSFORM_DEF_
|
||||
|
||||
#include "rs_graphics.rsh"
|
||||
|
||||
#define TRANSFORM_NONE 0
|
||||
#define TRANSFORM_TRANSLATE 1
|
||||
#define TRANSFORM_ROTATE 2
|
||||
#define TRANSFORM_SCALE 3
|
||||
|
||||
#define CULL_FRUSTUM 0
|
||||
#define CULL_ALWAYS 2
|
||||
|
||||
#define LIGHT_POINT 0
|
||||
#define LIGHT_DIRECTIONAL 1
|
||||
|
||||
// Shader params that involve only data
|
||||
#define SHADER_PARAM_DATA_ONLY 10000
|
||||
#define SHADER_PARAM_FLOAT4_DATA 10001
|
||||
#define SHADER_PARAM_TRANSFORM_DATA 10002
|
||||
#define SHADER_PARAM_TRANSFORM_MODEL 10003
|
||||
|
||||
// Shader params that involve camera
|
||||
#define SHADER_PARAM_CAMERA 1000
|
||||
#define SHADER_PARAM_FLOAT4_CAMERA_POS 1001
|
||||
#define SHADER_PARAM_FLOAT4_CAMERA_DIR 1002
|
||||
#define SHADER_PARAM_TRANSFORM_VIEW 1003
|
||||
#define SHADER_PARAM_TRANSFORM_PROJ 1004
|
||||
#define SHADER_PARAM_TRANSFORM_VIEW_PROJ 1005
|
||||
#define SHADER_PARAM_TRANSFORM_MODEL_VIEW 1006
|
||||
#define SHADER_PARAM_TRANSFORM_MODEL_VIEW_PROJ 1007
|
||||
|
||||
// Shader Params that only involve lights
|
||||
#define SHADER_PARAM_LIGHT 100
|
||||
#define SHADER_PARAM_FLOAT4_LIGHT_COLOR 103
|
||||
#define SHADER_PARAM_FLOAT4_LIGHT_POS 104
|
||||
#define SHADER_PARAM_FLOAT4_LIGHT_DIR 105
|
||||
|
||||
#define SHADER_PARAM_TEXTURE 10
|
||||
|
||||
#define TEXTURE_NONE 0
|
||||
#define TEXTURE_2D 1
|
||||
#define TEXTURE_CUBE 2
|
||||
#define TEXTURE_RENDER_TARGET 3
|
||||
|
||||
typedef struct TransformComponent_s {
|
||||
float4 value;
|
||||
int type;
|
||||
rs_allocation name;
|
||||
} SgTransformComponent;
|
||||
|
||||
typedef struct __attribute__((packed, aligned(4))) SgTransform {
|
||||
rs_matrix4x4 globalMat;
|
||||
rs_matrix4x4 localMat;
|
||||
|
||||
rs_allocation components;
|
||||
int isDirty;
|
||||
|
||||
rs_allocation children;
|
||||
rs_allocation name;
|
||||
|
||||
// Used to check whether transform params need to be updated
|
||||
uint32_t timestamp;
|
||||
} SgTransform;
|
||||
|
||||
typedef struct VertexShader_s {
|
||||
rs_program_vertex program;
|
||||
// Buffer with vertex constant data
|
||||
rs_allocation shaderConst;
|
||||
// ShaderParam's that populate data
|
||||
rs_allocation shaderConstParams;
|
||||
// location of the per object constants on the buffer
|
||||
int objectConstIndex;
|
||||
} SgVertexShader;
|
||||
|
||||
typedef struct FragmentShader_s {
|
||||
rs_program_fragment program;
|
||||
// Buffer with vertex constant data
|
||||
rs_allocation shaderConst;
|
||||
// ShaderParam's that populate data
|
||||
rs_allocation shaderConstParams;
|
||||
// ShaderParam's that set textures
|
||||
rs_allocation shaderTextureParams;
|
||||
// location of the per object constants on the buffer
|
||||
int objectConstIndex;
|
||||
} SgFragmentShader;
|
||||
|
||||
typedef struct RenderState_s {
|
||||
rs_allocation pv; // VertexShader struct
|
||||
rs_allocation pf; // FragmentShader struct
|
||||
rs_program_store ps;
|
||||
rs_program_raster pr;
|
||||
} SgRenderState;
|
||||
|
||||
typedef struct Renderable_s {
|
||||
rs_allocation render_state;
|
||||
// Buffer with vertex constant data
|
||||
rs_allocation pv_const;
|
||||
// ShaderParam's that populate data
|
||||
rs_allocation pv_constParams;
|
||||
// Buffer with fragment constant data
|
||||
rs_allocation pf_const;
|
||||
// ShaderParam's that populate data
|
||||
rs_allocation pf_constParams;
|
||||
rs_allocation pf_textures[8];
|
||||
int pf_num_textures;
|
||||
rs_mesh mesh;
|
||||
int meshIndex;
|
||||
rs_allocation transformMatrix;
|
||||
rs_allocation name;
|
||||
float4 boundingSphere;
|
||||
float4 worldBoundingSphere;
|
||||
int bVolInitialized;
|
||||
int cullType; // specifies whether to frustum cull
|
||||
int isVisible;
|
||||
} SgRenderable;
|
||||
|
||||
typedef struct RenderPass_s {
|
||||
rs_allocation color_target;
|
||||
rs_allocation depth_target;
|
||||
rs_allocation camera;
|
||||
rs_allocation objects;
|
||||
|
||||
float4 clear_color;
|
||||
float clear_depth;
|
||||
bool should_clear_color;
|
||||
bool should_clear_depth;
|
||||
} SgRenderPass;
|
||||
|
||||
typedef struct Camera_s {
|
||||
rs_matrix4x4 proj;
|
||||
rs_matrix4x4 view;
|
||||
rs_matrix4x4 viewProj;
|
||||
float4 position;
|
||||
float near;
|
||||
float far;
|
||||
float horizontalFOV;
|
||||
float aspect;
|
||||
rs_allocation name;
|
||||
rs_allocation transformMatrix;
|
||||
float4 frustumPlanes[6];
|
||||
|
||||
int isDirty;
|
||||
// Timestamp of the camera itself to signal params if anything changes
|
||||
uint32_t timestamp;
|
||||
// Timestamp of our transform
|
||||
uint32_t transformTimestamp;
|
||||
} SgCamera;
|
||||
|
||||
typedef struct Light_s {
|
||||
float4 position;
|
||||
float4 color;
|
||||
float intensity;
|
||||
int type;
|
||||
rs_allocation name;
|
||||
rs_allocation transformMatrix;
|
||||
} SgLight;
|
||||
|
||||
// This represents the shader parameter data needed to set a float or transform data
|
||||
typedef struct ShaderParamData_s {
|
||||
int type;
|
||||
float4 float_value;
|
||||
uint32_t timestamp;
|
||||
rs_allocation paramName;
|
||||
rs_allocation camera;
|
||||
rs_allocation light;
|
||||
rs_allocation transform;
|
||||
rs_allocation texture;
|
||||
} SgShaderParamData;
|
||||
|
||||
// This represents a shader parameter that knows how to update itself for a given
|
||||
// renderable or shader and contains a timestamp for the last time this buffer was updated
|
||||
typedef struct ShaderParam_s {
|
||||
// Used to check whether transform params need to be updated
|
||||
uint32_t transformTimestamp;
|
||||
// Used to check whether data params need to be updated
|
||||
// These are used when somebody set the matrix of float value directly in java
|
||||
uint32_t dataTimestamp;
|
||||
// Specifies where in the constant buffer data gets written to
|
||||
int bufferOffset;
|
||||
// An instance of SgShaderParamData that could be shared by multiple objects
|
||||
rs_allocation data;
|
||||
// How many components of the vector we need to write
|
||||
int float_vecSize;
|
||||
} SgShaderParam;
|
||||
|
||||
// This represents a texture object
|
||||
typedef struct Texture_s {
|
||||
uint32_t type;
|
||||
rs_allocation texture;
|
||||
} SgTexture;
|
||||
|
||||
static void printName(rs_allocation name) {
|
||||
if (!rsIsObject(name)) {
|
||||
rsDebug("no name", 0);
|
||||
return;
|
||||
}
|
||||
|
||||
rsDebug((const char*)rsGetElementAt(name, 0), 0);
|
||||
}
|
||||
|
||||
static void printCameraInfo(const SgCamera *cam) {
|
||||
rsDebug("***** Camera information. ptr:", cam);
|
||||
printName(cam->name);
|
||||
const SgTransform *camTransform = (const SgTransform *)rsGetElementAt(cam->transformMatrix, 0);
|
||||
rsDebug("Transform name:", camTransform);
|
||||
printName(camTransform->name);
|
||||
|
||||
rsDebug("Aspect: ", cam->aspect);
|
||||
rsDebug("Near: ", cam->near);
|
||||
rsDebug("Far: ", cam->far);
|
||||
rsDebug("Fov: ", cam->horizontalFOV);
|
||||
rsDebug("Position: ", cam->position);
|
||||
rsDebug("Proj: ", &cam->proj);
|
||||
rsDebug("View: ", &cam->view);
|
||||
}
|
||||
|
||||
static void printLightInfo(const SgLight *light) {
|
||||
rsDebug("***** Light information. ptr:", light);
|
||||
printName(light->name);
|
||||
const SgTransform *lTransform = (const SgTransform *)rsGetElementAt(light->transformMatrix, 0);
|
||||
rsDebug("Transform name:", lTransform);
|
||||
printName(lTransform->name);
|
||||
|
||||
rsDebug("Position: ", light->position);
|
||||
rsDebug("Color : ", light->color);
|
||||
rsDebug("Intensity: ", light->intensity);
|
||||
rsDebug("Type: ", light->type);
|
||||
}
|
||||
|
||||
static void getCameraRay(const SgCamera *cam, int screenX, int screenY, float3 *pnt, float3 *vec) {
|
||||
rsDebug("=================================", screenX);
|
||||
rsDebug("Point X", screenX);
|
||||
rsDebug("Point Y", screenY);
|
||||
|
||||
rs_matrix4x4 mvpInv;
|
||||
rsMatrixLoad(&mvpInv, &cam->viewProj);
|
||||
rsMatrixInverse(&mvpInv);
|
||||
|
||||
float width = (float)rsgGetWidth();
|
||||
float height = (float)rsgGetHeight();
|
||||
|
||||
float4 pos = {(float)screenX, height - (float)screenY, 0.0f, 1.0f};
|
||||
|
||||
pos.x /= width;
|
||||
pos.y /= height;
|
||||
|
||||
rsDebug("Pre Norm X", pos.x);
|
||||
rsDebug("Pre Norm Y", pos.y);
|
||||
|
||||
pos.xy = pos.xy * 2.0f - 1.0f;
|
||||
|
||||
rsDebug("Norm X", pos.x);
|
||||
rsDebug("Norm Y", pos.y);
|
||||
|
||||
pos = rsMatrixMultiply(&mvpInv, pos);
|
||||
float oneOverW = 1.0f / pos.w;
|
||||
pos.xyz *= oneOverW;
|
||||
|
||||
rsDebug("World X", pos.x);
|
||||
rsDebug("World Y", pos.y);
|
||||
rsDebug("World Z", pos.z);
|
||||
|
||||
rsDebug("Cam X", cam->position.x);
|
||||
rsDebug("Cam Y", cam->position.y);
|
||||
rsDebug("Cam Z", cam->position.z);
|
||||
|
||||
*vec = normalize(pos.xyz - cam->position.xyz);
|
||||
rsDebug("Vec X", vec->x);
|
||||
rsDebug("Vec Y", vec->y);
|
||||
rsDebug("Vec Z", vec->z);
|
||||
*pnt = cam->position.xyz;
|
||||
}
|
||||
|
||||
static bool intersect(const SgRenderable *obj, float3 pnt, float3 vec) {
|
||||
// Solving for t^2 + Bt + C = 0
|
||||
float3 originMinusCenter = pnt - obj->worldBoundingSphere.xyz;
|
||||
float B = dot(originMinusCenter, vec) * 2.0f;
|
||||
float C = dot(originMinusCenter, originMinusCenter) -
|
||||
obj->worldBoundingSphere.w * obj->worldBoundingSphere.w;
|
||||
|
||||
float discriminant = B * B - 4.0f * C;
|
||||
if (discriminant < 0.0f) {
|
||||
return false;
|
||||
}
|
||||
discriminant = sqrt(discriminant);
|
||||
|
||||
float t0 = (-B - discriminant) * 0.5f;
|
||||
float t1 = (-B + discriminant) * 0.5f;
|
||||
|
||||
if (t0 > t1) {
|
||||
float temp = t0;
|
||||
t0 = t1;
|
||||
t1 = temp;
|
||||
}
|
||||
|
||||
// The sphere is behind us
|
||||
if (t1 < 0.0f) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
#endif // _TRANSFORM_DEF_
|
||||
10
samples/VimL/filenames/.nvimrc
Normal file
10
samples/VimL/filenames/.nvimrc
Normal file
@@ -0,0 +1,10 @@
|
||||
set nocompatible
|
||||
set ignorecase
|
||||
set smartcase
|
||||
set showmatch
|
||||
set showcmd
|
||||
|
||||
syntax on
|
||||
|
||||
set hlsearch " Highlight searches
|
||||
set incsearch " Do incremental searching
|
||||
@@ -1,4 +1,4 @@
|
||||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* -*- Mode: linguist-disable-strategy-modeline-IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* -*- Mode: linguist-disable-strategy-modeline-IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
20
samples/XML/Application.xib
Normal file
20
samples/XML/Application.xib
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6211" systemVersion="14A298i" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6204"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="UIApplication">
|
||||
<connections>
|
||||
<outlet property="delegate" destination="bYg-Ix-Cfg" id="h4M-LL-qlT"/>
|
||||
</connections>
|
||||
</placeholder>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<customObject id="bYg-Ix-Cfg" userLabel="App Delegate"/>
|
||||
<window opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="Na2-4i-xf1">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
|
||||
</window>
|
||||
</objects>
|
||||
</document>
|
||||
7
samples/XML/Storyboard.storyboard
Normal file
7
samples/XML/Storyboard.storyboard
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6211" systemVersion="14A298i" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6204"/>
|
||||
</dependencies>
|
||||
<scenes/>
|
||||
</document>
|
||||
@@ -258,7 +258,7 @@ My name is wisp!"
|
||||
;; evaluating the reference to the value of the corresponding variable.
|
||||
foo
|
||||
|
||||
;; If you wish to refer to the literal symbol, rather then reference you
|
||||
;; If you wish to refer to the literal symbol, rather than reference you
|
||||
;; could use
|
||||
(quote foo)
|
||||
;; or more usually
|
||||
|
||||
1304
tei-odd-sample.odd
Normal file
1304
tei-odd-sample.odd
Normal file
File diff suppressed because it is too large
Load Diff
6
test/fixtures/Data/Modelines/fundamentalEmacs.c
vendored
Normal file
6
test/fixtures/Data/Modelines/fundamentalEmacs.c
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
// -*- fundamental -*-
|
||||
|
||||
int main(int argc, char * argc[])
|
||||
{
|
||||
this should not be syntax highlighted, even though it looks like c.
|
||||
}
|
||||
2
test/fixtures/Data/Modelines/seeplusplusEmacs1
vendored
Normal file
2
test/fixtures/Data/Modelines/seeplusplusEmacs1
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
// -*-c++-*-
|
||||
template <typename X> class { X i; };
|
||||
2
test/fixtures/Data/Modelines/seeplusplusEmacs2
vendored
Normal file
2
test/fixtures/Data/Modelines/seeplusplusEmacs2
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
// -*- c++ -*-
|
||||
template <typename X> class { X i; };
|
||||
2
test/fixtures/Data/Modelines/seeplusplusEmacs3
vendored
Normal file
2
test/fixtures/Data/Modelines/seeplusplusEmacs3
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
// -*- mode:C++ -*-
|
||||
template <typename X> class { X i; };
|
||||
2
test/fixtures/Data/Modelines/seeplusplusEmacs4
vendored
Normal file
2
test/fixtures/Data/Modelines/seeplusplusEmacs4
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
// -*- font:bar;mode:c++ -*-
|
||||
template <typename X> class { X i; };
|
||||
2
test/fixtures/Data/Modelines/seeplusplusEmacs5
vendored
Normal file
2
test/fixtures/Data/Modelines/seeplusplusEmacs5
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
// -*-foo:bar;mode:c++;bar:foo-*-
|
||||
template <typename X> class { X i; };
|
||||
2
test/fixtures/Data/Modelines/seeplusplusEmacs6
vendored
Normal file
2
test/fixtures/Data/Modelines/seeplusplusEmacs6
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
// -*- foo : bar ; mode : c++ ; bar : foo -*-
|
||||
template <typename X> class { X i; };
|
||||
2
test/fixtures/Data/Modelines/seeplusplusEmacs7
vendored
Normal file
2
test/fixtures/Data/Modelines/seeplusplusEmacs7
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
// -*- mode : c++ ; bar : foo -*-
|
||||
template <typename X> class { X i; };
|
||||
2
test/fixtures/Data/Modelines/seeplusplusEmacs8
vendored
Normal file
2
test/fixtures/Data/Modelines/seeplusplusEmacs8
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
// -*- font:x;foo : bar ; mode : C++ ; bar : foo ; foooooo:baaaaar;fo:ba-*-
|
||||
template <typename X> class { X i; };
|
||||
2
test/fixtures/Data/Modelines/seeplusplusEmacs9
vendored
Normal file
2
test/fixtures/Data/Modelines/seeplusplusEmacs9
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
// -*-foo:bar;mode:c++;bar:foo;tyrell:corp-*-
|
||||
template <typename X> class { X i; };
|
||||
12
test/fixtures/Data/sourcemap.v1.map
vendored
Normal file
12
test/fixtures/Data/sourcemap.v1.map
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
/** Begin line maps. **/{ “file”:”out.js”, "count": 2 }
|
||||
[0,0,0,0,0,0,1,1,1,1,2]
|
||||
[2,2,2,2,2,2,3,4,4,4,4,4]
|
||||
/** Begin file information. **/
|
||||
[“a.js”, “b.js”]
|
||||
[“b.js”, “c.js”, “d.js”]
|
||||
/** Begin mapping definitions. **/
|
||||
["a.js", 1, 34]
|
||||
["a.js", 5, 2]
|
||||
["b.js", 1, 3, "event"]
|
||||
["c.js", 1, 4]
|
||||
["d.js", 3, 78, "foo"]
|
||||
1
test/fixtures/Data/sourcemap.v3.map
vendored
Normal file
1
test/fixtures/Data/sourcemap.v3.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"out.js","sourceRoot":"","sources":["foo.js","bar.js"],"sourcesContent":[null,null],"names":["src","maps","are","fun"],"mappings":"A,AAAB;;ABCDE;"}
|
||||
@@ -421,6 +421,7 @@ class TestBlob < Minitest::Test
|
||||
# Test fixtures
|
||||
assert sample_blob("test/fixtures/random.rkt").vendored?
|
||||
assert sample_blob("Test/fixtures/random.rkt").vendored?
|
||||
assert sample_blob("tests/fixtures/random.rkt").vendored?
|
||||
|
||||
# Cordova/PhoneGap
|
||||
assert sample_blob("cordova.js").vendored?
|
||||
@@ -457,6 +458,13 @@ class TestBlob < Minitest::Test
|
||||
|
||||
assert_predicate fixture_blob(".google_apis/bar.jar"), :vendored?
|
||||
assert_predicate fixture_blob("foo/.google_apis/bar.jar"), :vendored?
|
||||
|
||||
# Sphinx docs
|
||||
assert sample_blob("docs/_build/asset.doc").vendored?
|
||||
assert sample_blob("docs/theme/file.css").vendored?
|
||||
|
||||
# Vagrant
|
||||
assert sample_blob("puphpet/file.pp").vendored?
|
||||
end
|
||||
|
||||
def test_documentation
|
||||
|
||||
@@ -5,47 +5,66 @@ class TestGenerated < Minitest::Test
|
||||
|
||||
class DataLoadedError < StandardError; end
|
||||
|
||||
def generated_without_loading_data(name)
|
||||
blob = File.join(samples_path, name)
|
||||
def generated_without_loading_data(blob)
|
||||
begin
|
||||
assert Generated.generated?(blob, lambda { raise DataLoadedError.new }), "#{name} was not recognized as a generated file"
|
||||
assert Generated.generated?(blob, lambda { raise DataLoadedError.new }), "#{blob} was not recognized as a generated file"
|
||||
rescue DataLoadedError
|
||||
assert false, "Data was loaded when calling generated? on #{name}"
|
||||
assert false, "Data was loaded when calling generated? on #{blob}"
|
||||
end
|
||||
end
|
||||
|
||||
def generated_loading_data(name)
|
||||
blob = File.join(samples_path, name)
|
||||
assert_raises(DataLoadedError, "Data wasn't loaded when calling generated? on #{name}") do
|
||||
def generated_loading_data(blob)
|
||||
assert_raises(DataLoadedError, "Data wasn't loaded when calling generated? on #{blob}") do
|
||||
Generated.generated?(blob, lambda { raise DataLoadedError.new })
|
||||
end
|
||||
end
|
||||
|
||||
def test_check_generated_without_loading_data
|
||||
def generated_fixture_without_loading_data(name)
|
||||
generated_without_loading_data(File.join(fixtures_path, name))
|
||||
end
|
||||
|
||||
def generated_fixture_loading_data(name)
|
||||
generated_loading_data(File.join(fixtures_path, name))
|
||||
end
|
||||
|
||||
def generated_sample_without_loading_data(name)
|
||||
generated_without_loading_data(File.join(samples_path, name))
|
||||
end
|
||||
|
||||
def generated_sample_loading_data(name)
|
||||
generated_loading_data(File.join(samples_path, name))
|
||||
end
|
||||
|
||||
def test_check_generated
|
||||
# Xcode project files
|
||||
generated_without_loading_data("Binary/MainMenu.nib")
|
||||
generated_without_loading_data("Dummy/foo.xcworkspacedata")
|
||||
generated_without_loading_data("Dummy/foo.xcuserstate")
|
||||
generated_sample_without_loading_data("Binary/MainMenu.nib")
|
||||
generated_sample_without_loading_data("Dummy/foo.xcworkspacedata")
|
||||
generated_sample_without_loading_data("Dummy/foo.xcuserstate")
|
||||
|
||||
# .NET designer file
|
||||
generated_without_loading_data("Dummu/foo.designer.cs")
|
||||
generated_sample_without_loading_data("Dummu/foo.designer.cs")
|
||||
|
||||
# Composer generated composer.lock file
|
||||
generated_without_loading_data("JSON/composer.lock")
|
||||
generated_sample_without_loading_data("JSON/composer.lock")
|
||||
|
||||
# Node modules
|
||||
generated_without_loading_data("Dummy/node_modules/foo.js")
|
||||
generated_sample_without_loading_data("Dummy/node_modules/foo.js")
|
||||
|
||||
# Godep saved dependencies
|
||||
generated_without_loading_data("Godeps/Godeps.json")
|
||||
generated_without_loading_data("Godeps/_workspace/src/github.com/kr/s3/sign.go")
|
||||
generated_sample_without_loading_data("Godeps/Godeps.json")
|
||||
generated_sample_without_loading_data("Godeps/_workspace/src/github.com/kr/s3/sign.go")
|
||||
|
||||
# Generated by Zephir
|
||||
generated_without_loading_data("C/exception.zep.c")
|
||||
generated_without_loading_data("C/exception.zep.h")
|
||||
generated_without_loading_data("PHP/exception.zep.php")
|
||||
generated_sample_without_loading_data("C/exception.zep.c")
|
||||
generated_sample_without_loading_data("C/exception.zep.h")
|
||||
generated_sample_without_loading_data("PHP/exception.zep.php")
|
||||
|
||||
# Minified files
|
||||
generated_loading_data("JavaScript/jquery-1.6.1.min.js")
|
||||
generated_sample_loading_data("JavaScript/jquery-1.6.1.min.js")
|
||||
|
||||
# Source Map
|
||||
generated_fixture_without_loading_data("Data/bootstrap.css.map")
|
||||
generated_fixture_loading_data("Data/sourcemap.v3.map")
|
||||
generated_fixture_loading_data("Data/sourcemap.v1.map")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -13,7 +13,6 @@ class TestGrammars < Minitest::Test
|
||||
# These grammars have no license but have been grandfathered in. New grammars
|
||||
# must have a license that allows redistribution.
|
||||
"vendor/grammars/Sublime-Lasso",
|
||||
"vendor/grammars/Sublime-REBOL",
|
||||
"vendor/grammars/x86-assembly-textmate-bundle"
|
||||
].freeze
|
||||
|
||||
|
||||
@@ -10,6 +10,16 @@ class TestModelines < Minitest::Test
|
||||
def test_modeline_strategy
|
||||
assert_modeline Language["Ruby"], fixture_blob("Data/Modelines/ruby")
|
||||
assert_modeline Language["C++"], fixture_blob("Data/Modelines/seeplusplus")
|
||||
assert_modeline Language["C++"], fixture_blob("Data/Modelines/seeplusplusEmacs1")
|
||||
assert_modeline Language["C++"], fixture_blob("Data/Modelines/seeplusplusEmacs2")
|
||||
assert_modeline Language["C++"], fixture_blob("Data/Modelines/seeplusplusEmacs3")
|
||||
assert_modeline Language["C++"], fixture_blob("Data/Modelines/seeplusplusEmacs4")
|
||||
assert_modeline Language["C++"], fixture_blob("Data/Modelines/seeplusplusEmacs5")
|
||||
assert_modeline Language["C++"], fixture_blob("Data/Modelines/seeplusplusEmacs6")
|
||||
assert_modeline Language["C++"], fixture_blob("Data/Modelines/seeplusplusEmacs7")
|
||||
assert_modeline Language["C++"], fixture_blob("Data/Modelines/seeplusplusEmacs8")
|
||||
assert_modeline Language["C++"], fixture_blob("Data/Modelines/seeplusplusEmacs9")
|
||||
assert_modeline Language["Text"], fixture_blob("Data/Modelines/fundamentalEmacs.c")
|
||||
assert_modeline Language["Prolog"], fixture_blob("Data/Modelines/not_perl.pl")
|
||||
assert_modeline Language["Smalltalk"], fixture_blob("Data/Modelines/example_smalltalk.md")
|
||||
assert_modeline Language["PHP"], fixture_blob("Data/Modelines/iamphp.inc")
|
||||
@@ -18,6 +28,16 @@ class TestModelines < Minitest::Test
|
||||
def test_modeline_languages
|
||||
assert_equal Language["Ruby"], fixture_blob("Data/Modelines/ruby").language
|
||||
assert_equal Language["C++"], fixture_blob("Data/Modelines/seeplusplus").language
|
||||
assert_equal Language["C++"], fixture_blob("Data/Modelines/seeplusplusEmacs1").language
|
||||
assert_equal Language["C++"], fixture_blob("Data/Modelines/seeplusplusEmacs2").language
|
||||
assert_equal Language["C++"], fixture_blob("Data/Modelines/seeplusplusEmacs3").language
|
||||
assert_equal Language["C++"], fixture_blob("Data/Modelines/seeplusplusEmacs4").language
|
||||
assert_equal Language["C++"], fixture_blob("Data/Modelines/seeplusplusEmacs5").language
|
||||
assert_equal Language["C++"], fixture_blob("Data/Modelines/seeplusplusEmacs6").language
|
||||
assert_equal Language["C++"], fixture_blob("Data/Modelines/seeplusplusEmacs7").language
|
||||
assert_equal Language["C++"], fixture_blob("Data/Modelines/seeplusplusEmacs8").language
|
||||
assert_equal Language["C++"], fixture_blob("Data/Modelines/seeplusplusEmacs9").language
|
||||
assert_equal Language["Text"], fixture_blob("Data/Modelines/fundamentalEmacs.c").language
|
||||
assert_equal Language["Prolog"], fixture_blob("Data/Modelines/not_perl.pl").language
|
||||
assert_equal Language["Smalltalk"], fixture_blob("Data/Modelines/example_smalltalk.md").language
|
||||
assert_equal Language["PHP"], fixture_blob("Data/Modelines/iamphp.inc").language
|
||||
|
||||
2
vendor/grammars/CLIPS-sublime
vendored
2
vendor/grammars/CLIPS-sublime
vendored
Submodule vendor/grammars/CLIPS-sublime updated: 7ded830d5e...6a11bc512e
2
vendor/grammars/ColdFusion
vendored
2
vendor/grammars/ColdFusion
vendored
Submodule vendor/grammars/ColdFusion updated: ee54c80589...3e7e68b14d
2
vendor/grammars/Handlebars
vendored
2
vendor/grammars/Handlebars
vendored
Submodule vendor/grammars/Handlebars updated: 7bbedb0258...1a952fd7e4
2
vendor/grammars/Julia.tmbundle
vendored
2
vendor/grammars/Julia.tmbundle
vendored
Submodule vendor/grammars/Julia.tmbundle updated: 6541d86c1f...774831f52a
2
vendor/grammars/Stylus
vendored
2
vendor/grammars/Stylus
vendored
Submodule vendor/grammars/Stylus updated: c4897b0f97...8070df9be1
2
vendor/grammars/Sublime-REBOL
vendored
2
vendor/grammars/Sublime-REBOL
vendored
Submodule vendor/grammars/Sublime-REBOL updated: 977ba9bb58...102402f71a
1
vendor/grammars/Sublime-Red
vendored
Submodule
1
vendor/grammars/Sublime-Red
vendored
Submodule
Submodule vendor/grammars/Sublime-Red added at 085e0f43b3
2
vendor/grammars/css.tmbundle
vendored
2
vendor/grammars/css.tmbundle
vendored
Submodule vendor/grammars/css.tmbundle updated: 5ba43d76d6...2ce91736ca
2
vendor/grammars/dart-sublime-bundle
vendored
2
vendor/grammars/dart-sublime-bundle
vendored
Submodule vendor/grammars/dart-sublime-bundle updated: d31625391f...2914099c31
2
vendor/grammars/factor
vendored
2
vendor/grammars/factor
vendored
Submodule vendor/grammars/factor updated: e164fcf431...299e4ff3ce
2
vendor/grammars/fsharpbinding
vendored
2
vendor/grammars/fsharpbinding
vendored
Submodule vendor/grammars/fsharpbinding updated: a2ff3ce802...de99a182dd
2
vendor/grammars/haskell.tmbundle
vendored
2
vendor/grammars/haskell.tmbundle
vendored
Submodule vendor/grammars/haskell.tmbundle updated: 2380065409...c3137ccc28
2
vendor/grammars/haxe-sublime-bundle
vendored
2
vendor/grammars/haxe-sublime-bundle
vendored
Submodule vendor/grammars/haxe-sublime-bundle updated: ff10dc8751...5379209622
2
vendor/grammars/html.tmbundle
vendored
2
vendor/grammars/html.tmbundle
vendored
Submodule vendor/grammars/html.tmbundle updated: 4831b07b72...d1231e3da1
2
vendor/grammars/jade-tmbundle
vendored
2
vendor/grammars/jade-tmbundle
vendored
Submodule vendor/grammars/jade-tmbundle updated: b061f52fb3...4197de8b70
2
vendor/grammars/java.tmbundle
vendored
2
vendor/grammars/java.tmbundle
vendored
Submodule vendor/grammars/java.tmbundle updated: ccdebdf888...bed5760ae0
2
vendor/grammars/kotlin-sublime-package
vendored
2
vendor/grammars/kotlin-sublime-package
vendored
Submodule vendor/grammars/kotlin-sublime-package updated: e8e18955d7...3ddc52e8db
2
vendor/grammars/language-javascript
vendored
2
vendor/grammars/language-javascript
vendored
Submodule vendor/grammars/language-javascript updated: 15dd527dae...75d0d94cdd
2
vendor/grammars/language-python
vendored
2
vendor/grammars/language-python
vendored
Submodule vendor/grammars/language-python updated: 8daa10089a...f65cc95f0b
2
vendor/grammars/latex.tmbundle
vendored
2
vendor/grammars/latex.tmbundle
vendored
Submodule vendor/grammars/latex.tmbundle updated: ccc537e8d8...e9bdf04e83
2
vendor/grammars/perl.tmbundle
vendored
2
vendor/grammars/perl.tmbundle
vendored
Submodule vendor/grammars/perl.tmbundle updated: e8a501b8a0...b1f624ee3a
2
vendor/grammars/powershell
vendored
2
vendor/grammars/powershell
vendored
Submodule vendor/grammars/powershell updated: 0d9478d117...18c9f0e553
1
vendor/grammars/sublime-netlinx
vendored
Submodule
1
vendor/grammars/sublime-netlinx
vendored
Submodule
Submodule vendor/grammars/sublime-netlinx added at f7e78c232c
2
vendor/grammars/sublime-rust
vendored
2
vendor/grammars/sublime-rust
vendored
Submodule vendor/grammars/sublime-rust updated: ff3e197ef0...a1c3d2dc96
2
vendor/grammars/sublime_cobol
vendored
2
vendor/grammars/sublime_cobol
vendored
Submodule vendor/grammars/sublime_cobol updated: a7c77c2de0...b848a10104
Reference in New Issue
Block a user