Merge branch 'master' into 1364-local

Conflicts:
	lib/linguist/languages.yml
This commit is contained in:
Arfon Smith
2014-08-13 14:59:31 -07:00
19 changed files with 2119 additions and 106 deletions

View File

@@ -4,6 +4,7 @@
# usage: linguist <path> [<--breakdown>] # usage: linguist <path> [<--breakdown>]
require 'linguist/file_blob' require 'linguist/file_blob'
require 'linguist/language'
require 'linguist/repository' require 'linguist/repository'
require 'rugged' require 'rugged'

View File

@@ -1,6 +1,4 @@
require 'linguist/generated' require 'linguist/generated'
require 'linguist/language'
require 'charlock_holmes' require 'charlock_holmes'
require 'escape_utils' require 'escape_utils'
require 'mime/types' require 'mime/types'

View File

@@ -52,5 +52,20 @@ module Linguist
def size def size
File.size(@path) File.size(@path)
end end
# Public: Get file extension.
#
# Returns a String.
def extension
# File.extname returns nil if the filename is an extension.
extension = File.extname(name)
basename = File.basename(name)
# Checks if the filename is an extension.
if extension.empty? && basename[0] == "."
basename
else
extension
end
end
end end
end end

View File

@@ -54,7 +54,7 @@ module Linguist
name == 'Gemfile.lock' || name == 'Gemfile.lock' ||
minified_files? || minified_files? ||
compiled_coffeescript? || compiled_coffeescript? ||
xcode_project_file? || xcode_file? ||
generated_parser? || generated_parser? ||
generated_net_docfile? || generated_net_docfile? ||
generated_net_designer_file? || generated_net_designer_file? ||
@@ -67,14 +67,14 @@ module Linguist
generated_by_zephir? generated_by_zephir?
end end
# Internal: Is the blob an XCode project file? # Internal: Is the blob an Xcode file?
# #
# Generated if the file extension is an XCode project # Generated if the file extension is an Xcode
# file extension. # file extension.
# #
# Returns true of false. # Returns true of false.
def xcode_project_file? def xcode_file?
['.xib', '.nib', '.storyboard', '.pbxproj', '.xcworkspacedata', '.xcuserstate'].include?(extname) ['.nib', '.xcworkspacedata', '.xcuserstate'].include?(extname)
end end
# Internal: Is the blob minified files? # Internal: Is the blob minified files?
@@ -256,3 +256,4 @@ module Linguist
end end
end end
end end

View File

@@ -9,6 +9,8 @@ end
require 'linguist/classifier' require 'linguist/classifier'
require 'linguist/heuristics' require 'linguist/heuristics'
require 'linguist/samples' require 'linguist/samples'
require 'linguist/file_blob'
require 'linguist/blob_helper'
module Linguist module Linguist
# Language names that are recognizable by GitHub. Defined languages # Language names that are recognizable by GitHub. Defined languages
@@ -109,7 +111,8 @@ module Linguist
# A bit of an elegant hack. If the file is executable but extensionless, # A bit of an elegant hack. If the file is executable but extensionless,
# append a "magic" extension so it can be classified with other # append a "magic" extension so it can be classified with other
# languages that have shebang scripts. # languages that have shebang scripts.
if File.extname(name).empty? && blob.mode && (blob.mode.to_i(8) & 05) == 05 extension = FileBlob.new(name).extension
if extension.empty? && blob.mode && (blob.mode.to_i(8) & 05) == 05
name += ".script!" name += ".script!"
end end
@@ -189,7 +192,8 @@ module Linguist
# #
# Returns all matching Languages or [] if none were found. # Returns all matching Languages or [] if none were found.
def self.find_by_filename(filename) def self.find_by_filename(filename)
basename, extname = File.basename(filename), File.extname(filename) basename = File.basename(filename)
extname = FileBlob.new(filename).extension
langs = @filename_index[basename] + langs = @filename_index[basename] +
@extension_index[extname] @extension_index[extname]
langs.compact.uniq langs.compact.uniq
@@ -528,6 +532,7 @@ module Linguist
if extnames = extensions[name] if extnames = extensions[name]
extnames.each do |extname| extnames.each do |extname|
if !options['extensions'].include?(extname) if !options['extensions'].include?(extname)
warn "#{name} has a sample with extension (#{extname}) that isn't explicitly defined in languages.yml" unless extname == '.script!'
options['extensions'] << extname options['extensions'] << extname
end end
end end

View File

@@ -260,6 +260,7 @@ C:
extensions: extensions:
- .c - .c
- .cats - .cats
- .h
- .w - .w
C#: C#:
@@ -288,6 +289,7 @@ C++:
- .cc - .cc
- .cxx - .cxx
- .H - .H
- .h
- .h++ - .h++
- .hh - .hh
- .hpp - .hpp
@@ -321,7 +323,7 @@ CLIPS:
CMake: CMake:
extensions: extensions:
- .cmake - .cmake
- .cmake.in - .in
filenames: filenames:
- CMakeLists.txt - CMakeLists.txt
@@ -380,7 +382,7 @@ Clojure:
- .cljscm - .cljscm
- .cljx - .cljx
- .hic - .hic
- .cljs.hl - .hl
filenames: filenames:
- riemann.config - riemann.config
@@ -444,6 +446,7 @@ Coq:
type: programming type: programming
extensions: extensions:
- .coq - .coq
- .v
Cpp-ObjDump: Cpp-ObjDump:
type: data type: data
@@ -479,6 +482,12 @@ Cuda:
- .cu - .cu
- .cuh - .cuh
Cycript:
type: programming
lexer: JavaScript
extensions:
- .cy
Cython: Cython:
type: programming type: programming
group: Python group: Python
@@ -533,6 +542,7 @@ Dart:
Diff: Diff:
extensions: extensions:
- .diff - .diff
- .patch
Dogescript: Dogescript:
type: programming type: programming
@@ -617,6 +627,7 @@ Erlang:
color: "#0faf8d" color: "#0faf8d"
extensions: extensions:
- .erl - .erl
- .escript
- .hrl - .hrl
F#: F#:
@@ -692,6 +703,7 @@ Forth:
extensions: extensions:
- .fth - .fth
- .4th - .4th
- .forth
Frege: Frege:
type: programming type: programming
@@ -800,6 +812,9 @@ Gosu:
color: "#82937f" color: "#82937f"
extensions: extensions:
- .gs - .gs
- .gst
- .gsx
- .vark
Grace: Grace:
type: programming type: programming
@@ -835,6 +850,7 @@ Groovy:
color: "#e69f56" color: "#e69f56"
extensions: extensions:
- .groovy - .groovy
- .gradle
- .grt - .grt
- .gtpl - .gtpl
- .gvy - .gvy
@@ -857,7 +873,6 @@ HTML:
extensions: extensions:
- .html - .html
- .htm - .htm
- .html.hl
- .st - .st
- .xhtml - .xhtml
@@ -877,9 +892,7 @@ HTML+ERB:
- erb - erb
extensions: extensions:
- .erb - .erb
- .erb.deface - .deface
- .html.erb
- .html.erb.deface
HTML+PHP: HTML+PHP:
type: markup type: markup
@@ -897,17 +910,14 @@ Haml:
type: markup type: markup
extensions: extensions:
- .haml - .haml
- .haml.deface - .deface
- .html.haml.deface
Handlebars: Handlebars:
type: markup type: markup
lexer: Text only lexer: Handlebars
extensions: extensions:
- .handlebars - .handlebars
- .hbs - .hbs
- .html.handlebars
- .html.hbs
Harbour: Harbour:
type: programming type: programming
@@ -945,6 +955,7 @@ IDL:
color: "#e3592c" color: "#e3592c"
extensions: extensions:
- .pro - .pro
- .dlm
INI: INI:
type: data type: data
@@ -1019,6 +1030,7 @@ JSON:
searchable: false searchable: false
extensions: extensions:
- .json - .json
- .lock
- .sublime-keymap - .sublime-keymap
- .sublime-mousemap - .sublime-mousemap
- .sublime-project - .sublime-project
@@ -1147,6 +1159,9 @@ Lasso:
color: "#2584c3" color: "#2584c3"
extensions: extensions:
- .lasso - .lasso
- .las
- .lasso9
- .ldml
Latte: Latte:
type: markup type: markup
@@ -1232,6 +1247,7 @@ Lua:
extensions: extensions:
- .lua - .lua
- .nse - .nse
- .pd_lua
- .rbxs - .rbxs
interpreters: interpreters:
- lua - lua
@@ -1345,7 +1361,7 @@ MiniD: # Legacy
Mirah: Mirah:
type: programming type: programming
lexer: Ruby lexer: Ruby
search_term: ruby search_term: mirah
color: "#c7a938" color: "#c7a938"
extensions: extensions:
- .druby - .druby
@@ -1377,6 +1393,7 @@ Myghty:
NSIS: NSIS:
extensions: extensions:
- .nsi - .nsi
- .nsh
Nemerle: Nemerle:
type: programming type: programming
@@ -1441,6 +1458,7 @@ OCaml:
color: "#3be133" color: "#3be133"
extensions: extensions:
- .ml - .ml
- .eliom
- .eliomi - .eliomi
- .ml4 - .ml4
- .mli - .mli
@@ -1461,6 +1479,7 @@ Objective-C:
- objc - objc
extensions: extensions:
- .m - .m
- .h
Objective-C++: Objective-C++:
type: programming type: programming
@@ -1508,6 +1527,7 @@ OpenEdge ABL:
- abl - abl
extensions: extensions:
- .p - .p
- .cls
Org: Org:
type: prose type: prose
@@ -1546,6 +1566,7 @@ PHP:
- .php - .php
- .aw - .aw
- .ctp - .ctp
- .module
- .php3 - .php3
- .php4 - .php4
- .php5 - .php5
@@ -1594,6 +1615,7 @@ Pascal:
extensions: extensions:
- .pas - .pas
- .dfm - .dfm
- .dpr
- .lpr - .lpr
Perl: Perl:
@@ -1604,6 +1626,7 @@ Perl:
- .pl - .pl
- .PL - .PL
- .cgi - .cgi
- .fcgi
- .perl - .perl
- .ph - .ph
- .plx - .plx
@@ -1819,6 +1842,7 @@ Racket:
- .rkt - .rkt
- .rktd - .rktd
- .rktl - .rktl
- .scrbl
Ragel in Ruby Host: Ragel in Ruby Host:
type: programming type: programming
@@ -1888,7 +1912,10 @@ Ruby:
- .god - .god
- .irbrc - .irbrc
- .mspec - .mspec
- .pluginspec
- .podspec - .podspec
- .rabl
- .rake
- .rbuild - .rbuild
- .rbw - .rbw
- .rbx - .rbx
@@ -1962,6 +1989,7 @@ Sass:
group: CSS group: CSS
extensions: extensions:
- .sass - .sass
- .scss
Scala: Scala:
type: programming type: programming
@@ -1969,6 +1997,7 @@ Scala:
color: "#7dd3b0" color: "#7dd3b0"
extensions: extensions:
- .scala - .scala
- .sbt
- .sc - .sc
Scaml: Scaml:
@@ -1984,6 +2013,7 @@ Scheme:
- .scm - .scm
- .sld - .sld
- .sls - .sls
- .sps
- .ss - .ss
interpreters: interpreters:
- guile - guile
@@ -1995,6 +2025,8 @@ Scilab:
type: programming type: programming
extensions: extensions:
- .sci - .sci
- .sce
- .tst
Self: Self:
type: programming type: programming
@@ -2014,8 +2046,10 @@ Shell:
- zsh - zsh
extensions: extensions:
- .sh - .sh
- .bash
- .bats - .bats
- .tmux - .tmux
- .zsh
interpreters: interpreters:
- bash - bash
- sh - sh
@@ -2082,6 +2116,7 @@ Standard ML:
extensions: extensions:
- .ML - .ML
- .fun - .fun
- .sig
- .sml - .sml
Stata: Stata:
@@ -2282,6 +2317,7 @@ Visual Basic:
extensions: extensions:
- .vb - .vb
- .bas - .bas
- .cls
- .frm - .frm
- .frx - .frx
- .vba - .vba
@@ -2310,6 +2346,7 @@ XML:
- wsdl - wsdl
extensions: extensions:
- .xml - .xml
- .ant
- .axml - .axml
- .ccxml - .ccxml
- .clixml - .clixml
@@ -2323,6 +2360,7 @@ XML:
- .fsproj - .fsproj
- .glade - .glade
- .grxml - .grxml
- .ivy
- .jelly - .jelly
- .kml - .kml
- .launch - .launch

View File

@@ -92,7 +92,8 @@
".cljs", ".cljs",
".cljscm", ".cljscm",
".cljx", ".cljx",
".hic" ".hic",
".hl"
], ],
"CoffeeScript": [ "CoffeeScript": [
".coffee" ".coffee"
@@ -118,6 +119,9 @@
".cu", ".cu",
".cuh" ".cuh"
], ],
"Cycript": [
".cy"
],
"DM": [ "DM": [
".dm" ".dm"
], ],
@@ -209,7 +213,12 @@
".html", ".html",
".st" ".st"
], ],
"HTML+ERB": [
".deface",
".erb"
],
"Haml": [ "Haml": [
".deface",
".haml" ".haml"
], ],
"Handlebars": [ "Handlebars": [
@@ -740,6 +749,9 @@
"Nginx": [ "Nginx": [
"nginx.conf" "nginx.conf"
], ],
"PHP": [
".php"
],
"Perl": [ "Perl": [
"ack" "ack"
], ],
@@ -782,6 +794,9 @@
".gvimrc", ".gvimrc",
".vimrc" ".vimrc"
], ],
"XML": [
".cproject"
],
"YAML": [ "YAML": [
".gemrc" ".gemrc"
], ],
@@ -791,8 +806,8 @@
"exception.zep.php" "exception.zep.php"
] ]
}, },
"tokens_total": 629226, "tokens_total": 632405,
"languages_total": 867, "languages_total": 874,
"tokens": { "tokens": {
"ABAP": { "ABAP": {
"*/**": 1, "*/**": 1,
@@ -15172,77 +15187,247 @@
"container": 3 "container": 3
}, },
"Clojure": { "Clojure": {
"(": 83, "(": 258,
"defn": 4, "defn": 14,
"prime": 2, "prime": 2,
"[": 41, "[": 67,
"n": 9, "n": 9,
"]": 41, "]": 67,
"not": 3, "not": 9,
"-": 14, "-": 70,
"any": 1, "any": 3,
"zero": 1, "zero": 2,
"map": 2, "map": 3,
"#": 1, "#": 14,
"rem": 2, "rem": 2,
"%": 1, "%": 6,
")": 84, ")": 259,
"range": 3, "range": 3,
";": 8, ";": 353,
"while": 3, "while": 3,
"stops": 1, "stops": 1,
"at": 1, "at": 2,
"the": 1, "the": 5,
"first": 2, "first": 2,
"collection": 1, "collection": 1,
"element": 1, "element": 1,
"that": 1, "that": 1,
"evaluates": 1, "evaluates": 1,
"to": 1, "to": 2,
"false": 2, "false": 6,
"like": 1, "like": 1,
"take": 1, "take": 1,
"for": 2, "for": 4,
"x": 6, "x": 8,
"html": 1, "html": 2,
"head": 1, "head": 2,
"meta": 1, "meta": 3,
"{": 8, "{": 17,
"charset": 1, "charset": 2,
"}": 8, "}": 17,
"link": 1, "link": 2,
"rel": 1, "rel": 2,
"href": 1, "href": 6,
"script": 1, "script": 1,
"src": 1, "src": 1,
"body": 1, "body": 2,
"div.nav": 1, "div.nav": 1,
"p": 1, "p": 4,
"into": 2, "Copyright": 1,
"c": 1,
"Alan": 1,
"Dipert": 1,
"and": 8,
"Micha": 1,
"Niskin.": 1,
"All": 1,
"rights": 1,
"reserved.": 1,
"The": 1,
"use": 3,
"distribution": 1,
"terms": 2,
"this": 6,
"software": 2,
"are": 2,
"covered": 1,
"by": 4,
"Eclipse": 1,
"Public": 1,
"License": 1,
"http": 2,
"//opensource.org/licenses/eclipse": 1,
"php": 1,
"which": 2,
"can": 1,
"be": 2,
"found": 1,
"in": 4,
"file": 1,
"epl": 1,
"v10.html": 1,
"root": 1,
"of": 2,
"distribution.": 1,
"By": 1,
"using": 1,
"fashion": 1,
"you": 1,
"agreeing": 1,
"bound": 1,
"license.": 1,
"You": 1,
"must": 1,
"remove": 3,
"notice": 1,
"or": 2,
"other": 1,
"from": 1,
"software.": 1,
"page": 2,
"refer": 4,
"clojure": 1,
"exclude": 1,
"nth": 2,
"require": 2,
"tailrecursion.hoplon.reload": 1,
"reload": 2,
"all": 5,
"tailrecursion.hoplon.util": 1,
"name": 1,
"pluralize": 2,
"tailrecursion.hoplon.storage": 1,
"atom": 1,
"local": 3,
"storage": 2,
"utility": 1,
"functions": 2,
"declare": 1,
"route": 11,
"state": 15,
"editing": 13,
"def": 4,
"mapvi": 2,
"comp": 1,
"vec": 2,
"indexed": 1,
"dissocv": 2,
"v": 15,
"i": 20,
"let": 3,
"z": 4,
"dec": 1,
"count": 5,
"cond": 2,
"neg": 1,
"pop": 1,
"pos": 1,
"into": 3,
"subvec": 2,
"inc": 2,
"decorate": 2,
"todo": 10,
"done": 12,
"completed": 12,
"text": 14,
"assoc": 4,
"visible": 2,
"empty": 8,
"persisted": 1,
"cell": 12,
"AKA": 1,
"stem": 1,
"store": 1,
"cells": 2,
"defc": 6,
"loaded": 1,
"nil": 3,
"formula": 1,
"computed": 1,
"filter": 2,
"active": 5,
"plural": 1,
"item": 1,
"todos": 2,
"list": 1,
"transition": 1,
"t": 5,
"destroy": 3,
"swap": 6,
"clear": 2,
"&": 1,
"_": 4,
"new": 5,
"when": 3,
"conj": 1,
"mapv": 1,
"fn": 3,
"reset": 1,
"if": 3,
"lang": 1,
"equiv": 1,
"content": 1,
"title": 1,
"noscript": 1,
"div": 3,
"id": 20,
"section": 2,
"header": 1,
"h1": 1,
"form": 2,
"on": 11,
"submit": 2,
"do": 15,
"val": 4,
"value": 3,
"input": 4,
"type": 8,
"autofocus": 1,
"true": 5,
"placeholder": 1,
"blur": 2,
"toggle": 4,
"attr": 2,
"checked": 2,
"click": 4,
"label": 2,
"ul": 2,
"loop": 2,
"tpl": 1,
"reverse": 1,
"bind": 1,
"ids": 1,
"done#": 3,
"edit#": 3,
"bindings": 1,
"edit": 3,
"show": 2,
"li": 4,
"class": 8,
"dblclick": 1,
"@i": 6,
"button": 2,
"focus": 1,
"@edit": 2,
"change": 1,
"footer": 2,
"span": 2,
"strong": 1,
"a": 7,
"selected": 3,
"array": 3, "array": 3,
"aseq": 8, "aseq": 8,
"nil": 1,
"type": 2,
"let": 1,
"count": 3,
"a": 3,
"make": 1, "make": 1,
"loop": 1,
"seq": 1, "seq": 1,
"i": 4,
"if": 1,
"<": 1, "<": 1,
"do": 1,
"aset": 1, "aset": 1,
"recur": 1, "recur": 1,
"next": 1, "next": 1,
"inc": 1,
"defprotocol": 1, "defprotocol": 1,
"ISound": 4, "ISound": 4,
"sound": 5, "sound": 5,
"deftype": 2, "deftype": 2,
"Cat": 1, "Cat": 1,
"_": 3,
"Dog": 1, "Dog": 1,
"extend": 1, "extend": 1,
"default": 1, "default": 1,
@@ -15253,7 +15438,6 @@
"clj": 1, "clj": 1,
"ns": 2, "ns": 2,
"c2.svg": 2, "c2.svg": 2,
"use": 2,
"c2.core": 2, "c2.core": 2,
"only": 4, "only": 4,
"unify": 2, "unify": 2,
@@ -15267,39 +15451,30 @@
"cos": 2, "cos": 2,
"mean": 2, "mean": 2,
"cljs": 3, "cljs": 3,
"require": 1,
"c2.dom": 1, "c2.dom": 1,
"as": 1, "as": 1,
"dom": 1, "dom": 1,
"Stub": 1, "Stub": 1,
"float": 2, "float": 2,
"fn": 2,
"which": 1,
"does": 1, "does": 1,
"exist": 1, "exist": 1,
"on": 1,
"runtime": 1, "runtime": 1,
"def": 1,
"identity": 1, "identity": 1,
"xy": 1, "xy": 1,
"coordinates": 7, "coordinates": 7,
"cond": 1,
"and": 1,
"vector": 1, "vector": 1,
"y": 1, "y": 1,
"deftest": 1, "deftest": 1,
"function": 1, "function": 1,
"tests": 1, "tests": 1,
"is": 7, "is": 7,
"true": 2,
"contains": 1, "contains": 1,
"foo": 6, "foo": 6,
"bar": 4, "bar": 4,
"select": 1, "select": 1,
"keys": 2, "keys": 2,
"baz": 4, "baz": 4,
"vals": 1, "vals": 1
"filter": 1
}, },
"CoffeeScript": { "CoffeeScript": {
"CoffeeScript": 1, "CoffeeScript": 1,
@@ -18273,6 +18448,122 @@
"cudaDeviceReset": 1, "cudaDeviceReset": 1,
"return": 1 "return": 1
}, },
"Cycript": {
"(": 12,
"function": 2,
"utils": 2,
")": 12,
"{": 8,
"//": 4,
"Load": 1,
"C": 2,
"functions": 3,
"declared": 1,
"in": 2,
"utils.loadFuncs": 1,
"var": 6,
"shouldLoadCFuncs": 2,
"true": 2,
";": 21,
"Expose": 2,
"the": 1,
"to": 4,
"cycript": 2,
"s": 2,
"global": 1,
"scope": 1,
"shouldExposeConsts": 2,
"defined": 1,
"here": 1,
"t": 1,
"be": 2,
"found": 2,
"with": 1,
"dlsym": 1,
"Failed": 1,
"load": 1,
"mach_vm_address_t": 1,
"string": 4,
"@encode": 2,
"infinite": 1,
"*": 1,
"length": 1,
"[": 8,
"object": 1,
"Struct": 1,
"]": 8,
"%": 8,
"@": 3,
"<%@:>": 1,
"0x": 1,
"+": 3,
"-": 2,
"printf": 1,
".3s": 1,
"d": 2,
"c": 5,
"float": 1,
"f": 1,
"n": 1,
"foo": 2,
"barrrr": 1,
"Args": 1,
"needs": 1,
"an": 1,
"array": 1,
"number": 1,
"Function": 1,
"not": 1,
"foobar": 2,
"strdup": 2,
"pipe": 1,
"write": 1,
"close": 2,
"int": 1,
"a": 1,
"short": 1,
"b": 1,
"char": 1,
"uint64_t": 1,
"double": 1,
"e": 1,
"struct": 1,
"}": 9,
"return": 1,
"new": 1,
"Type": 1,
"typeStr": 1,
"Various": 1,
"constants": 1,
"utils.constants": 2,
"VM_PROT_NONE": 1,
"VM_PROT_READ": 1,
"VM_PROT_WRITE": 1,
"VM_PROT_EXECUTE": 1,
"VM_PROT_NO_CHANGE": 1,
"VM_PROT_COPY": 1,
"VM_PROT_WANTS_COPY": 1,
"VM_PROT_IS_MASK": 1,
"c.VM_PROT_DEFAULT": 1,
"c.VM_PROT_READ": 2,
"|": 3,
"c.VM_PROT_WRITE": 2,
"c.VM_PROT_ALL": 1,
"c.VM_PROT_EXECUTE": 1,
"if": 3,
"for": 2,
"k": 3,
"Cycript.all": 2,
"shouldExposeFuncs": 1,
"i": 4,
"<": 1,
"funcsToExpose.length": 1,
"name": 3,
"funcsToExpose": 1,
"utils.loadfuncs": 1,
"shouldExposeCFuncs": 1,
"exports": 1
},
"DM": { "DM": {
"#define": 4, "#define": 4,
"PI": 6, "PI": 6,
@@ -25999,8 +26290,139 @@
"with": 1, "with": 1,
"Doxygen": 1 "Doxygen": 1
}, },
"HTML+ERB": {
"<%>": 12,
"if": 3,
"Spree": 4,
"Config": 4,
"enable_fishbowl": 1,
"<div>": 23,
"class=": 24,
"id=": 1,
"<fieldset>": 1,
"<legend>": 1,
"align=": 1,
"<%=>": 12,
"t": 4,
"fishbowl_settings": 1,
"</legend>": 1,
"fishbowl_options": 1,
"each": 1,
"do": 2,
"key": 5,
"label_tag": 2,
"to_s": 2,
"gsub": 1,
"fishbowl_": 1,
"to_sym": 1,
"tag": 2,
"br": 2,
"text_field_tag": 1,
"preferences": 4,
"size": 1,
"class": 2,
"}": 3,
")": 4,
"%": 2,
"</div>": 23,
"end": 5,
"hidden_field_tag": 1,
"fishbowl_always_fetch_current_inventory": 3,
"0": 1,
"check_box_tag": 1,
"1": 1,
"always_fetch_current_inventory": 1,
"location_groups": 2,
"empty": 1,
"fishbowl_location_group": 3,
"location_group": 1,
"select": 1,
"selected": 1,
"[": 2,
"]": 2,
"{": 1,
"</fieldset>": 1,
"<script>": 1,
"type=": 1,
"(": 2,
".select2": 1,
";": 1,
"</script>": 1,
"provide": 1,
"title": 1,
"header": 2,
"present": 1,
"users": 3,
"user_presenter": 1,
"<h1>": 1,
"</h1>": 1,
"will_paginate": 2,
"Name": 1,
"Email": 1,
"Chords": 1,
"Keys": 1,
"Tunings": 1,
"Credits": 1,
"Prem": 1,
"Since": 1,
"No": 1,
"Users": 1,
"else": 1,
"render": 1
},
"Haml": { "Haml": {
"%": 1, "/": 1,
"replace": 1,
".pull": 1,
"-": 16,
"right": 1,
".btn": 2,
"group": 2,
"link_to": 4,
"page.url": 1,
"target": 1,
"title": 5,
"t": 5,
"(": 10,
")": 10,
"class": 4,
"do": 4,
"%": 7,
"i.icon": 5,
"picture.row": 1,
"black": 1,
"refinery.edit_admin_page_path": 1,
"page.nested_url": 2,
"switch_locale": 1,
"page.translations.first.locale": 1,
"unless": 1,
"page.translated_to_default_locale": 1,
"scope": 4,
"edit.row": 1,
"blue": 1,
"if": 1,
"page.deletable": 1,
"refinery.admin_page_path": 1,
"methode": 1,
"delete": 1,
"data": 1,
"{": 1,
"confirm": 1,
"page_title_with_translations": 1,
"page": 1,
"}": 1,
"trash.row": 1,
"red": 1,
"else": 1,
"button.btn.btn": 1,
"xs.btn": 1,
"default.disabled": 1,
"trash": 1,
"refinery.new_admin_page_path": 1,
"parent_id": 1,
"page.id": 1,
"plus.row": 1,
"green": 1,
"p": 1, "p": 1,
"Hello": 1, "Hello": 1,
"World": 1 "World": 1
@@ -49935,7 +50357,7 @@
}, },
"PHP": { "PHP": {
"<": 11, "<": 11,
"php": 12, "php": 14,
"namespace": 28, "namespace": 28,
"Symfony": 24, "Symfony": 24,
"Component": 24, "Component": 24,
@@ -50659,6 +51081,19 @@
"base_url": 1, "base_url": 1,
"php_filter_info": 1, "php_filter_info": 1,
"filters": 2, "filters": 2,
"SHEBANG#!php": 4,
"<?>": 1,
"aMenuLinks": 1,
"Array": 13,
"Blog": 1,
"SITE_DIR": 4,
"Photos": 1,
"photo": 1,
"About": 1,
"me": 1,
"about": 1,
"Contact": 1,
"contacts": 1,
"Field": 9, "Field": 9,
"FormField": 3, "FormField": 3,
"ArrayAccess": 1, "ArrayAccess": 1,
@@ -50953,7 +51388,6 @@
"isUnique": 1, "isUnique": 1,
"is_bool": 1, "is_bool": 1,
"sql": 1, "sql": 1,
"SHEBANG#!php": 3,
"echo": 2, "echo": 2,
"Yii": 3, "Yii": 3,
"console": 3, "console": 3,
@@ -67048,9 +67482,9 @@
"return": 1 "return": 1
}, },
"XML": { "XML": {
"<?xml>": 11, "<?xml>": 12,
"version=": 17, "version=": 21,
"encoding=": 7, "encoding=": 8,
"<Project>": 7, "<Project>": 7,
"ToolsVersion=": 6, "ToolsVersion=": 6,
"DefaultTargets=": 5, "DefaultTargets=": 5,
@@ -67127,6 +67561,94 @@
"<Compile>": 10, "<Compile>": 10,
"<None>": 5, "<None>": 5,
"</Project>": 7, "</Project>": 7,
"standalone=": 1,
"<?fileVersion>": 1,
"4": 1,
"0": 2,
"<cproject>": 1,
"storage_type_id=": 1,
"<storageModule>": 14,
"moduleId=": 14,
"<cconfiguration>": 2,
"id=": 141,
"buildSystemId=": 2,
"name=": 270,
"<externalSettings/>": 2,
"<extensions>": 2,
"<extension>": 12,
"point=": 12,
"</extensions>": 2,
"</storageModule>": 7,
"<configuration>": 2,
"artifactName=": 2,
"buildArtefactType=": 2,
"buildProperties=": 2,
"cleanCommand=": 2,
"description=": 4,
"cdt": 2,
"managedbuild": 2,
"config": 2,
"gnu": 2,
"exe": 2,
"debug": 1,
"1803931088": 1,
"parent=": 2,
"<folderInfo>": 2,
"resourcePath=": 2,
"<toolChain>": 2,
"superClass=": 42,
"<targetPlatform>": 2,
"<builder>": 2,
"buildPath=": 2,
"keepEnvironmentInBuildfile=": 2,
"managedBuildOn=": 2,
"<tool>": 12,
"<option>": 16,
"value=": 11,
"valueType=": 12,
"<listOptionValue>": 4,
"builtIn=": 4,
"</option>": 4,
"<inputType>": 8,
"</tool>": 8,
"defaultValue=": 2,
"<additionalInput>": 4,
"kind=": 6,
"paths=": 4,
"</inputType>": 2,
"</toolChain>": 2,
"</folderInfo>": 2,
"<sourceEntries>": 2,
"<entry>": 2,
"flags=": 2,
"</sourceEntries>": 2,
"</configuration>": 2,
"</cconfiguration>": 2,
"release": 1,
"32754498": 1,
"<project>": 2,
"projectType=": 1,
"<autodiscovery>": 5,
"enabled=": 125,
"problemReportingEnabled=": 5,
"selectedProfileId=": 5,
"<profile>": 40,
"<buildOutputProvider>": 40,
"<openAction>": 40,
"filePath=": 40,
"<parser>": 80,
"</buildOutputProvider>": 40,
"<scannerInfoProvider>": 40,
"<runAction>": 40,
"arguments=": 40,
"command=": 40,
"useDefault=": 40,
"</scannerInfoProvider>": 40,
"</profile>": 40,
"<scannerConfigBuildInfo>": 4,
"instanceId=": 4,
"</scannerConfigBuildInfo>": 4,
"</cproject>": 1,
"<SchemaVersion>": 2, "<SchemaVersion>": 2,
"</SchemaVersion>": 2, "</SchemaVersion>": 2,
"cfa7a11": 1, "cfa7a11": 1,
@@ -67174,8 +67696,6 @@
"FSharp": 1, "FSharp": 1,
"</Otherwise>": 1, "</Otherwise>": 1,
"</Choose>": 1, "</Choose>": 1,
"<project>": 1,
"name=": 227,
"xmlns": 2, "xmlns": 2,
"ea=": 2, "ea=": 2,
"<description>": 4, "<description>": 4,
@@ -67230,14 +67750,12 @@
"application": 2, "application": 2,
"<ea:build>": 1, "<ea:build>": 1,
"<ea:property>": 1, "<ea:property>": 1,
"value=": 1,
"<ea:plugin>": 1, "<ea:plugin>": 1,
"</ea:build>": 1, "</ea:build>": 1,
"</info>": 1, "</info>": 1,
"<configurations>": 1, "<configurations>": 1,
"<conf>": 2, "<conf>": 2,
"visibility=": 2, "visibility=": 2,
"description=": 2,
"</configurations>": 1, "</configurations>": 1,
"<dependencies>": 1, "<dependencies>": 1,
"<dependency>": 4, "<dependency>": 4,
@@ -69660,7 +70178,7 @@
"CSS": 43867, "CSS": 43867,
"Ceylon": 50, "Ceylon": 50,
"Cirru": 244, "Cirru": 244,
"Clojure": 510, "Clojure": 1899,
"CoffeeScript": 2951, "CoffeeScript": 2951,
"Common Lisp": 2186, "Common Lisp": 2186,
"Component Pascal": 825, "Component Pascal": 825,
@@ -69668,6 +70186,7 @@
"Creole": 134, "Creole": 134,
"Crystal": 1506, "Crystal": 1506,
"Cuda": 290, "Cuda": 290,
"Cycript": 251,
"DM": 169, "DM": 169,
"Dart": 74, "Dart": 74,
"Diff": 16, "Diff": 16,
@@ -69692,7 +70211,8 @@
"Groovy": 93, "Groovy": 93,
"Groovy Server Pages": 91, "Groovy Server Pages": 91,
"HTML": 413, "HTML": 413,
"Haml": 4, "HTML+ERB": 213,
"Haml": 121,
"Handlebars": 69, "Handlebars": 69,
"Haskell": 302, "Haskell": 302,
"Hy": 155, "Hy": 155,
@@ -69756,7 +70276,7 @@
"Ox": 1006, "Ox": 1006,
"Oxygene": 157, "Oxygene": 157,
"PAWN": 3263, "PAWN": 3263,
"PHP": 20724, "PHP": 20754,
"Pan": 130, "Pan": 130,
"Parrot Assembly": 6, "Parrot Assembly": 6,
"Parrot Internal Representation": 5, "Parrot Internal Representation": 5,
@@ -69822,7 +70342,7 @@
"Visual Basic": 581, "Visual Basic": 581,
"Volt": 388, "Volt": 388,
"XC": 24, "XC": 24,
"XML": 7057, "XML": 8236,
"XProc": 22, "XProc": 22,
"XQuery": 801, "XQuery": 801,
"XSLT": 44, "XSLT": 44,
@@ -69860,7 +70380,7 @@
"CSS": 2, "CSS": 2,
"Ceylon": 1, "Ceylon": 1,
"Cirru": 9, "Cirru": 9,
"Clojure": 7, "Clojure": 8,
"CoffeeScript": 9, "CoffeeScript": 9,
"Common Lisp": 3, "Common Lisp": 3,
"Component Pascal": 2, "Component Pascal": 2,
@@ -69868,6 +70388,7 @@
"Creole": 1, "Creole": 1,
"Crystal": 3, "Crystal": 3,
"Cuda": 2, "Cuda": 2,
"Cycript": 1,
"DM": 1, "DM": 1,
"Dart": 1, "Dart": 1,
"Diff": 1, "Diff": 1,
@@ -69892,7 +70413,8 @@
"Groovy": 5, "Groovy": 5,
"Groovy Server Pages": 4, "Groovy Server Pages": 4,
"HTML": 2, "HTML": 2,
"Haml": 1, "HTML+ERB": 2,
"Haml": 2,
"Handlebars": 2, "Handlebars": 2,
"Haskell": 3, "Haskell": 3,
"Hy": 2, "Hy": 2,
@@ -69956,7 +70478,7 @@
"Ox": 3, "Ox": 3,
"Oxygene": 1, "Oxygene": 1,
"PAWN": 1, "PAWN": 1,
"PHP": 9, "PHP": 10,
"Pan": 1, "Pan": 1,
"Parrot Assembly": 1, "Parrot Assembly": 1,
"Parrot Internal Representation": 1, "Parrot Internal Representation": 1,
@@ -70022,7 +70544,7 @@
"Visual Basic": 3, "Visual Basic": 3,
"Volt": 1, "Volt": 1,
"XC": 1, "XC": 1,
"XML": 13, "XML": 14,
"XProc": 1, "XProc": 1,
"XQuery": 1, "XQuery": 1,
"XSLT": 1, "XSLT": 1,
@@ -70035,5 +70557,5 @@
"fish": 3, "fish": 3,
"wisp": 1 "wisp": 1
}, },
"md5": "cedc5d3fde7e7b87467bdf820d674b95" "md5": "87af2c0165a9c7fcb5f88e73d26b3c20"
} }

View File

@@ -43,6 +43,10 @@
# Normalize.css # Normalize.css
- normalize.css - normalize.css
# Animate.css
- animate.css
- animate.min.css
# Vendored dependencies # Vendored dependencies
- thirdparty/ - thirdparty/
- vendors?/ - vendors?/
@@ -112,6 +116,10 @@
- (^|/)modernizr\-\d\.\d+(\.\d+)?(\.min)?\.js$ - (^|/)modernizr\-\d\.\d+(\.\d+)?(\.min)?\.js$
- (^|/)modernizr\.custom\.\d+\.js$ - (^|/)modernizr\.custom\.\d+\.js$
# Knockout
- (^|/)knockout-(\d+\.){3}(debug\.)?js$
- knockout-min.js
## Python ## ## Python ##
# django # django

View File

@@ -1,3 +1,3 @@
module Linguist module Linguist
VERSION = "3.0.3" VERSION = "3.1.1"
end end

View File

@@ -0,0 +1,146 @@
;; Copyright (c) Alan Dipert and Micha Niskin. All rights reserved.
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
;; which can be found in the file epl-v10.html at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be bound by
;; the terms of this license.
;; You must not remove this notice, or any other, from this software.
(page "index.html"
(:refer-clojure :exclude [nth])
(:require
[tailrecursion.hoplon.reload :refer [reload-all]]
[tailrecursion.hoplon.util :refer [nth name pluralize]]
[tailrecursion.hoplon.storage-atom :refer [local-storage]]))
;; utility functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(declare route state editing)
(reload-all)
(def mapvi (comp vec map-indexed))
(defn dissocv [v i]
(let [z (- (dec (count v)) i)]
(cond (neg? z) v
(zero? z) (pop v)
(pos? z) (into (subvec v 0 i) (subvec v (inc i))))))
(defn decorate [todo route editing i]
(let [{done? :completed text :text} todo]
(-> todo (assoc :editing (= editing i)
:visible (and (not (empty? text))
(or (= "#/" route)
(and (= "#/active" route) (not done?))
(and (= "#/completed" route) done?)))))))
;; persisted state cell (AKA: stem cell) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(def state (-> (cell []) (local-storage ::store)))
;; local state cells ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defc loaded? false)
(defc editing nil)
(def route (route-cell "#/"))
;; formula cells (computed state) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defc= completed (filter :completed state))
(defc= active (remove :completed state))
(defc= plural-item (pluralize "item" (count active)))
(defc= todos (mapvi #(list %1 (decorate %2 route editing %1)) state))
;; state transition functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defn todo [t] {:completed false :text t})
(defn destroy! [i] (swap! state dissocv i))
(defn done! [i v] (swap! state assoc-in [i :completed] v))
(defn clear-done! [& _] (swap! state #(vec (remove :completed %))))
(defn new! [t] (when (not (empty? t)) (swap! state conj (todo t))))
(defn all-done! [v] (swap! state #(mapv (fn [x] (assoc x :completed v)) %)))
(defn editing! [i v] (reset! editing (if v i nil)))
(defn text! [i v] (if (empty? v) (destroy! i) (swap! state assoc-in [i :text] v)))
;; page ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(html :lang "en"
(head
(meta :charset "utf-8")
(meta :http-equiv "X-UA-Compatible" :content "IE=edge,chrome=1")
(link :rel "stylesheet" :href "base.css")
(title "Hoplon • TodoMVC"))
(body
(noscript
(div :id "noscript"
(p "JavaScript is required to view this page.")))
(div
(section :id "todoapp"
(header :id "header"
(h1 "todos")
(form :on-submit #(do (new! (val-id :new-todo))
(do! (by-id :new-todo) :value ""))
(input
:id "new-todo"
:type "text"
:autofocus true
:placeholder "What needs to be done?"
:on-blur #(do! (by-id :new-todo) :value ""))))
(section
:id "main"
:do-toggle (cell= (not (and (empty? active) (empty? completed))))
(input
:id "toggle-all"
:type "checkbox"
:do-attr (cell= {:checked (empty? active)})
:on-click #(all-done! (val-id :toggle-all)))
(label :for "toggle-all"
"Mark all as complete")
(ul :id "todo-list"
(loop-tpl
:reverse true
:bind-ids [done# edit#]
:bindings [[i {edit? :editing done? :completed todo-text :text show? :visible}] todos]
(li
:do-class (cell= {:completed done? :editing edit?})
:do-toggle show?
(div :class "view" :on-dblclick #(editing! @i true)
(input
:id done#
:type "checkbox"
:class "toggle"
:do-attr (cell= {:checked done?})
:on-click #(done! @i (val-id done#)))
(label (text "~{todo-text}"))
(button
:type "submit"
:class "destroy"
:on-click #(destroy! @i)))
(form :on-submit #(editing! @i false)
(input
:id edit#
:type "text"
:class "edit"
:do-value todo-text
:do-focus edit?
:on-blur #(when @edit? (editing! @i false))
:on-change #(when @edit? (text! @i (val-id edit#)))))))))
(footer
:id "footer"
:do-toggle (cell= (not (and (empty? active) (empty? completed))))
(span :id "todo-count"
(strong (text "~(count active) "))
(span (text "~{plural-item} left")))
(ul :id "filters"
(li (a :href "#/" :do-class (cell= {:selected (= "#/" route)}) "All"))
(li (a :href "#/active" :do-class (cell= {:selected (= "#/active" route)}) "Active"))
(li (a :href "#/completed" :do-class (cell= {:selected (= "#/completed" route)}) "Completed")))
(button
:type "submit"
:id "clear-completed"
:on-click #(clear-done!)
(text "Clear completed (~(count completed))"))))
(footer :id "info"
(p "Double-click to edit a todo")
(p "Part of " (a :href "http://github.com/tailrecursion/hoplon-demos/" "hoplon-demos"))))))

580
samples/Cycript/utils.cy Normal file
View File

@@ -0,0 +1,580 @@
(function(utils) {
// Load C functions declared in utils.loadFuncs
var shouldLoadCFuncs = true;
// Expose the C functions to cycript's global scope
var shouldExposeCFuncs = true;
// Expose C constants to cycript's global scope
var shouldExposeConsts = true;
// Expose functions defined here to cycript's global scope
var shouldExposeFuncs = true;
// Which functions to expose
var funcsToExpose = ["exec", "include", "sizeof", "logify", "apply", "str2voidPtr", "voidPtr2str", "double2voidPtr", "voidPtr2double", "isMemoryReadable", "isObject", "makeStruct"];
// C functions that utils.loadFuncs loads
var CFuncsDeclarations = [
// <stdlib.h>
"void *calloc(size_t num, size_t size)",
// <string.h>
"char *strcpy(char *restrict dst, const char *restrict src)",
"char *strdup(const char *s1)",
"void* memset(void* dest, int ch, size_t count)",
// <stdio.h>
"FILE *fopen(const char *, const char *)",
"int fclose(FILE *)",
"size_t fread(void *restrict, size_t, size_t, FILE *restrict)",
"size_t fwrite(const void *restrict, size_t, size_t, FILE *restrict)",
// <mach.h>
"mach_port_t mach_task_self()",
"kern_return_t task_for_pid(mach_port_name_t target_tport, int pid, mach_port_name_t *tn)",
"kern_return_t mach_vm_protect(vm_map_t target_task, mach_vm_address_t address, mach_vm_size_t size, boolean_t set_maximum, vm_prot_t new_protection)",
"kern_return_t mach_vm_write(vm_map_t target_task, mach_vm_address_t address, vm_offset_t data, mach_msg_type_number_t dataCnt)",
"kern_return_t mach_vm_read(vm_map_t target_task, mach_vm_address_t address, mach_vm_size_t size, vm_offset_t *data, mach_msg_type_number_t *dataCnt)",
];
/*
Replacement for eval that can handle @encode etc.
Usage:
cy# utils.exec("@encode(void *(int, char))")
@encode(void*(int,char))
*/
utils.exec = function(str) {
var mkdir = @encode(int (const char *, int))(dlsym(RTLD_DEFAULT, "mkdir"));
var tempnam = @encode(char *(const char *, const char *))(dlsym(RTLD_DEFAULT, "tempnam"));
var fopen = @encode(void *(const char *, const char *))(dlsym(RTLD_DEFAULT, "fopen"));
var fclose = @encode(int (void *))(dlsym(RTLD_DEFAULT, "fclose"));
var fwrite = @encode(int (const char *, int, int, void *))(dlsym(RTLD_DEFAULT, "fwrite"));
var symlink = @encode(int (const char *, const char *))(dlsym(RTLD_DEFAULT, "symlink"));
var unlink = @encode(int (const char *))(dlsym(RTLD_DEFAULT, "unlink"));
var getenv = @encode(const char *(const char *))(dlsym(RTLD_DEFAULT, "getenv"));
var setenv = @encode(int (const char *, const char *, int))(dlsym(RTLD_DEFAULT, "setenv"));
var libdir = "/usr/lib/cycript0.9";
var dir = libdir + "/tmp";
mkdir(dir, 0777);
// This is needed because tempnam seems to ignore the first argument on i386
var old_tmpdir = getenv("TMPDIR");
setenv("TMPDIR", dir, 1);
// No freeing :(
var f = tempnam(dir, "exec-");
setenv("TMPDIR", old_tmpdir, 1);
if(!f) {
return false;
}
symlink(f, f + ".cy");
str = "exports.result = " + str;
var handle = fopen(f, "w");
fwrite(str, str.length, 1, handle);
fclose(handle);
var r;
var except = null;
try {
r = require(f.replace(libdir + "/", ""));
} catch(e) {
except = e;
}
unlink(f + ".cy");
unlink(f);
if(except !== null) {
throw except;
}
return r.result;
};
/*
Applies known typedefs
Used in utils.include and utils.makeStruct
Usage:
cy# utils.applyTypedefs("mach_vm_address_t")
"uint64_t"
*/
utils.applyTypedefs = function(str) {
var typedefs = {
"struct": "",
"restrict": "",
"FILE": "void",
"size_t": "uint64_t",
"uintptr_t": "unsigned long",
"kern_return_t": "int",
"mach_port_t": "unsigned int",
"mach_port_name_t": "unsigned int",
"vm_offset_t": "unsigned long",
"vm_size_t": "unsigned long",
"mach_vm_address_t": "uint64_t",
"mach_vm_offset_t": "uint64_t",
"mach_vm_size_t": "uint64_t",
"vm_map_offset_t": "uint64_t",
"vm_map_address_t": "uint64_t",
"vm_map_size_t": "uint64_t",
"mach_port_context_t": "uint64_t",
"vm_map_t": "unsigned int",
"boolean_t": "unsigned int",
"vm_prot_t": "int",
"mach_msg_type_number_t": "unsigned int",
"cpu_type_t": "int",
"cpu_subtype_t": "int",
"cpu_threadtype_t": "int",
};
for(var k in typedefs) {
str = str.replace(new RegExp("(\\s|\\*|,|\\(|^)" + k + "(\\s|\\*|,|\\)|$)", "g"), "$1" + typedefs[k] + "$2");
}
return str;
};
/*
Parses a C function declaration and returns the function name and cycript type
If load is true, tries to load it into cycript using utils.exec
Usage:
cy# var str = "void *calloc(size_t num, size_t size)";
"void *calloc(size_t num, size_t size)"
cy# utils.include(str)
["calloc","@encode(void *(uint64_t num, uint64_t size))(140735674376857)"]
cy# var ret = utils.include(str, true)
["calloc",0x7fff93e0e299]
cy# ret[1].type
@encode(void*(unsigned long long int,unsigned long long int))
cy# ret[1](100, 1)
0x100444100
*/
utils.include = function(str, load) {
var re = /^\s*([^(]*(?:\s+|\*))(\w*)\s*\(([^)]*)\)\s*;?\s*$/;
var match = re.exec(str);
if(!match) {
return -1;
}
var rType = utils.applyTypedefs(match[1]);
var name = match[2];
var args = match[3];
var argsRe = /([^,]+)(?:,|$)/g;
var argsTypes = [];
while((match = argsRe.exec(args)) !== null) {
var type = utils.applyTypedefs(match[1]);
argsTypes.push(type);
}
var encodeString = "@encode(";
encodeString += rType + "(";
encodeString += argsTypes.join(", ") + "))";
var fun = dlsym(RTLD_DEFAULT, name);
if(fun !== null) {
encodeString += "(" + fun + ")";
if(load) {
return [name, utils.exec(encodeString)];
}
} else if(load) {
throw "Function couldn't be found with dlsym!";
}
return [name, encodeString];
};
/*
Loads the function declaration in the defs array using utils.exec and exposes to cycript's global scope
Is automatically called if shouldLoadCFuncs is true
*/
utils.funcs = {};
utils.loadfuncs = function(expose) {
for(var i = 0; i < CFuncsDeclarations.length; i++) {
try {
var o = utils.include(CFuncsDeclarations[i], true);
utils.funcs[o[0]] = o[1];
if(expose) {
Cycript.all[o[0]] = o[1];
}
} catch(e) {
system.print("Failed to load function: " + i);
try {
system.print(utils.include(CFuncsDeclarations[i]));
} catch(e2) {
}
}
}
};
/*
Calculates the size of a type like the C operator sizeof
Usage:
cy# utils.sizeof(int)
4
cy# utils.sizeof(@encode(void *))
8
cy# utils.sizeof("mach_vm_address_t")
8
*/
utils.sizeof = function(type) {
if(typeof type === "string") {
type = utils.applyTypedefs(type);
type = utils.exec("@encode(" + type + ")");
}
// (const) char * has "infinite" preceision
if(type.toString().slice(-1) === "*") {
return utils.sizeof(@encode(void *));
}
// float and double
if(type.toString() === @encode(float).toString()) {
return 4;
} else if (type.toString() === @encode(double).toString()) {
return 8;
}
var typeInstance = type(0);
if(typeInstance instanceof Object) {
// Arrays
if("length" in typeInstance) {
return typeInstance.length * utils.sizeof(typeInstance.type);
}
// Structs
if(typeInstance.toString() === "[object Struct]") {
var typeStr = type.toString();
var arrayTypeStr = "[2" + typeStr + "]";
var arrayType = new Type(arrayTypeStr);
var arrayInstance = new arrayType;
return @encode(void *)(&(arrayInstance[1])) - @encode(void *)(&(arrayInstance[0]));
}
}
for(var i = 0; i < 5; i++) {
var maxSigned = Math.pow(2, 8 * Math.pow(2, i) - 1) - 1;
if(i === 3) {
// Floating point fix ;^)
maxSigned /= 1000;
}
// can't use !== or sizeof(void *) === 0.5
if(type(maxSigned) != maxSigned) {
return Math.pow(2, i - 1);
}
}
};
/*
Logs a specific message sent to an instance of a class like logify.pl in theos
Requires Cydia Substrate (com.saurik.substrate.MS) and NSLog (org.cycript.NSLog) modules
Returns the old message returned by MS.hookMessage (Note: this is not just the old message!)
Usage:
cy# var oldm = utils.logify(objc_getMetaClass(NSNumber), @selector(numberWithDouble:))
...
cy# var n = [NSNumber numberWithDouble:1.5]
2014-07-28 02:26:39.805 cycript[71213:507] +[<NSNumber: 0x10032d0c4> numberWithDouble:1.5]
2014-07-28 02:26:39.806 cycript[71213:507] = 1.5
@1.5
*/
utils.logify = function(cls, sel) {
@import com.saurik.substrate.MS;
@import org.cycript.NSLog;
var oldm = {};
MS.hookMessage(cls, sel, function() {
var args = [].slice.call(arguments);
var selFormat = sel.toString().replace(/:/g, ":%@ ").trim();
var logFormat = "%@[<%@: 0x%@> " + selFormat + "]";
var standardArgs = [logFormat, class_isMetaClass(cls)? "+": "-", cls.toString(), (&this).valueOf().toString(16)];
var logArgs = standardArgs.concat(args);
NSLog.apply(null, logArgs);
var r = oldm->apply(this, arguments);
if(r !== undefined) {
NSLog(" = %@", r);
}
return r;
}, oldm);
return oldm;
};
/*
Calls a C function by providing its name and arguments
Doesn't support structs
Return value is always a void pointer
Usage:
cy# utils.apply("printf", ["%s %.3s, %d -> %c, float: %f\n", "foo", "barrrr", 97, 97, 1.5])
foo bar, 97 -> a, float: 1.500000
0x22
*/
utils.apply = function(fun, args) {
if(!(args instanceof Array)) {
throw "Args needs to be an array!";
}
var argc = args.length;
var voidPtr = @encode(void *);
var argTypes = [];
for(var i = 0; i < argc; i++) {
var argType = voidPtr;
var arg = args[i];
if(typeof arg === "string") {
argType = @encode(char *);
}
if(typeof arg === "number" && arg % 1 !== 0) {
argType = @encode(double);
}
argTypes.push(argType);
}
var type = voidPtr.functionWith.apply(voidPtr, argTypes);
if(typeof fun === "string") {
fun = dlsym(RTLD_DEFAULT, fun);
}
if(!fun) {
throw "Function not found!";
}
return type(fun).apply(null, args);
};
/*
Converts a string (char *) to a void pointer (void *)
You can't cast to strings to void pointers and vice versa in cycript. Blame saurik.
Usage:
cy# var voidPtr = utils.str2voidPtr("foobar")
0x100331590
cy# utils.voidPtr2str(voidPtr)
"foobar"
*/
utils.str2voidPtr = function(str) {
var strdup = @encode(void *(char *))(dlsym(RTLD_DEFAULT, "strdup"));
return strdup(str);
};
/*
The inverse function of str2voidPtr
*/
utils.voidPtr2str = function(voidPtr) {
var strdup = @encode(char *(void *))(dlsym(RTLD_DEFAULT, "strdup"));
return strdup(voidPtr);
};
/*
Converts a double into a void pointer
This can be used to view the binary representation of a floating point number
Usage:
cy# var n = utils.double2voidPtr(-1.5)
0xbff8000000000000
cy# utils.voidPtr2double(n)
-1.5
*/
utils.double2voidPtr = function(n) {
var doublePtr = new double;
*doublePtr = n;
var voidPtrPtr = @encode(void **)(doublePtr);
return *voidPtrPtr;
};
/*
The inverse function of double2voidPtr
*/
utils.voidPtr2double = function(voidPtr) {
var voidPtrPtr = new @encode(void **);
*voidPtrPtr = voidPtr;
var doublePtr = @encode(double *)(voidPtrPtr);
return *doublePtr;
};
/*
Determines in a safe way if a memory location is readable
Usage:
cy# utils.isMemoryReadable(0)
false
cy# utils.isMemoryReadable(0x1337)
false
cy# utils.isMemoryReadable(NSObject)
true
cy# var a = malloc(100); utils.isMemoryReadable(a)
true
*/
utils.isMemoryReadable = function(ptr) {
if(typeof ptr === "string") {
return true;
}
var fds = new @encode(int [2]);
utils.apply("pipe", [fds]);
var result = utils.apply("write", [fds[1], ptr, 1]) == 1;
utils.apply("close", [fds[0]]);
utils.apply("close", [fds[1]]);
return result;
};
/*
Determines in a safe way if the memory location contains an Objective-C object
Usage:
cy# utils.isObject(0)
false
cy# utils.isObject(0x1337)
false
cy# utils.isObject(NSObject)
true
cy# utils.isObject(objc_getMetaClass(NSObject))
true
cy# utils.isObject([new NSObject init])
true
cy# var a = malloc(100); utils.isObject(a)
false
cy# *@encode(void **)(a) = NSObject; utils.isObject(a)
true
*/
utils.isObject = function(obj) {
obj = @encode(void *)(obj);
var lastObj = -1;
function objc_isa_ptr(obj) {
// See http://www.sealiesoftware.com/blog/archive/2013/09/24/objc_explain_Non-pointer_isa.html
var objc_debug_isa_class_mask = 0x00000001fffffffa;
obj = (obj & 1)? (obj & objc_debug_isa_class_mask): obj;
if((obj & (utils.sizeof(@encode(void *)) - 1)) != 0) {
return null;
} else {
return obj;
}
}
function ptrValue(obj) {
return obj? obj.valueOf(): null;
}
var foundMetaClass = false;
for(obj = objc_isa_ptr(obj); utils.isMemoryReadable(obj); ) {
obj = *@encode(void **)(obj);
if(ptrValue(obj) == ptrValue(lastObj)) {
foundMetaClass = true;
break;
}
lastObj = obj;
}
if(!foundMetaClass) {
return false;
}
if(lastObj === -1 || lastObj === null) {
return false;
}
var obj_class = objc_isa_ptr(@encode(void **)(obj)[1]);
if(!utils.isMemoryReadable(obj_class)) {
return false;
}
var metaclass = objc_isa_ptr(@encode(void **)(obj_class)[0]);
var superclass = objc_isa_ptr(@encode(void **)(obj_class)[1]);
return ptrValue(obj) == ptrValue(metaclass) && superclass == null;
};
/*
Creates a cycript struct type from a C struct definition
Usage:
cy# var foo = makeStruct("int a; short b; char c; uint64_t d; double e;", "foo");
@encode(foo)
cy# var f = new foo
&{a:0,b:0,c:0,d:0,e:0}
cy# f->a = 100; f
&{a:100,b:0,c:0,d:0,e:0}
cy# *@encode(int *)(f)
100
*/
utils.makeStruct = function(str, name) {
var fieldRe = /(?:\s|\n)*([^;]+\s*(?:\s|\*))([^;]+)\s*;/g;
if(!name) {
name = "struct" + Math.floor(Math.random() * 100000);
}
var typeStr = "{" + name + "=";
while((match = fieldRe.exec(str)) !== null) {
var fieldType = utils.applyTypedefs(match[1]);
var fieldName = match[2];
var encodedType = utils.exec("@encode(" + fieldType + ")").toString();
typeStr += '"' + fieldName + '"' + encodedType;
}
typeStr += "}";
return new Type(typeStr);
};
// Various constants
utils.constants = {
VM_PROT_NONE: 0x0,
VM_PROT_READ: 0x1,
VM_PROT_WRITE: 0x2,
VM_PROT_EXECUTE: 0x4,
VM_PROT_NO_CHANGE: 0x8,
VM_PROT_COPY: 0x10,
VM_PROT_WANTS_COPY: 0x10,
VM_PROT_IS_MASK: 0x40,
};
var c = utils.constants;
c.VM_PROT_DEFAULT = c.VM_PROT_READ | c.VM_PROT_WRITE;
c.VM_PROT_ALL = c.VM_PROT_READ | c.VM_PROT_WRITE | c.VM_PROT_EXECUTE;
if(shouldExposeConsts) {
for(var k in c) {
Cycript.all[k] = c[k];
}
}
if(shouldExposeFuncs) {
for(var i = 0; i < funcsToExpose.length; i++) {
var name = funcsToExpose[i];
Cycript.all[name] = utils[name];
}
}
if(shouldLoadCFuncs) {
utils.loadfuncs(shouldExposeCFuncs);
}
})(exports);

View File

@@ -0,0 +1,31 @@
<!-- insert_before '[data-hook="buttons"]' -->
<% if Spree::Config[:enable_fishbowl] %>
<div class="row">
<div class="twelve columns" id="fishbowl_preferences">
<fieldset class="no-border-bottom">
<legend align="center"><%= t(:fishbowl_settings)%></legend>
<% @fishbowl_options.each do |key| %>
<div class="field">
<%= label_tag(key, t(key.to_s.gsub('fishbowl_', '').to_sym) + ': ') + tag(:br) %>
<%= text_field_tag('preferences[' + key.to_s + ']', Spree::Config[key], { :size => 10, :class => 'fullwidth' }) %>
</div>
<% end %>
<div class="field">
<%= hidden_field_tag 'preferences[fishbowl_always_fetch_current_inventory]', '0' %>
<%= check_box_tag('preferences[fishbowl_always_fetch_current_inventory]', "1", Spree::Config[:fishbowl_always_fetch_current_inventory]) %>
<%= t(:always_fetch_current_inventory) %>
</div>
<% if !@location_groups.empty? %>
<div class="field">
<%= label_tag(:fishbowl_location_group, t(:location_group) + ': ') + tag(:br) %>
<%= select('preferences', 'fishbowl_location_group', @location_groups, { :selected => Spree::Config[:fishbowl_location_group]}, { :class => ['select2', 'fullwidth'] }) %>
</div>
<% end %>
</fieldset>
</div>
</div>
<script type="text/javascript">
$('.select2').select2();
</script>
<% end %>

View File

@@ -0,0 +1,39 @@
<% provide(:title, @header) %>
<% present @users do |user_presenter| %>
<div class="row key-header">
<h1><%= @header %></h1>
</div>
<div class='row'>
<div class='small-12 columns'>
<%= will_paginate %>
</div>
</div>
<div class="row key-table">
<div class="small-12 columns">
<div class="row key-table-row">
<div class="small-2 columns">Name</div>
<div class="small-3 columns">Email</div>
<div class="small-1 columns">Chords</div>
<div class="small-1 columns">Keys</div>
<div class="small-1 columns">Tunings</div>
<div class="small-1 columns">Credits</div>
<div class="small-1 columns">Prem?</div>
<div class="small-2 columns">Since?</div>
</div>
<% if @users == [] %>
<div class="row key-table-row">
<div class="small-4 small-centered columns">No Users</div>
</div>
<% else %>
<%= render @users %>
<% end %>
</div>
</div>
<div class='row'>
<div class='small-12 columns'>
<%= will_paginate %>
</div>
</div>
<% end %>

View File

@@ -0,0 +1,29 @@
/
replace '.actions'
.pull-right
.btn-group
= link_to page.url, target: "_blank", title: t('.view_live_html'), class: "tip btn btn-xs btn-default" do
%i.icon-picture.row-black
= link_to refinery.edit_admin_page_path(page.nested_url,
switch_locale: (page.translations.first.locale unless page.translated_to_default_locale?)),
title: t('edit', :scope => 'refinery.admin.pages'),
class: "tip btn btn-xs btn-default" do
%i.icon-edit.row-blue
- if page.deletable?
= link_to refinery.admin_page_path(page.nested_url),
methode: :delete,
title: t('delete', :scope => 'refinery.admin.pages'),
class: "tip cancel confirm-delete btn btn-xs btn-default",
data: { confirm: t('message', scope: 'refinery.admin.delete', title: page_title_with_translations(page)) } do
%i.icon-trash.row-red
- else
%button.btn.btn-xs.btn-default.disabled
%i.icon-trash
.btn-group
= link_to refinery.new_admin_page_path(:parent_id => page.id), title: t('new', :scope => 'refinery.admin.pages'), class: "tip btn btn-xs btn-default" do
%i.icon-plus.row-green

34
samples/PHP/filenames/.php Executable file
View File

@@ -0,0 +1,34 @@
#!/usr/bin/env php
<?
$aMenuLinks = Array(
Array(
"Blog",
SITE_DIR,
Array(),
Array(),
""
),
Array(
"Photos",
SITE_DIR."photo/",
Array(),
Array(),
""
),
Array(
"About me",
SITE_DIR."about.php",
Array(),
Array(),
""
),
Array(
"Contact",
SITE_DIR."contacts.php",
Array(),
Array(),
""
),
);
?>

542
samples/XML/filenames/.cproject Executable file
View File

@@ -0,0 +1,542 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?>
<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="cdt.managedbuild.config.gnu.exe.debug.1803931088">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.exe.debug.1803931088" moduleId="org.eclipse.cdt.core.settings" name="Debug">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="Graph抽象資料結構" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.exe.debug.1803931088" name="Debug" parent="cdt.managedbuild.config.gnu.exe.debug">
<folderInfo id="cdt.managedbuild.config.gnu.exe.debug.1803931088." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.exe.debug.1808064337" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.exe.debug">
<targetPlatform id="cdt.managedbuild.target.gnu.platform.exe.debug.475427293" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.exe.debug"/>
<builder buildPath="${workspace_loc:/Graph抽象資料結構/Debug}" id="cdt.managedbuild.target.gnu.builder.exe.debug.939020465" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.exe.debug"/>
<tool id="cdt.managedbuild.tool.gnu.archiver.base.1433738663" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug.1829995894" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug">
<option id="gnu.cpp.compiler.exe.debug.option.optimization.level.442000851" name="Optimization Level" superClass="gnu.cpp.compiler.exe.debug.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
<option id="gnu.cpp.compiler.exe.debug.option.debugging.level.508927038" name="Debug Level" superClass="gnu.cpp.compiler.exe.debug.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
<option id="gnu.cpp.compiler.option.include.paths.343012625" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths"/>
<option id="gnu.cpp.compiler.option.preprocessor.def.432825827" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" valueType="definedSymbols">
<listOptionValue builtIn="false" value="DEBUG"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1791758539" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.compiler.exe.debug.1529597285" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.exe.debug">
<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.exe.debug.option.optimization.level.1364110929" name="Optimization Level" superClass="gnu.c.compiler.exe.debug.option.optimization.level" valueType="enumerated"/>
<option id="gnu.c.compiler.exe.debug.option.debugging.level.1080217050" name="Debug Level" superClass="gnu.c.compiler.exe.debug.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
<option id="gnu.c.compiler.option.include.paths.1256182591" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths"/>
<option id="gnu.c.compiler.option.preprocessor.def.symbols.1858410383" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">
<listOptionValue builtIn="false" value="DEBUG"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.24351646" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.linker.exe.debug.1253142147" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.exe.debug"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.exe.debug.2139040707" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.exe.debug">
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1870115166" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
<tool id="cdt.managedbuild.tool.gnu.assembler.exe.debug.2025871733" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.exe.debug">
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1643445921" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
</cconfiguration>
<cconfiguration id="cdt.managedbuild.config.gnu.exe.release.32754498">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.exe.release.32754498" moduleId="org.eclipse.cdt.core.settings" name="Release">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="Graph抽象資料結構" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.exe.release.32754498" name="Release" parent="cdt.managedbuild.config.gnu.exe.release">
<folderInfo id="cdt.managedbuild.config.gnu.exe.release.32754498." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.exe.release.1285242355" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.exe.release">
<targetPlatform id="cdt.managedbuild.target.gnu.platform.exe.release.1495976902" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.exe.release"/>
<builder buildPath="${workspace_loc:/Graph抽象資料結構/Release}" id="cdt.managedbuild.target.gnu.builder.exe.release.1973733698" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.exe.release"/>
<tool id="cdt.managedbuild.tool.gnu.archiver.base.1600860298" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.exe.release.1473926095" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.exe.release">
<option id="gnu.cpp.compiler.exe.release.option.optimization.level.1632726668" name="Optimization Level" superClass="gnu.cpp.compiler.exe.release.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
<option id="gnu.cpp.compiler.exe.release.option.debugging.level.2009085397" name="Debug Level" superClass="gnu.cpp.compiler.exe.release.option.debugging.level" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/>
<option id="gnu.cpp.compiler.option.include.paths.1869632172" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths"/>
<option id="gnu.cpp.compiler.option.preprocessor.def.1246679568" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" valueType="definedSymbols">
<listOptionValue builtIn="false" value="NDEBUG"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1744095710" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.compiler.exe.release.478520411" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.exe.release">
<option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.exe.release.option.optimization.level.1683736183" name="Optimization Level" superClass="gnu.c.compiler.exe.release.option.optimization.level" valueType="enumerated"/>
<option id="gnu.c.compiler.exe.release.option.debugging.level.171063916" name="Debug Level" superClass="gnu.c.compiler.exe.release.option.debugging.level" value="gnu.c.debugging.level.none" valueType="enumerated"/>
<option id="gnu.c.compiler.option.include.paths.1466846915" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths"/>
<option id="gnu.c.compiler.option.preprocessor.def.symbols.659261280" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">
<listOptionValue builtIn="false" value="NDEBUG"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.892999416" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.linker.exe.release.977357087" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.exe.release"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.exe.release.1587341853" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.exe.release">
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1655647987" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
<tool id="cdt.managedbuild.tool.gnu.assembler.exe.release.721843795" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.exe.release">
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.827453761" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="Graph抽象資料結構.cdt.managedbuild.target.gnu.exe.1361850129" name="Executable" projectType="cdt.managedbuild.target.gnu.exe"/>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="makefileGenerator">
<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.debug.1803931088;cdt.managedbuild.config.gnu.exe.debug.1803931088.;cdt.managedbuild.tool.gnu.c.compiler.exe.debug.1529597285;cdt.managedbuild.tool.gnu.c.compiler.input.24351646">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="makefileGenerator">
<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.release.32754498;cdt.managedbuild.config.gnu.exe.release.32754498.;cdt.managedbuild.tool.gnu.cpp.compiler.exe.release.1473926095;cdt.managedbuild.tool.gnu.cpp.compiler.input.1744095710">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="makefileGenerator">
<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.debug.1803931088;cdt.managedbuild.config.gnu.exe.debug.1803931088.;cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug.1829995894;cdt.managedbuild.tool.gnu.cpp.compiler.input.1791758539">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="makefileGenerator">
<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.release.32754498;cdt.managedbuild.config.gnu.exe.release.32754498.;cdt.managedbuild.tool.gnu.c.compiler.exe.release.478520411;cdt.managedbuild.tool.gnu.c.compiler.input.892999416">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="makefileGenerator">
<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="refreshScope"/>
</cproject>

View File

@@ -140,6 +140,13 @@ class TestBlob < Test::Unit::TestCase
assert !blob("Perl/script.pl").binary? assert !blob("Perl/script.pl").binary?
end end
def test_all_binary
Samples.each do |sample|
blob = blob(sample[:path])
assert ! (blob.likely_binary? || blob.binary?), "#{sample[:path]} is a binary file"
end
end
def test_text def test_text
assert blob("Text/README").text? assert blob("Text/README").text?
assert blob("Text/dump.sql").text? assert blob("Text/dump.sql").text?
@@ -185,9 +192,9 @@ class TestBlob < Test::Unit::TestCase
assert !blob("Text/README").generated? assert !blob("Text/README").generated?
# Xcode project files # Xcode project files
assert blob("XML/MainMenu.xib").generated? assert !blob("XML/MainMenu.xib").generated?
assert blob("Binary/MainMenu.nib").generated? assert blob("Binary/MainMenu.nib").generated?
assert blob("XML/project.pbxproj").generated? assert !blob("XML/project.pbxproj").generated?
# Gemfile.locks # Gemfile.locks
assert blob("Gemfile.lock").generated? assert blob("Gemfile.lock").generated?

View File

@@ -167,7 +167,7 @@ class TestLanguage < Test::Unit::TestCase
assert_equal 'pot', Language['Gettext Catalog'].search_term assert_equal 'pot', Language['Gettext Catalog'].search_term
assert_equal 'irc', Language['IRC log'].search_term assert_equal 'irc', Language['IRC log'].search_term
assert_equal 'lhs', Language['Literate Haskell'].search_term assert_equal 'lhs', Language['Literate Haskell'].search_term
assert_equal 'ruby', Language['Mirah'].search_term assert_equal 'mirah', Language['Mirah'].search_term
assert_equal 'raw', Language['Raw token data'].search_term assert_equal 'raw', Language['Raw token data'].search_term
assert_equal 'bash', Language['Shell'].search_term assert_equal 'bash', Language['Shell'].search_term
assert_equal 'vim', Language['VimL'].search_term assert_equal 'vim', Language['VimL'].search_term
@@ -249,8 +249,7 @@ class TestLanguage < Test::Unit::TestCase
assert_equal Language['Nginx'], Language.find_by_filename('nginx.conf').first assert_equal Language['Nginx'], Language.find_by_filename('nginx.conf').first
assert_equal ['C', 'C++', 'Objective-C'], Language.find_by_filename('foo.h').map(&:name).sort assert_equal ['C', 'C++', 'Objective-C'], Language.find_by_filename('foo.h').map(&:name).sort
assert_equal [], Language.find_by_filename('rb') assert_equal [], Language.find_by_filename('rb')
assert_equal [], Language.find_by_filename('.rb') assert_equal [], Language.find_by_filename('.null')
assert_equal [], Language.find_by_filename('.nkt')
assert_equal [Language['Shell']], Language.find_by_filename('.bashrc') assert_equal [Language['Shell']], Language.find_by_filename('.bashrc')
assert_equal [Language['Shell']], Language.find_by_filename('bash_profile') assert_equal [Language['Shell']], Language.find_by_filename('bash_profile')
assert_equal [Language['Shell']], Language.find_by_filename('.zshrc') assert_equal [Language['Shell']], Language.find_by_filename('.zshrc')

View File

@@ -36,6 +36,24 @@ class TestSamples < Test::Unit::TestCase
assert_equal data['tokens_total'], data['tokens'].inject(0) { |n, (_, ts)| n += ts.inject(0) { |m, (_, c)| m += c } } assert_equal data['tokens_total'], data['tokens'].inject(0) { |n, (_, ts)| n += ts.inject(0) { |m, (_, c)| m += c } }
end end
# Check that there aren't samples with extensions that aren't explicitly defined in languages.yml
def test_parity
extensions = Samples::DATA['extnames']
languages_yml = File.expand_path("../../lib/linguist/languages.yml", __FILE__)
languages = YAML.load_file(languages_yml)
languages.each do |name, options|
options['extensions'] ||= []
if extnames = extensions[name]
extnames.each do |extname|
next if extname == '.script!'
assert options['extensions'].include?(extname), "#{name} has a sample with extension (#{extname}) that isn't explicitly defined in languages.yml"
end
end
end
end
# If a language extension isn't globally unique then make sure there are samples # If a language extension isn't globally unique then make sure there are samples
def test_presence def test_presence
Linguist::Language.all.each do |language| Linguist::Language.all.each do |language|