mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 09:40:21 +00:00
Fix conflicts from merging master into 'mod-extension'
This commit is contained in:
46
.gitmodules
vendored
46
.gitmodules
vendored
@@ -118,9 +118,6 @@
|
||||
[submodule "vendor/grammars/cucumber-tmbundle"]
|
||||
path = vendor/grammars/cucumber-tmbundle
|
||||
url = https://github.com/cucumber/cucumber-tmbundle
|
||||
[submodule "vendor/grammars/Handlebars"]
|
||||
path = vendor/grammars/Handlebars
|
||||
url = https://github.com/daaain/Handlebars
|
||||
[submodule "vendor/grammars/powershell"]
|
||||
path = vendor/grammars/powershell
|
||||
url = https://github.com/SublimeText/PowerShell
|
||||
@@ -136,9 +133,6 @@
|
||||
[submodule "vendor/grammars/fancy-tmbundle"]
|
||||
path = vendor/grammars/fancy-tmbundle
|
||||
url = https://github.com/fancy-lang/fancy-tmbundle
|
||||
[submodule "vendor/grammars/fsharpbinding"]
|
||||
path = vendor/grammars/fsharpbinding
|
||||
url = https://github.com/fsharp/fsharpbinding
|
||||
[submodule "vendor/grammars/monkey.tmbundle"]
|
||||
path = vendor/grammars/monkey.tmbundle
|
||||
url = https://github.com/gingerbeardman/monkey.tmbundle
|
||||
@@ -169,9 +163,6 @@
|
||||
[submodule "vendor/grammars/Textmate-Gosu-Bundle"]
|
||||
path = vendor/grammars/Textmate-Gosu-Bundle
|
||||
url = https://github.com/jpcamara/Textmate-Gosu-Bundle
|
||||
[submodule "vendor/grammars/jquery-tmbundle"]
|
||||
path = vendor/grammars/jquery-tmbundle
|
||||
url = https://github.com/kswedberg/jquery-tmbundle
|
||||
[submodule "vendor/grammars/fish-tmbundle"]
|
||||
path = vendor/grammars/fish-tmbundle
|
||||
url = https://github.com/l15n/fish-tmbundle
|
||||
@@ -346,9 +337,6 @@
|
||||
[submodule "vendor/grammars/java.tmbundle"]
|
||||
path = vendor/grammars/java.tmbundle
|
||||
url = https://github.com/textmate/java.tmbundle
|
||||
[submodule "vendor/grammars/javadoc.tmbundle"]
|
||||
path = vendor/grammars/javadoc.tmbundle
|
||||
url = https://github.com/textmate/javadoc.tmbundle
|
||||
[submodule "vendor/grammars/javascript-objective-j.tmbundle"]
|
||||
path = vendor/grammars/javascript-objective-j.tmbundle
|
||||
url = https://github.com/textmate/javascript-objective-j.tmbundle
|
||||
@@ -424,9 +412,6 @@
|
||||
[submodule "vendor/grammars/ruby-haml.tmbundle"]
|
||||
path = vendor/grammars/ruby-haml.tmbundle
|
||||
url = https://github.com/textmate/ruby-haml.tmbundle
|
||||
[submodule "vendor/grammars/ruby-on-rails-tmbundle"]
|
||||
path = vendor/grammars/ruby-on-rails-tmbundle
|
||||
url = https://github.com/textmate/ruby-on-rails-tmbundle
|
||||
[submodule "vendor/grammars/scheme.tmbundle"]
|
||||
path = vendor/grammars/scheme.tmbundle
|
||||
url = https://github.com/textmate/scheme.tmbundle
|
||||
@@ -445,15 +430,6 @@
|
||||
[submodule "vendor/grammars/tcl.tmbundle"]
|
||||
path = vendor/grammars/tcl.tmbundle
|
||||
url = https://github.com/textmate/tcl.tmbundle
|
||||
[submodule "vendor/grammars/text.tmbundle"]
|
||||
path = vendor/grammars/text.tmbundle
|
||||
url = https://github.com/textmate/text.tmbundle
|
||||
[submodule "vendor/grammars/textile.tmbundle"]
|
||||
path = vendor/grammars/textile.tmbundle
|
||||
url = https://github.com/textmate/textile.tmbundle
|
||||
[submodule "vendor/grammars/textmate.tmbundle"]
|
||||
path = vendor/grammars/textmate.tmbundle
|
||||
url = https://github.com/textmate/textmate.tmbundle
|
||||
[submodule "vendor/grammars/thrift.tmbundle"]
|
||||
path = vendor/grammars/thrift.tmbundle
|
||||
url = https://github.com/textmate/thrift.tmbundle
|
||||
@@ -487,10 +463,6 @@
|
||||
[submodule "vendor/grammars/sublime-nix"]
|
||||
path = vendor/grammars/sublime-nix
|
||||
url = https://github.com/wmertens/sublime-nix
|
||||
[submodule "vendor/grammars/ada.tmbundle"]
|
||||
path = vendor/grammars/ada.tmbundle
|
||||
url = https://github.com/aroben/ada.tmbundle
|
||||
branch = better-with-highlighting
|
||||
[submodule "vendor/grammars/oz-tmbundle"]
|
||||
path = vendor/grammars/oz-tmbundle
|
||||
url = https://github.com/eregon/oz-tmbundle
|
||||
@@ -660,6 +632,24 @@
|
||||
[submodule "vendor/grammars/Sublime-Modula-2"]
|
||||
path = vendor/grammars/Sublime-Modula-2
|
||||
url = https://github.com/harogaston/Sublime-Modula-2
|
||||
[submodule "vendor/grammars/ada.tmbundle"]
|
||||
path = vendor/grammars/ada.tmbundle
|
||||
url = https://github.com/textmate/ada.tmbundle
|
||||
[submodule "vendor/grammars/api-blueprint-sublime-plugin"]
|
||||
path = vendor/grammars/api-blueprint-sublime-plugin
|
||||
url = https://github.com/apiaryio/api-blueprint-sublime-plugin
|
||||
[submodule "vendor/grammars/Handlebars"]
|
||||
path = vendor/grammars/Handlebars
|
||||
url = https://github.com/daaain/Handlebars
|
||||
[submodule "vendor/grammars/smali-sublime"]
|
||||
path = vendor/grammars/smali-sublime
|
||||
url = https://github.com/ShaneWilton/sublime-smali
|
||||
[submodule "vendor/grammars/language-jsoniq"]
|
||||
path = vendor/grammars/language-jsoniq
|
||||
url = http://github.com/wcandillon/language-jsoniq
|
||||
[submodule "vendor/grammars/atom-fsharp"]
|
||||
path = vendor/grammars/atom-fsharp
|
||||
url = https://github.com/fsprojects/atom-fsharp
|
||||
[submodule "vendor/grammars/SMT.tmbundle"]
|
||||
path = vendor/grammars/SMT.tmbundle
|
||||
url = https://github.com/SRI-CSL/SMT.tmbundle.git
|
||||
|
||||
@@ -2,9 +2,27 @@
|
||||
|
||||
Hi there! We're thrilled that you'd like to contribute to this project. Your help is essential for keeping it great. The majority of contributions won't need to touch any Ruby code at all.
|
||||
|
||||
|
||||
## Adding an extension to a language
|
||||
|
||||
We try only to add new extensions once they have some usage on GitHub. In most cases we prefer that extensions be in use in hundreds of repositories before supporting them in Linguist.
|
||||
|
||||
To add support for a new extension:
|
||||
|
||||
0. Add your extension to the language entry in [`languages.yml`][languages].
|
||||
0. Add at least one sample for your extension to the [samples directory][samples] in the correct subdirectory.
|
||||
0. Open a pull request, linking to a [GitHub search result](https://github.com/search?utf8=%E2%9C%93&q=extension%3Aboot+NOT+nothack&type=Code&ref=searchresults) showing in-the-wild usage.
|
||||
|
||||
In addition, if this extension is already listed in [`languages.yml`][languages] then sometimes a few more steps will need to be taken:
|
||||
|
||||
0. Make sure that example `.yourextension` files are present in the [samples directory][samples] for each language that uses `.yourextension`.
|
||||
0. Test the performance of the Bayesian classifier with a relatively large number (1000s) of sample `.yourextension` files. (ping @arfon or @bkeepers to help with this) to ensure we're not misclassifying files.
|
||||
0. If the Bayesian classifier does a bad job with the sample `.yourextension` files then a [heuristic](https://github.com/github/linguist/blob/master/lib/linguist/heuristics.rb) may need to be written to help.
|
||||
|
||||
|
||||
## Adding a language
|
||||
|
||||
We try only to add languages once they have some usage on GitHub. In most cases we prefer that languages be in use in hundreds of repositories before supporting them in Linguist.
|
||||
We try only to add languages once they have some usage on GitHub. In most cases we prefer that each new file extension be in use in hundreds of repositories before supporting them in Linguist.
|
||||
|
||||
To add support for a new language:
|
||||
|
||||
@@ -23,12 +41,14 @@ In addition, if your new language defines an extension that's already listed in
|
||||
|
||||
Remember, the goal here is to try and avoid false positives!
|
||||
|
||||
|
||||
## Fixing a misclassified language
|
||||
|
||||
Most languages are detected by their file extension defined in [languages.yml][languages]. For disambiguating between files with common extensions, linguist applies some [heuristics](/lib/linguist/heuristics.rb) and a [statistical classifier](lib/linguist/classifier.rb). This process can help differentiate between, for example, `.h` files which could be either C, C++, or Obj-C.
|
||||
|
||||
Misclassifications can often be solved by either adding a new filename or extension for the language or adding more [samples][samples] to make the classifier smarter.
|
||||
|
||||
|
||||
## Fixing syntax highlighting
|
||||
|
||||
Syntax highlighting in GitHub is performed using TextMate-compatible grammars. These are the same grammars that TextMate, Sublime Text and Atom use. Every language in [languages.yml][languages] is mapped to its corresponding TM `scope`. This scope will be used when picking up a grammar for highlighting.
|
||||
@@ -55,6 +75,7 @@ Sometimes getting the tests running can be too much work, especially if you don'
|
||||
|
||||
Here's our current build status: [](http://travis-ci.org/github/linguist)
|
||||
|
||||
|
||||
## Releasing
|
||||
|
||||
If you are the current maintainer of this gem:
|
||||
|
||||
12
README.md
12
README.md
@@ -26,7 +26,7 @@ Linguist supports a number of different custom overrides strategies for language
|
||||
|
||||
### Using gitattributes
|
||||
|
||||
Add a `.gitattributes` file to your project and use standard git-style path matchers for the files you want to override to set `linguist-documentation`, `linguist-language`, and `linguist-vendored`. `.gitattributes` will be used to determine language statistics, but will not be used to syntax highlight files. To manually set syntax highlighting, use [Vim or Emacs modelines](#using-emacs-and-vim-modelines).
|
||||
Add a `.gitattributes` file to your project and use standard git-style path matchers for the files you want to override to set `linguist-documentation`, `linguist-language`, and `linguist-vendored`. `.gitattributes` will be used to determine language statistics, but will not be used to syntax highlight files. To manually set syntax highlighting, use [Vim or Emacs modelines](#using-emacs-or-vim-modelines).
|
||||
|
||||
```
|
||||
$ cat .gitattributes
|
||||
@@ -53,16 +53,18 @@ project-docs/* linguist-documentation
|
||||
docs/formatter.rb linguist-documentation=false
|
||||
```
|
||||
|
||||
### Using Emacs and Vim modelines
|
||||
### Using Emacs or Vim modelines
|
||||
|
||||
Alternatively, you can use Vim and Emacs style modelines to set the language for a single file. Modelines can be placed anywhere within a file and are respected when determining how to syntax-highlight a file on GitHub.com
|
||||
Alternatively, you can use Vim or Emacs style modelines to set the language for a single file. Modelines can be placed anywhere within a file and are respected when determining how to syntax-highlight a file on GitHub.com
|
||||
|
||||
##### Vim
|
||||
```
|
||||
Vim
|
||||
vim: set filetype=prolog:
|
||||
vim: set ft=cpp:
|
||||
```
|
||||
|
||||
Emacs
|
||||
##### Emacs
|
||||
```
|
||||
-*- mode: php;-*-
|
||||
```
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
|
||||
s.add_dependency 'charlock_holmes', '~> 0.7.3'
|
||||
s.add_dependency 'escape_utils', '~> 1.1.0'
|
||||
s.add_dependency 'mime-types', '>= 1.19'
|
||||
s.add_dependency 'rugged', '~> 0.23.0b1'
|
||||
s.add_dependency 'rugged', '>= 0.23.0b'
|
||||
|
||||
s.add_development_dependency 'minitest', '>= 5.0'
|
||||
s.add_development_dependency 'mocha'
|
||||
|
||||
33
grammars.yml
33
grammars.yml
@@ -85,6 +85,8 @@ vendor/grammars/Racket:
|
||||
- source.racket
|
||||
vendor/grammars/SCSS.tmbundle:
|
||||
- source.scss
|
||||
vendor/grammars/SMT.tmbundle:
|
||||
- source.smt
|
||||
vendor/grammars/Scalate.tmbundle:
|
||||
- source.scaml
|
||||
- text.html.ssp
|
||||
@@ -171,6 +173,8 @@ vendor/grammars/asp.tmbundle:
|
||||
vendor/grammars/assembly.tmbundle:
|
||||
- objdump.x86asm
|
||||
- source.x86asm
|
||||
vendor/grammars/atom-fsharp/:
|
||||
- source.fsharp
|
||||
vendor/grammars/atom-salt:
|
||||
- source.python.salt
|
||||
- source.yaml.salt
|
||||
@@ -217,6 +221,7 @@ vendor/grammars/d.tmbundle:
|
||||
vendor/grammars/dart-sublime-bundle:
|
||||
- source.dart
|
||||
- source.pubspec
|
||||
- text.dart-analysis-output
|
||||
- text.dart-doccomments
|
||||
vendor/grammars/desktop.tmbundle:
|
||||
- source.desktop
|
||||
@@ -249,8 +254,6 @@ vendor/grammars/fish-tmbundle:
|
||||
vendor/grammars/fortran.tmbundle:
|
||||
- source.fortran
|
||||
- source.fortran.modern
|
||||
vendor/grammars/fsharpbinding:
|
||||
- source.fsharp
|
||||
vendor/grammars/gap-tmbundle/:
|
||||
- source.gap
|
||||
vendor/grammars/gettext.tmbundle:
|
||||
@@ -298,14 +301,10 @@ vendor/grammars/java.tmbundle:
|
||||
- source.java-properties
|
||||
- text.html.jsp
|
||||
- text.junit-test-report
|
||||
vendor/grammars/javadoc.tmbundle:
|
||||
- text.html.javadoc
|
||||
vendor/grammars/javascript-objective-j.tmbundle:
|
||||
- source.js.objj
|
||||
vendor/grammars/jflex.tmbundle:
|
||||
- source.jflex
|
||||
vendor/grammars/jquery-tmbundle:
|
||||
- source.js.jquery
|
||||
vendor/grammars/json.tmbundle:
|
||||
- source.json
|
||||
vendor/grammars/kotlin-sublime-package:
|
||||
@@ -326,6 +325,9 @@ vendor/grammars/language-hy:
|
||||
vendor/grammars/language-javascript:
|
||||
- source.js
|
||||
- source.js.regexp
|
||||
vendor/grammars/language-jsoniq/:
|
||||
- source.jq
|
||||
- source.xq
|
||||
vendor/grammars/language-python:
|
||||
- source.python
|
||||
- source.regexp.python
|
||||
@@ -408,7 +410,7 @@ vendor/grammars/perl.tmbundle/:
|
||||
- source.perl
|
||||
- source.perl.6
|
||||
vendor/grammars/php-smarty.tmbundle:
|
||||
- source.smarty
|
||||
- text.html.smarty
|
||||
vendor/grammars/php.tmbundle:
|
||||
- text.html.php
|
||||
vendor/grammars/pike-textmate:
|
||||
@@ -435,20 +437,14 @@ vendor/grammars/restructuredtext.tmbundle:
|
||||
- text.restructuredtext
|
||||
vendor/grammars/ruby-haml.tmbundle:
|
||||
- text.haml
|
||||
vendor/grammars/ruby-on-rails-tmbundle:
|
||||
- source.js.erb.rails
|
||||
- source.ruby.rails
|
||||
- source.ruby.rails.rjs
|
||||
- source.sql.ruby
|
||||
- text.html.erb.rails
|
||||
vendor/grammars/ruby-slim.tmbundle:
|
||||
- text.slim
|
||||
vendor/grammars/ruby.tmbundle:
|
||||
- source.ruby
|
||||
- text.html.erb
|
||||
vendor/grammars/sas.tmbundle:
|
||||
- source.SASLog
|
||||
- source.sas
|
||||
- source.sas_log
|
||||
vendor/grammars/sass-textmate-bundle:
|
||||
- source.sass
|
||||
vendor/grammars/scala.tmbundle:
|
||||
@@ -458,6 +454,8 @@ vendor/grammars/scheme.tmbundle:
|
||||
- source.scheme
|
||||
vendor/grammars/scilab.tmbundle:
|
||||
- source.scilab
|
||||
vendor/grammars/smali-sublime/smali.tmLanguage:
|
||||
- source.smali
|
||||
vendor/grammars/smalltalk-tmbundle:
|
||||
- source.smalltalk
|
||||
vendor/grammars/sql.tmbundle:
|
||||
@@ -528,13 +526,6 @@ vendor/grammars/swift.tmbundle:
|
||||
vendor/grammars/tcl.tmbundle:
|
||||
- source.tcl
|
||||
- text.html.tcl
|
||||
vendor/grammars/text.tmbundle:
|
||||
- text.plain
|
||||
vendor/grammars/textile.tmbundle:
|
||||
- text.html.textile
|
||||
vendor/grammars/textmate.tmbundle:
|
||||
- source.regexp.oniguruma
|
||||
- source.tm-properties
|
||||
vendor/grammars/thrift.tmbundle:
|
||||
- source.thrift
|
||||
vendor/grammars/toml.tmbundle:
|
||||
|
||||
@@ -65,11 +65,13 @@ module Linguist
|
||||
generated_net_docfile? ||
|
||||
generated_postscript? ||
|
||||
compiled_cython_file? ||
|
||||
generated_protocol_buffer_go? ||
|
||||
generated_go? ||
|
||||
generated_protocol_buffer? ||
|
||||
generated_apache_thrift? ||
|
||||
generated_jni_header? ||
|
||||
vcr_cassette? ||
|
||||
generated_module?
|
||||
generated_module? ||
|
||||
generated_unity3d_meta?
|
||||
end
|
||||
|
||||
# Internal: Is the blob an Xcode file?
|
||||
@@ -180,11 +182,11 @@ module Linguist
|
||||
def generated_net_designer_file?
|
||||
name.downcase =~ /\.designer\.cs$/
|
||||
end
|
||||
|
||||
|
||||
# Internal: Is this a codegen file for Specflow feature file?
|
||||
#
|
||||
# Visual Studio's SpecFlow extension generates *.feature.cs files
|
||||
# from *.feature files, they are not meant to be consumed by humans.
|
||||
# from *.feature files, they are not meant to be consumed by humans.
|
||||
# Let's hide them.
|
||||
#
|
||||
# Returns true or false
|
||||
@@ -232,11 +234,11 @@ module Linguist
|
||||
creator.include?("ImageMagick")
|
||||
end
|
||||
|
||||
def generated_protocol_buffer_go?
|
||||
def generated_go?
|
||||
return false unless extname == '.go'
|
||||
return false unless lines.count > 1
|
||||
|
||||
return lines[0].include?("Code generated by protoc-gen-go")
|
||||
return lines[0].include?("Code generated by")
|
||||
end
|
||||
|
||||
# Internal: Is the blob a C++, Java or Python source file generated by the
|
||||
@@ -250,6 +252,16 @@ module Linguist
|
||||
return lines[0].include?("Generated by the protocol buffer compiler. DO NOT EDIT!")
|
||||
end
|
||||
|
||||
# Internal: Is the blob generated by Apache Thrift compiler?
|
||||
#
|
||||
# Returns true or false
|
||||
def generated_apache_thrift?
|
||||
return false unless ['.rb', '.py', '.go', '.js', '.m', '.java', '.h', '.cc', '.cpp'].include?(extname)
|
||||
return false unless lines.count > 1
|
||||
|
||||
return lines[0].include?("Autogenerated by Thrift Compiler") || lines[1].include?("Autogenerated by Thrift Compiler")
|
||||
end
|
||||
|
||||
# Internal: Is the blob a C/C++ header generated by the Java JNI tool javah?
|
||||
#
|
||||
# Returns true of false.
|
||||
@@ -329,6 +341,18 @@ module Linguist
|
||||
return false unless lines.count > 1
|
||||
return lines[0].include?("PCBNEW-LibModule-V") ||
|
||||
lines[0].include?("GFORTRAN module version '")
|
||||
|
||||
# Internal: Is this a metadata file from Unity3D?
|
||||
#
|
||||
# Unity3D Meta files start with:
|
||||
# fileFormatVersion: X
|
||||
# guid: XXXXXXXXXXXXXXX
|
||||
#
|
||||
# Return true or false
|
||||
def generated_unity3d_meta?
|
||||
return false unless extname == '.meta'
|
||||
return false unless lines.count > 1
|
||||
return lines[0].include?("fileFormatVersion: ")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -293,11 +293,39 @@ module Linguist
|
||||
end
|
||||
|
||||
disambiguate "Rust", "RenderScript" do |data|
|
||||
if data.include?("^(use |fn |mod |pub |macro_rules|impl|#!?\[)")
|
||||
if /^(use |fn |mod |pub |macro_rules|impl|#!?\[)/.match(data)
|
||||
Language["Rust"]
|
||||
elsif /#include|#pragma\s+(rs|version)|__attribute__/.match(data)
|
||||
Language["RenderScript"]
|
||||
end
|
||||
end
|
||||
|
||||
disambiguate "Common Lisp", "Lex", "Groff", "PicoLisp" do |data|
|
||||
if /\(def(un|macro)\s/.match(data)
|
||||
Language["Common Lisp"]
|
||||
elsif /^(%[%{}]xs|<.*>)/.match(data)
|
||||
Language["Lex"]
|
||||
elsif /^\.[a-z][a-z](\s|$)/i.match(data)
|
||||
Language["Groff"]
|
||||
elsif /^\((de|class|rel|code|data|must)\s/.match(data)
|
||||
Language["PicoLisp"]
|
||||
end
|
||||
end
|
||||
|
||||
disambiguate "Groff", "Nemerle" do |data|
|
||||
if /^[.']/.match(data)
|
||||
Language["Groff"]
|
||||
elsif /^(module|namespace|using)\s/.match(data)
|
||||
Language["Nemerle"]
|
||||
end
|
||||
end
|
||||
|
||||
disambiguate "GAS", "Groff" do |data|
|
||||
if /^[.'][a-z][a-z](\s|$)/i.match(data)
|
||||
Language["Groff"]
|
||||
elsif /((^|\s)move?[. ])|\.(include|globa?l)\s/.match(data)
|
||||
Language["GAS"]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -161,6 +161,7 @@ ApacheConf:
|
||||
- apache
|
||||
extensions:
|
||||
- .apacheconf
|
||||
- .vhost
|
||||
tm_scope: source.apache-config
|
||||
ace_mode: apache_conf
|
||||
|
||||
@@ -296,9 +297,10 @@ Befunge:
|
||||
|
||||
Bison:
|
||||
type: programming
|
||||
group: Yacc
|
||||
tm_scope: source.bison
|
||||
extensions:
|
||||
- .y
|
||||
- .bison
|
||||
ace_mode: text
|
||||
|
||||
BitBake:
|
||||
@@ -601,6 +603,7 @@ Common Lisp:
|
||||
- .lisp
|
||||
- .asd
|
||||
- .cl
|
||||
- .l
|
||||
- .lsp
|
||||
- .ny
|
||||
- .podsl
|
||||
@@ -1039,6 +1042,7 @@ GAS:
|
||||
group: Assembly
|
||||
extensions:
|
||||
- .s
|
||||
- .ms
|
||||
tm_scope: source.asm.x86
|
||||
ace_mode: assembly_x86
|
||||
|
||||
@@ -1207,12 +1211,26 @@ Groff:
|
||||
extensions:
|
||||
- .man
|
||||
- '.1'
|
||||
- .1in
|
||||
- .1m
|
||||
- .1x
|
||||
- '.2'
|
||||
- '.3'
|
||||
- .3in
|
||||
- .3m
|
||||
- .3qt
|
||||
- .3x
|
||||
- '.4'
|
||||
- '.5'
|
||||
- '.6'
|
||||
- '.7'
|
||||
- '.8'
|
||||
- '.9'
|
||||
- .l
|
||||
- .ms
|
||||
- .n
|
||||
- .rno
|
||||
- .roff
|
||||
tm_scope: text.groff
|
||||
aliases:
|
||||
- nroff
|
||||
@@ -1342,7 +1360,7 @@ Haskell:
|
||||
Haxe:
|
||||
type: programming
|
||||
ace_mode: haxe
|
||||
color: "#f7941e"
|
||||
color: "#df7900"
|
||||
extensions:
|
||||
- .hx
|
||||
- .hxsl
|
||||
@@ -1364,7 +1382,7 @@ HyPhy:
|
||||
extensions:
|
||||
- .bf
|
||||
tm_scope: none
|
||||
|
||||
|
||||
IDL:
|
||||
type: programming
|
||||
color: "#a3522f"
|
||||
@@ -1458,6 +1476,14 @@ Isabelle:
|
||||
tm_scope: source.isabelle.theory
|
||||
ace_mode: text
|
||||
|
||||
Isabelle ROOT:
|
||||
type: programming
|
||||
group: Isabelle
|
||||
filenames:
|
||||
- ROOT
|
||||
tm_scope: source.isabelle.root
|
||||
ace_mode: text
|
||||
|
||||
J:
|
||||
type: programming
|
||||
color: "#9EEDFF"
|
||||
@@ -1469,6 +1495,7 @@ J:
|
||||
JFlex:
|
||||
type: programming
|
||||
color: "#DBCA00"
|
||||
group: Lex
|
||||
extensions:
|
||||
- .flex
|
||||
- .jflex
|
||||
@@ -1504,11 +1531,12 @@ JSONLD:
|
||||
tm_scope: source.js
|
||||
|
||||
JSONiq:
|
||||
color: "#40d47e"
|
||||
type: programming
|
||||
ace_mode: jsoniq
|
||||
extensions:
|
||||
- .jq
|
||||
tm_scope: source.xquery
|
||||
tm_scope: source.jq
|
||||
|
||||
Jade:
|
||||
group: HTML
|
||||
@@ -1619,7 +1647,7 @@ Kit:
|
||||
|
||||
Kotlin:
|
||||
type: programming
|
||||
color: "#EA4DFA"
|
||||
color: "#F18E33"
|
||||
extensions:
|
||||
- .kt
|
||||
- .ktm
|
||||
@@ -1686,7 +1714,7 @@ Latte:
|
||||
group: HTML
|
||||
extensions:
|
||||
- .latte
|
||||
tm_scope: source.smarty
|
||||
tm_scope: text.html.smarty
|
||||
ace_mode: smarty
|
||||
|
||||
Lean:
|
||||
@@ -1704,6 +1732,17 @@ Less:
|
||||
tm_scope: source.css.less
|
||||
ace_mode: less
|
||||
|
||||
Lex:
|
||||
type: programming
|
||||
color: "#DBCA00"
|
||||
aliases:
|
||||
- flex
|
||||
extensions:
|
||||
- .l
|
||||
- .lex
|
||||
tm_scope: none
|
||||
ace_mode: text
|
||||
|
||||
LilyPond:
|
||||
type: programming
|
||||
extensions:
|
||||
@@ -1873,6 +1912,7 @@ Makefile:
|
||||
- .mk
|
||||
filenames:
|
||||
- GNUmakefile
|
||||
- Kbuild
|
||||
- Makefile
|
||||
- makefile
|
||||
interpreters:
|
||||
@@ -2111,6 +2151,9 @@ Nginx:
|
||||
type: markup
|
||||
extensions:
|
||||
- .nginxconf
|
||||
- .vhost
|
||||
filenames:
|
||||
- nginx.conf
|
||||
tm_scope: source.nginx
|
||||
aliases:
|
||||
- nginx configuration file
|
||||
@@ -2435,6 +2478,7 @@ Perl:
|
||||
color: "#0298c3"
|
||||
extensions:
|
||||
- .pl
|
||||
- .al
|
||||
- .cgi
|
||||
- .fcgi
|
||||
- .perl
|
||||
@@ -2469,6 +2513,16 @@ Perl6:
|
||||
tm_scope: source.perl.6
|
||||
ace_mode: perl
|
||||
|
||||
PicoLisp:
|
||||
type: programming
|
||||
extensions:
|
||||
- .l
|
||||
interpreters:
|
||||
- picolisp
|
||||
- pil
|
||||
tm_scope: source.lisp
|
||||
ace_mode: lisp
|
||||
|
||||
PigLatin:
|
||||
type: programming
|
||||
color: "#fcd7de"
|
||||
@@ -2646,6 +2700,7 @@ QML:
|
||||
color: "#44a51c"
|
||||
extensions:
|
||||
- .qml
|
||||
- .qbs
|
||||
tm_scope: source.qml
|
||||
ace_mode: text
|
||||
|
||||
@@ -2736,7 +2791,7 @@ Racket:
|
||||
|
||||
Ragel in Ruby Host:
|
||||
type: programming
|
||||
color: "#e17600"
|
||||
color: "#9d5200"
|
||||
extensions:
|
||||
- .rl
|
||||
aliases:
|
||||
@@ -2843,11 +2898,15 @@ Ruby:
|
||||
- ruby
|
||||
- macruby
|
||||
- rake
|
||||
- jruby
|
||||
- rbx
|
||||
filenames:
|
||||
- .pryrc
|
||||
- Appraisals
|
||||
- Berksfile
|
||||
- Buildfile
|
||||
- Deliverfile
|
||||
- Fastfile
|
||||
- Gemfile
|
||||
- Gemfile.lock
|
||||
- Guardfile
|
||||
@@ -2855,6 +2914,7 @@ Ruby:
|
||||
- Mavenfile
|
||||
- Podfile
|
||||
- Puppetfile
|
||||
- Snapfile
|
||||
- Thorfile
|
||||
- Vagrantfile
|
||||
- buildfile
|
||||
@@ -2882,6 +2942,25 @@ SCSS:
|
||||
extensions:
|
||||
- .scss
|
||||
|
||||
SMT:
|
||||
type: programming
|
||||
extensions:
|
||||
- .smt2
|
||||
- .smt
|
||||
interpreters:
|
||||
- boolector
|
||||
- cvc4
|
||||
- mathsat5
|
||||
- opensmt
|
||||
- smtinterpol
|
||||
- smt-rat
|
||||
- stp
|
||||
- verit
|
||||
- yices2
|
||||
- z3
|
||||
tm_scope: source.smt
|
||||
ace_mode: text
|
||||
|
||||
SPARQL:
|
||||
type: data
|
||||
tm_scope: source.sparql
|
||||
@@ -3074,6 +3153,13 @@ Slim:
|
||||
- .slim
|
||||
ace_mode: text
|
||||
|
||||
Smali:
|
||||
type: programming
|
||||
extensions:
|
||||
- .smali
|
||||
ace_mode: text
|
||||
tm_scope: source.smali
|
||||
|
||||
Smalltalk:
|
||||
type: programming
|
||||
color: "#596706"
|
||||
@@ -3089,6 +3175,7 @@ Smarty:
|
||||
extensions:
|
||||
- .tpl
|
||||
ace_mode: smarty
|
||||
tm_scope: text.html.smarty
|
||||
|
||||
SourcePawn:
|
||||
type: programming
|
||||
@@ -3277,7 +3364,7 @@ Turtle:
|
||||
|
||||
Twig:
|
||||
type: markup
|
||||
group: PHP
|
||||
group: HTML
|
||||
extensions:
|
||||
- .twig
|
||||
tm_scope: text.html.twig
|
||||
@@ -3302,6 +3389,19 @@ Unified Parallel C:
|
||||
- .upc
|
||||
tm_scope: source.c
|
||||
|
||||
Unity3D Asset:
|
||||
type: data
|
||||
ace_mode: yaml
|
||||
color: "#ab69a1"
|
||||
extensions:
|
||||
- .anim
|
||||
- .asset
|
||||
- .mat
|
||||
- .meta
|
||||
- .prefab
|
||||
- .unity
|
||||
tm_scope: source.yaml
|
||||
|
||||
UnrealScript:
|
||||
type: programming
|
||||
color: "#a54c4d"
|
||||
@@ -3439,11 +3539,14 @@ XML:
|
||||
- .fsproj
|
||||
- .fxml
|
||||
- .glade
|
||||
- .gml
|
||||
- .grxml
|
||||
- .iml
|
||||
- .ivy
|
||||
- .jelly
|
||||
- .kml
|
||||
- .launch
|
||||
- .mdpolicy
|
||||
- .mm
|
||||
- .mod
|
||||
- .mxml
|
||||
@@ -3519,6 +3622,7 @@ XQuery:
|
||||
- .xqm
|
||||
- .xqy
|
||||
ace_mode: xquery
|
||||
tm_scope: source.xq
|
||||
|
||||
XS:
|
||||
type: programming
|
||||
@@ -3567,6 +3671,15 @@ YAML:
|
||||
- .yaml
|
||||
ace_mode: yaml
|
||||
|
||||
Yacc:
|
||||
type: programming
|
||||
extensions:
|
||||
- .y
|
||||
- .yacc
|
||||
- .yy
|
||||
tm_scope: source.bison
|
||||
ace_mode: text
|
||||
|
||||
Zephir:
|
||||
type: programming
|
||||
color: "#118f9e"
|
||||
|
||||
@@ -2,7 +2,7 @@ module Linguist
|
||||
module Strategy
|
||||
class Modeline
|
||||
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
|
||||
VimModeline = /vim:\s*set\s*(?:ft|filetype)=(\w+):/i
|
||||
|
||||
# Public: Detects language based on Vim and Emacs modelines
|
||||
#
|
||||
|
||||
@@ -70,6 +70,7 @@
|
||||
- 3rd[-_]?party/
|
||||
- vendors?/
|
||||
- extern(al)?/
|
||||
- (^|/)[Vv]+endor/
|
||||
|
||||
# Debian packaging
|
||||
- ^debian/
|
||||
@@ -163,12 +164,22 @@
|
||||
|
||||
## Obj-C ##
|
||||
|
||||
# Carthage
|
||||
- ^Carthage/
|
||||
|
||||
# Cocoapods
|
||||
- ^Pods/
|
||||
|
||||
# Sparkle
|
||||
- (^|/)Sparkle/
|
||||
|
||||
# Crashlytics
|
||||
- Crashlytics.framework/
|
||||
|
||||
# Fabric
|
||||
- Fabric.framework/
|
||||
|
||||
|
||||
## Groovy ##
|
||||
|
||||
# Gradle
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
module Linguist
|
||||
VERSION = "4.5.4"
|
||||
VERSION = "4.5.7"
|
||||
end
|
||||
|
||||
17
samples/ApacheConf/apache.vhost
Normal file
17
samples/ApacheConf/apache.vhost
Normal file
@@ -0,0 +1,17 @@
|
||||
#######################
|
||||
# HOSTNAME
|
||||
######################
|
||||
|
||||
<VirtualHost 127.0.0.1:PORT>
|
||||
ServerAdmin patrick@heysparkbox.com
|
||||
DocumentRoot "/var/www/HOSTNAME"
|
||||
ServerName HOSTNAME
|
||||
|
||||
<Directory "/var/www/HOSTNAME">
|
||||
Options Indexes MultiViews FollowSymLinks
|
||||
AllowOverride All
|
||||
Order allow,deny
|
||||
Allow from all
|
||||
DirectoryIndex index.php
|
||||
</Directory>
|
||||
</VirtualHost>
|
||||
164
samples/Common Lisp/array.l
Normal file
164
samples/Common Lisp/array.l
Normal file
@@ -0,0 +1,164 @@
|
||||
;;; -*- Mode: Lisp; Package: LISP -*-
|
||||
;;;
|
||||
;;; This file is part of xyzzy.
|
||||
;;;
|
||||
|
||||
(provide "array")
|
||||
|
||||
(in-package "lisp")
|
||||
|
||||
(export '(make-vector make-array vector array-dimensions array-in-bounds-p
|
||||
upgraded-array-element-type adjust-array))
|
||||
|
||||
(defun upgraded-array-element-type (type)
|
||||
(cond ((or (eq type 't)
|
||||
(null type))
|
||||
't)
|
||||
((member type '(character base-character standard-char
|
||||
extended-character) :test #'eq)
|
||||
'character)
|
||||
(t
|
||||
(setq type (car (si:canonicalize-type type)))
|
||||
(cond ((or (eq type 't)
|
||||
(null type))
|
||||
't)
|
||||
((member type '(character base-character standard-char
|
||||
extended-character) :test #'eq)
|
||||
'character)
|
||||
(t 't)))))
|
||||
|
||||
(defun check-array-initialize-option (ies-p ics-p displaced-to)
|
||||
(let ((x 0))
|
||||
(and ies-p (incf x))
|
||||
(and ics-p (incf x))
|
||||
(and displaced-to (incf x))
|
||||
(when (> x 1)
|
||||
(error ":initial-element, :initial-contents, :displaced-to"))))
|
||||
|
||||
(defun make-vector (length &key
|
||||
(element-type t)
|
||||
(initial-element nil ies-p)
|
||||
(initial-contents nil ics-p)
|
||||
fill-pointer
|
||||
adjustable
|
||||
displaced-to
|
||||
(displaced-index-offset 0))
|
||||
(setq element-type (upgraded-array-element-type element-type))
|
||||
(check-array-initialize-option ies-p ics-p displaced-to)
|
||||
(let ((vector (si:*make-vector length element-type initial-element adjustable
|
||||
fill-pointer displaced-to displaced-index-offset)))
|
||||
(when ics-p
|
||||
(si:*copy-into-seq vector initial-contents))
|
||||
vector))
|
||||
|
||||
(defun make-array (dimensions &rest rest
|
||||
&key
|
||||
(element-type t)
|
||||
(initial-element nil ies-p)
|
||||
(initial-contents nil ics-p)
|
||||
fill-pointer
|
||||
adjustable
|
||||
displaced-to
|
||||
(displaced-index-offset 0))
|
||||
(cond ((integerp dimensions)
|
||||
(apply #'make-vector dimensions rest))
|
||||
((= (length dimensions) 1)
|
||||
(apply #'make-vector (car dimensions) rest))
|
||||
(t
|
||||
(setq element-type (upgraded-array-element-type element-type))
|
||||
(check-array-initialize-option ies-p ics-p displaced-to)
|
||||
(when fill-pointer
|
||||
(error ":fill-pointer"))
|
||||
(let ((array (si:*make-array dimensions element-type
|
||||
initial-element adjustable
|
||||
displaced-to displaced-index-offset)))
|
||||
(when ics-p
|
||||
(let ((dims (make-list (array-rank array)
|
||||
:initial-element 0))
|
||||
(stack (list initial-contents))
|
||||
(rank (1- (array-rank array))))
|
||||
(dolist (x dims)
|
||||
(push (elt (car stack) 0) stack))
|
||||
(dotimes (i (array-total-size array))
|
||||
(setf (row-major-aref array i) (car stack))
|
||||
(do ((x dims (cdr x))
|
||||
(j rank (1- j)))
|
||||
((null x))
|
||||
(pop stack)
|
||||
(incf (car x))
|
||||
(when (< (car x) (array-dimension array j))
|
||||
(do ((r (- rank j) (1- r)))
|
||||
((< r 0))
|
||||
(push (elt (car stack) (nth r dims)) stack))
|
||||
(return))
|
||||
(setf (car x) 0)))))
|
||||
array))))
|
||||
|
||||
(defun vector (&rest list)
|
||||
(make-vector (length list) :element-type t :initial-contents list))
|
||||
|
||||
(defun array-dimensions (array)
|
||||
(do ((i (1- (array-rank array)) (1- i))
|
||||
(dims '()))
|
||||
((minusp i) dims)
|
||||
(push (array-dimension array i) dims)))
|
||||
|
||||
(defun array-in-bounds-p (array &rest subscripts)
|
||||
(let ((r (array-rank array)))
|
||||
(when (/= r (length subscripts))
|
||||
(error "subscripts: ~S" subscripts))
|
||||
(do ((i 0 (1+ i))
|
||||
(s subscripts (cdr s)))
|
||||
((= i r) t)
|
||||
(unless (<= 0 (car s) (1- (array-dimension array i)))
|
||||
(return nil)))))
|
||||
|
||||
(defun adjust-array (old-array
|
||||
dimensions
|
||||
&rest rest
|
||||
&key
|
||||
(element-type nil ets-p)
|
||||
initial-element
|
||||
(initial-contents nil ics-p)
|
||||
(fill-pointer nil fps-p)
|
||||
displaced-to
|
||||
displaced-index-offset)
|
||||
(when (/= (length dimensions) (array-rank old-array))
|
||||
(error "?"))
|
||||
(unless ets-p
|
||||
(push (array-element-type old-array) rest)
|
||||
(push :element-type rest))
|
||||
(when (adjustable-array-p old-array)
|
||||
(push t rest)
|
||||
(push :adjustable rest))
|
||||
(cond (fps-p
|
||||
(unless (array-has-fill-pointer-p old-array)
|
||||
(error "?")))
|
||||
(t
|
||||
(when (array-has-fill-pointer-p old-array)
|
||||
(push (fill-pointer old-array) rest)
|
||||
(push :fill-pointer rest))))
|
||||
(when (eq old-array displaced-to)
|
||||
(error "?"))
|
||||
(let ((new-array (apply #'make-array dimensions rest)))
|
||||
(or ics-p displaced-to
|
||||
(copy-array-partially old-array new-array))
|
||||
(cond ((adjustable-array-p old-array)
|
||||
(si:*replace-array old-array new-array)
|
||||
old-array)
|
||||
(t
|
||||
new-array))))
|
||||
|
||||
(defun copy-array-partially (src dst)
|
||||
(let* ((dims (mapcar #'min (array-dimensions src) (array-dimensions dst)))
|
||||
(r (array-rank src))
|
||||
(s (make-list r :initial-element 0)))
|
||||
(setq r (1- r))
|
||||
(dotimes (x (apply #'* dims))
|
||||
(setf (apply #'aref dst s) (apply #'aref src s))
|
||||
(do ((i r (1- i)))
|
||||
((minusp i))
|
||||
(incf (nth i s))
|
||||
(when (< (nth i s) (nth i dims))
|
||||
(return))
|
||||
(setf (nth i s) 0)))))
|
||||
1201
samples/Common Lisp/common.l
Normal file
1201
samples/Common Lisp/common.l
Normal file
File diff suppressed because it is too large
Load Diff
91
samples/GAS/hello.ms
Normal file
91
samples/GAS/hello.ms
Normal file
@@ -0,0 +1,91 @@
|
||||
# output(): Hello, world.\n
|
||||
# mach(): all
|
||||
|
||||
# Emit hello world while switching back and forth between arm/thumb.
|
||||
# ??? Unfinished
|
||||
|
||||
.macro invalid
|
||||
# This is "undefined" but it's not properly decoded yet.
|
||||
.word 0x07ffffff
|
||||
# This is stc which isn't recognized yet.
|
||||
stc 0,cr0,[r0]
|
||||
.endm
|
||||
|
||||
.global _start
|
||||
_start:
|
||||
# Run some simple insns to confirm the engine is at least working.
|
||||
nop
|
||||
|
||||
# Skip over output text.
|
||||
|
||||
bl skip_output
|
||||
|
||||
hello_text:
|
||||
.asciz "Hello, world.\n"
|
||||
|
||||
.p2align 2
|
||||
skip_output:
|
||||
|
||||
# Prime loop.
|
||||
|
||||
mov r4, r14
|
||||
|
||||
output_next:
|
||||
|
||||
# Switch arm->thumb to output next chacter.
|
||||
# At this point r4 must point to the next character to output.
|
||||
|
||||
adr r0, into_thumb + 1
|
||||
bx r0
|
||||
|
||||
into_thumb:
|
||||
.thumb
|
||||
|
||||
# Output a character.
|
||||
|
||||
mov r0,#3 @ writec angel call
|
||||
mov r1,r4
|
||||
swi 0xab @ ??? Confirm number.
|
||||
|
||||
# Switch thumb->arm.
|
||||
|
||||
adr r5, back_to_arm
|
||||
bx r5
|
||||
|
||||
.p2align 2
|
||||
back_to_arm:
|
||||
.arm
|
||||
|
||||
# Load next character, see if done.
|
||||
|
||||
add r4,r4,#1
|
||||
sub r3,r3,r3
|
||||
ldrb r5,[r4,r3]
|
||||
teq r5,#0
|
||||
beq done
|
||||
|
||||
# Output a character (in arm mode).
|
||||
|
||||
mov r0,#3
|
||||
mov r1,r4
|
||||
swi #0x123456
|
||||
|
||||
# Load next character, see if done.
|
||||
|
||||
add r4,r4,#1
|
||||
sub r3,r3,r3
|
||||
ldrb r5,[r4,r3]
|
||||
teq r5,#0
|
||||
bne output_next
|
||||
|
||||
done:
|
||||
mov r0,#0x18
|
||||
ldr r1,exit_code
|
||||
swi #0x123456
|
||||
|
||||
# If that fails, try to die with an invalid insn.
|
||||
|
||||
invalid
|
||||
|
||||
exit_code:
|
||||
.word 0x20026
|
||||
852
samples/Go/embedded.go
Normal file
852
samples/Go/embedded.go
Normal file
File diff suppressed because one or more lines are too long
18
samples/Go/gen-go-linguist-thrift.go
Normal file
18
samples/Go/gen-go-linguist-thrift.go
Normal file
@@ -0,0 +1,18 @@
|
||||
// Autogenerated by Thrift Compiler (1.0.0-dev)
|
||||
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
|
||||
package linguist
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"git.apache.org/thrift.git/lib/go/thrift"
|
||||
)
|
||||
|
||||
// (needed to ensure safety because of naive import list construction.)
|
||||
var _ = thrift.ZERO
|
||||
var _ = fmt.Printf
|
||||
var _ = bytes.Equal
|
||||
|
||||
func init() {
|
||||
}
|
||||
275
samples/Groff/Tcl.n
Normal file
275
samples/Groff/Tcl.n
Normal file
@@ -0,0 +1,275 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1993 The Regents of the University of California.
|
||||
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tcl n "8.6" Tcl "Tcl Built-In Commands"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl \- Tool Command Language
|
||||
.SH SYNOPSIS
|
||||
Summary of Tcl language syntax.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
The following rules define the syntax and semantics of the Tcl language:
|
||||
.IP "[1] \fBCommands.\fR"
|
||||
A Tcl script is a string containing one or more commands.
|
||||
Semi-colons and newlines are command separators unless quoted as
|
||||
described below.
|
||||
Close brackets are command terminators during command substitution
|
||||
(see below) unless quoted.
|
||||
.IP "[2] \fBEvaluation.\fR"
|
||||
A command is evaluated in two steps.
|
||||
First, the Tcl interpreter breaks the command into \fIwords\fR
|
||||
and performs substitutions as described below.
|
||||
These substitutions are performed in the same way for all
|
||||
commands.
|
||||
Secondly, the first word is used to locate a command procedure to
|
||||
carry out the command, then all of the words of the command are
|
||||
passed to the command procedure.
|
||||
The command procedure is free to interpret each of its words
|
||||
in any way it likes, such as an integer, variable name, list,
|
||||
or Tcl script.
|
||||
Different commands interpret their words differently.
|
||||
.IP "[3] \fBWords.\fR"
|
||||
Words of a command are separated by white space (except for
|
||||
newlines, which are command separators).
|
||||
.IP "[4] \fBDouble quotes.\fR"
|
||||
If the first character of a word is double-quote
|
||||
.PQ \N'34'
|
||||
then the word is terminated by the next double-quote character.
|
||||
If semi-colons, close brackets, or white space characters
|
||||
(including newlines) appear between the quotes then they are treated
|
||||
as ordinary characters and included in the word.
|
||||
Command substitution, variable substitution, and backslash substitution
|
||||
are performed on the characters between the quotes as described below.
|
||||
The double-quotes are not retained as part of the word.
|
||||
.IP "[5] \fBArgument expansion.\fR"
|
||||
If a word starts with the string
|
||||
.QW {*}
|
||||
followed by a non-whitespace character, then the leading
|
||||
.QW {*}
|
||||
is removed and the rest of the word is parsed and substituted as any other
|
||||
word. After substitution, the word is parsed as a list (without command or
|
||||
variable substitutions; backslash substitutions are performed as is normal for
|
||||
a list and individual internal words may be surrounded by either braces or
|
||||
double-quote characters), and its words are added to the command being
|
||||
substituted. For instance,
|
||||
.QW "cmd a {*}{b [c]} d {*}{$e f {g h}}"
|
||||
is equivalent to
|
||||
.QW "cmd a b {[c]} d {$e} f {g h}" .
|
||||
.IP "[6] \fBBraces.\fR"
|
||||
If the first character of a word is an open brace
|
||||
.PQ {
|
||||
and rule [5] does not apply, then
|
||||
the word is terminated by the matching close brace
|
||||
.PQ } "" .
|
||||
Braces nest within the word: for each additional open
|
||||
brace there must be an additional close brace (however,
|
||||
if an open brace or close brace within the word is
|
||||
quoted with a backslash then it is not counted in locating the
|
||||
matching close brace).
|
||||
No substitutions are performed on the characters between the
|
||||
braces except for backslash-newline substitutions described
|
||||
below, nor do semi-colons, newlines, close brackets,
|
||||
or white space receive any special interpretation.
|
||||
The word will consist of exactly the characters between the
|
||||
outer braces, not including the braces themselves.
|
||||
.IP "[7] \fBCommand substitution.\fR"
|
||||
If a word contains an open bracket
|
||||
.PQ [
|
||||
then Tcl performs \fIcommand substitution\fR.
|
||||
To do this it invokes the Tcl interpreter recursively to process
|
||||
the characters following the open bracket as a Tcl script.
|
||||
The script may contain any number of commands and must be terminated
|
||||
by a close bracket
|
||||
.PQ ] "" .
|
||||
The result of the script (i.e. the result of its last command) is
|
||||
substituted into the word in place of the brackets and all of the
|
||||
characters between them.
|
||||
There may be any number of command substitutions in a single word.
|
||||
Command substitution is not performed on words enclosed in braces.
|
||||
.IP "[8] \fBVariable substitution.\fR"
|
||||
If a word contains a dollar-sign
|
||||
.PQ $
|
||||
followed by one of the forms
|
||||
described below, then Tcl performs \fIvariable
|
||||
substitution\fR: the dollar-sign and the following characters are
|
||||
replaced in the word by the value of a variable.
|
||||
Variable substitution may take any of the following forms:
|
||||
.RS
|
||||
.TP 15
|
||||
\fB$\fIname\fR
|
||||
.
|
||||
\fIName\fR is the name of a scalar variable; the name is a sequence
|
||||
of one or more characters that are a letter, digit, underscore,
|
||||
or namespace separators (two or more colons).
|
||||
Letters and digits are \fIonly\fR the standard ASCII ones (\fB0\fR\(en\fB9\fR,
|
||||
\fBA\fR\(en\fBZ\fR and \fBa\fR\(en\fBz\fR).
|
||||
.TP 15
|
||||
\fB$\fIname\fB(\fIindex\fB)\fR
|
||||
.
|
||||
\fIName\fR gives the name of an array variable and \fIindex\fR gives
|
||||
the name of an element within that array.
|
||||
\fIName\fR must contain only letters, digits, underscores, and
|
||||
namespace separators, and may be an empty string.
|
||||
Letters and digits are \fIonly\fR the standard ASCII ones (\fB0\fR\(en\fB9\fR,
|
||||
\fBA\fR\(en\fBZ\fR and \fBa\fR\(en\fBz\fR).
|
||||
Command substitutions, variable substitutions, and backslash
|
||||
substitutions are performed on the characters of \fIindex\fR.
|
||||
.TP 15
|
||||
\fB${\fIname\fB}\fR
|
||||
.
|
||||
\fIName\fR is the name of a scalar variable or array element. It may contain
|
||||
any characters whatsoever except for close braces. It indicates an array
|
||||
element if \fIname\fR is in the form
|
||||
.QW \fIarrayName\fB(\fIindex\fB)\fR
|
||||
where \fIarrayName\fR does not contain any open parenthesis characters,
|
||||
.QW \fB(\fR ,
|
||||
or close brace characters,
|
||||
.QW \fB}\fR ,
|
||||
and \fIindex\fR can be any sequence of characters except for close brace
|
||||
characters. No further
|
||||
substitutions are performed during the parsing of \fIname\fR.
|
||||
.PP
|
||||
There may be any number of variable substitutions in a single word.
|
||||
Variable substitution is not performed on words enclosed in braces.
|
||||
.PP
|
||||
Note that variables may contain character sequences other than those listed
|
||||
above, but in that case other mechanisms must be used to access them (e.g.,
|
||||
via the \fBset\fR command's single-argument form).
|
||||
.RE
|
||||
.IP "[9] \fBBackslash substitution.\fR"
|
||||
If a backslash
|
||||
.PQ \e
|
||||
appears within a word then \fIbackslash substitution\fR occurs.
|
||||
In all cases but those described below the backslash is dropped and
|
||||
the following character is treated as an ordinary
|
||||
character and included in the word.
|
||||
This allows characters such as double quotes, close brackets,
|
||||
and dollar signs to be included in words without triggering
|
||||
special processing.
|
||||
The following table lists the backslash sequences that are
|
||||
handled specially, along with the value that replaces each sequence.
|
||||
.RS
|
||||
.TP 7
|
||||
\e\fBa\fR
|
||||
Audible alert (bell) (Unicode U+000007).
|
||||
.TP 7
|
||||
\e\fBb\fR
|
||||
Backspace (Unicode U+000008).
|
||||
.TP 7
|
||||
\e\fBf\fR
|
||||
Form feed (Unicode U+00000C).
|
||||
.TP 7
|
||||
\e\fBn\fR
|
||||
Newline (Unicode U+00000A).
|
||||
.TP 7
|
||||
\e\fBr\fR
|
||||
Carriage-return (Unicode U+00000D).
|
||||
.TP 7
|
||||
\e\fBt\fR
|
||||
Tab (Unicode U+000009).
|
||||
.TP 7
|
||||
\e\fBv\fR
|
||||
Vertical tab (Unicode U+00000B).
|
||||
.TP 7
|
||||
\e\fB<newline>\fIwhiteSpace\fR
|
||||
.
|
||||
A single space character replaces the backslash, newline, and all spaces
|
||||
and tabs after the newline. This backslash sequence is unique in that it
|
||||
is replaced in a separate pre-pass before the command is actually parsed.
|
||||
This means that it will be replaced even when it occurs between braces,
|
||||
and the resulting space will be treated as a word separator if it is not
|
||||
in braces or quotes.
|
||||
.TP 7
|
||||
\e\e
|
||||
Backslash
|
||||
.PQ \e "" .
|
||||
.TP 7
|
||||
\e\fIooo\fR
|
||||
.
|
||||
The digits \fIooo\fR (one, two, or three of them) give a eight-bit octal
|
||||
value for the Unicode character that will be inserted, in the range
|
||||
\fI000\fR\(en\fI377\fR (i.e., the range U+000000\(enU+0000FF).
|
||||
The parser will stop just before this range overflows, or when
|
||||
the maximum of three digits is reached. The upper bits of the Unicode
|
||||
character will be 0.
|
||||
.TP 7
|
||||
\e\fBx\fIhh\fR
|
||||
.
|
||||
The hexadecimal digits \fIhh\fR (one or two of them) give an eight-bit
|
||||
hexadecimal value for the Unicode character that will be inserted. The upper
|
||||
bits of the Unicode character will be 0 (i.e., the character will be in the
|
||||
range U+000000\(enU+0000FF).
|
||||
.TP 7
|
||||
\e\fBu\fIhhhh\fR
|
||||
.
|
||||
The hexadecimal digits \fIhhhh\fR (one, two, three, or four of them) give a
|
||||
sixteen-bit hexadecimal value for the Unicode character that will be
|
||||
inserted. The upper bits of the Unicode character will be 0 (i.e., the
|
||||
character will be in the range U+000000\(enU+00FFFF).
|
||||
.TP 7
|
||||
\e\fBU\fIhhhhhhhh\fR
|
||||
.
|
||||
The hexadecimal digits \fIhhhhhhhh\fR (one up to eight of them) give a
|
||||
twenty-one-bit hexadecimal value for the Unicode character that will be
|
||||
inserted, in the range U+000000\(enU+10FFFF. The parser will stop just
|
||||
before this range overflows, or when the maximum of eight digits
|
||||
is reached. The upper bits of the Unicode character will be 0.
|
||||
.RS
|
||||
.PP
|
||||
The range U+010000\(enU+10FFFD is reserved for the future.
|
||||
.RE
|
||||
.PP
|
||||
Backslash substitution is not performed on words enclosed in braces,
|
||||
except for backslash-newline as described above.
|
||||
.RE
|
||||
.IP "[10] \fBComments.\fR"
|
||||
If a hash character
|
||||
.PQ #
|
||||
appears at a point where Tcl is
|
||||
expecting the first character of the first word of a command,
|
||||
then the hash character and the characters that follow it, up
|
||||
through the next newline, are treated as a comment and ignored.
|
||||
The comment character only has significance when it appears
|
||||
at the beginning of a command.
|
||||
.IP "[11] \fBOrder of substitution.\fR"
|
||||
Each character is processed exactly once by the Tcl interpreter
|
||||
as part of creating the words of a command.
|
||||
For example, if variable substitution occurs then no further
|
||||
substitutions are performed on the value of the variable; the
|
||||
value is inserted into the word verbatim.
|
||||
If command substitution occurs then the nested command is
|
||||
processed entirely by the recursive call to the Tcl interpreter;
|
||||
no substitutions are performed before making the recursive
|
||||
call and no additional substitutions are performed on the result
|
||||
of the nested script.
|
||||
.RS
|
||||
.PP
|
||||
Substitutions take place from left to right, and each substitution is
|
||||
evaluated completely before attempting to evaluate the next. Thus, a
|
||||
sequence like
|
||||
.PP
|
||||
.CS
|
||||
set y [set x 0][incr x][incr x]
|
||||
.CE
|
||||
.PP
|
||||
will always set the variable \fIy\fR to the value, \fI012\fR.
|
||||
.RE
|
||||
.IP "[12] \fBSubstitution and word boundaries.\fR"
|
||||
Substitutions do not affect the word boundaries of a command,
|
||||
except for argument expansion as specified in rule [5].
|
||||
For example, during variable substitution the entire value of
|
||||
the variable becomes part of a single word, even if the variable's
|
||||
value contains spaces.
|
||||
.SH KEYWORDS
|
||||
backslash, command, comment, script, substitution, variable
|
||||
'\" Local Variables:
|
||||
'\" mode: nroff
|
||||
'\" fill-column: 78
|
||||
'\" End:
|
||||
135
samples/Groff/create_view.l
Normal file
135
samples/Groff/create_view.l
Normal file
@@ -0,0 +1,135 @@
|
||||
.\\" auto-generated by docbook2man-spec $Revision: 1.1.1.1 $
|
||||
.TH "CREATE VIEW" "" "2005-11-05" "SQL - Language Statements" "SQL Commands"
|
||||
.SH NAME
|
||||
CREATE VIEW \- define a new view
|
||||
|
||||
.SH SYNOPSIS
|
||||
.sp
|
||||
.nf
|
||||
CREATE [ OR REPLACE ] [ TEMP | TEMPORARY ] VIEW \fIname\fR [ ( \fIcolumn_name\fR [, ...] ) ]
|
||||
AS \fIquery\fR
|
||||
.sp
|
||||
.fi
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
\fBCREATE VIEW\fR defines a view of a query. The view
|
||||
is not physically materialized. Instead, the query is run every time
|
||||
the view is referenced in a query.
|
||||
.PP
|
||||
\fBCREATE OR REPLACE VIEW\fR is similar, but if a view
|
||||
of the same name already exists, it is replaced. You can only replace
|
||||
a view with a new query that generates the identical set of columns
|
||||
(i.e., same column names and data types).
|
||||
.PP
|
||||
If a schema name is given (for example, CREATE VIEW
|
||||
myschema.myview ...) then the view is created in the specified
|
||||
schema. Otherwise it is created in the current schema. Temporary
|
||||
views exist in a special schema, so a schema name may not be given
|
||||
when creating a temporary view. The name of the view must be
|
||||
distinct from the name of any other view, table, sequence, or index
|
||||
in the same schema.
|
||||
.SH "PARAMETERS"
|
||||
.TP
|
||||
\fBTEMPORARY or TEMP\fR
|
||||
If specified, the view is created as a temporary view.
|
||||
Temporary views are automatically dropped at the end of the
|
||||
current session. Existing
|
||||
permanent relations with the same name are not visible to the
|
||||
current session while the temporary view exists, unless they are
|
||||
referenced with schema-qualified names.
|
||||
|
||||
If any of the tables referenced by the view are temporary,
|
||||
the view is created as a temporary view (whether
|
||||
TEMPORARY is specified or not).
|
||||
.TP
|
||||
\fB\fIname\fB\fR
|
||||
The name (optionally schema-qualified) of a view to be created.
|
||||
.TP
|
||||
\fB\fIcolumn_name\fB\fR
|
||||
An optional list of names to be used for columns of the view.
|
||||
If not given, the column names are deduced from the query.
|
||||
.TP
|
||||
\fB\fIquery\fB\fR
|
||||
A query (that is, a \fBSELECT\fR statement) which will
|
||||
provide the columns and rows of the view.
|
||||
|
||||
Refer to SELECT [\fBselect\fR(l)]
|
||||
for more information about valid queries.
|
||||
.SH "NOTES"
|
||||
.PP
|
||||
Currently, views are read only: the system will not allow an insert,
|
||||
update, or delete on a view. You can get the effect of an updatable
|
||||
view by creating rules that rewrite inserts, etc. on the view into
|
||||
appropriate actions on other tables. For more information see
|
||||
CREATE RULE [\fBcreate_rule\fR(l)].
|
||||
.PP
|
||||
Use the DROP VIEW [\fBdrop_view\fR(l)]
|
||||
statement to drop views.
|
||||
.PP
|
||||
Be careful that the names and types of the view's columns will be
|
||||
assigned the way you want. For example,
|
||||
.sp
|
||||
.nf
|
||||
CREATE VIEW vista AS SELECT 'Hello World';
|
||||
.sp
|
||||
.fi
|
||||
is bad form in two ways: the column name defaults to ?column?,
|
||||
and the column data type defaults to \fBunknown\fR. If you want a
|
||||
string literal in a view's result, use something like
|
||||
.sp
|
||||
.nf
|
||||
CREATE VIEW vista AS SELECT text 'Hello World' AS hello;
|
||||
.sp
|
||||
.fi
|
||||
.PP
|
||||
Access to tables referenced in the view is determined by permissions of
|
||||
the view owner. However, functions called in the view are treated the
|
||||
same as if they had been called directly from the query using the view.
|
||||
Therefore the user of a view must have permissions to call all functions
|
||||
used by the view.
|
||||
.SH "EXAMPLES"
|
||||
.PP
|
||||
Create a view consisting of all comedy films:
|
||||
.sp
|
||||
.nf
|
||||
CREATE VIEW comedies AS
|
||||
SELECT *
|
||||
FROM films
|
||||
WHERE kind = 'Comedy';
|
||||
.sp
|
||||
.fi
|
||||
.SH "COMPATIBILITY"
|
||||
.PP
|
||||
The SQL standard specifies some additional capabilities for the
|
||||
\fBCREATE VIEW\fR statement:
|
||||
.sp
|
||||
.nf
|
||||
CREATE VIEW \fIname\fR [ ( \fIcolumn_name\fR [, ...] ) ]
|
||||
AS \fIquery\fR
|
||||
[ WITH [ CASCADED | LOCAL ] CHECK OPTION ]
|
||||
.sp
|
||||
.fi
|
||||
.PP
|
||||
The optional clauses for the full SQL command are:
|
||||
.TP
|
||||
\fBCHECK OPTION\fR
|
||||
This option has to do with updatable views. All
|
||||
\fBINSERT\fR and \fBUPDATE\fR commands on the view
|
||||
will be checked to ensure data satisfy the view-defining
|
||||
condition (that is, the new data would be visible through the
|
||||
view). If they do not, the update will be rejected.
|
||||
.TP
|
||||
\fBLOCAL\fR
|
||||
Check for integrity on this view.
|
||||
.TP
|
||||
\fBCASCADED\fR
|
||||
Check for integrity on this view and on any dependent
|
||||
view. CASCADED is assumed if neither
|
||||
CASCADED nor LOCAL is specified.
|
||||
.PP
|
||||
.PP
|
||||
\fBCREATE OR REPLACE VIEW\fR is a
|
||||
PostgreSQL language extension.
|
||||
So is the concept of a temporary view.
|
||||
.SH "SEE ALSO"
|
||||
DROP VIEW [\fBdrop_view\fR(l)]
|
||||
1174
samples/Groff/fsinterface.ms
Normal file
1174
samples/Groff/fsinterface.ms
Normal file
File diff suppressed because it is too large
Load Diff
1104
samples/Isabelle ROOT/filenames/ROOT
Normal file
1104
samples/Isabelle ROOT/filenames/ROOT
Normal file
File diff suppressed because it is too large
Load Diff
396
samples/Java/gen-java-linguist-thrift.java
Normal file
396
samples/Java/gen-java-linguist-thrift.java
Normal file
@@ -0,0 +1,396 @@
|
||||
/**
|
||||
* Autogenerated by Thrift Compiler (1.0.0-dev)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
import org.apache.thrift.scheme.IScheme;
|
||||
import org.apache.thrift.scheme.SchemeFactory;
|
||||
import org.apache.thrift.scheme.StandardScheme;
|
||||
|
||||
import org.apache.thrift.scheme.TupleScheme;
|
||||
import org.apache.thrift.protocol.TTupleProtocol;
|
||||
import org.apache.thrift.protocol.TProtocolException;
|
||||
import org.apache.thrift.EncodingUtils;
|
||||
import org.apache.thrift.TException;
|
||||
import org.apache.thrift.async.AsyncMethodCallback;
|
||||
import org.apache.thrift.server.AbstractNonblockingServer.*;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import java.util.EnumMap;
|
||||
import java.util.Set;
|
||||
import java.util.HashSet;
|
||||
import java.util.EnumSet;
|
||||
import java.util.Collections;
|
||||
import java.util.BitSet;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.Arrays;
|
||||
import javax.annotation.Generated;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
|
||||
@Generated(value = "Autogenerated by Thrift Compiler (1.0.0-dev)", date = "2015-5-12")
|
||||
public class PullRequest implements org.apache.thrift.TBase<PullRequest, PullRequest._Fields>, java.io.Serializable, Cloneable, Comparable<PullRequest> {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("PullRequest");
|
||||
|
||||
private static final org.apache.thrift.protocol.TField TITLE_FIELD_DESC = new org.apache.thrift.protocol.TField("title", org.apache.thrift.protocol.TType.STRING, (short)1);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new PullRequestStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new PullRequestTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public String title; // required
|
||||
|
||||
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
|
||||
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
|
||||
TITLE((short)1, "title");
|
||||
|
||||
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
|
||||
|
||||
static {
|
||||
for (_Fields field : EnumSet.allOf(_Fields.class)) {
|
||||
byName.put(field.getFieldName(), field);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the _Fields constant that matches fieldId, or null if its not found.
|
||||
*/
|
||||
public static _Fields findByThriftId(int fieldId) {
|
||||
switch(fieldId) {
|
||||
case 1: // TITLE
|
||||
return TITLE;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the _Fields constant that matches fieldId, throwing an exception
|
||||
* if it is not found.
|
||||
*/
|
||||
public static _Fields findByThriftIdOrThrow(int fieldId) {
|
||||
_Fields fields = findByThriftId(fieldId);
|
||||
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
|
||||
return fields;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the _Fields constant that matches name, or null if its not found.
|
||||
*/
|
||||
public static _Fields findByName(String name) {
|
||||
return byName.get(name);
|
||||
}
|
||||
|
||||
private final short _thriftId;
|
||||
private final String _fieldName;
|
||||
|
||||
_Fields(short thriftId, String fieldName) {
|
||||
_thriftId = thriftId;
|
||||
_fieldName = fieldName;
|
||||
}
|
||||
|
||||
public short getThriftFieldId() {
|
||||
return _thriftId;
|
||||
}
|
||||
|
||||
public String getFieldName() {
|
||||
return _fieldName;
|
||||
}
|
||||
}
|
||||
|
||||
// isset id assignments
|
||||
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
|
||||
static {
|
||||
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
|
||||
tmpMap.put(_Fields.TITLE, new org.apache.thrift.meta_data.FieldMetaData("title", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
||||
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
|
||||
metaDataMap = Collections.unmodifiableMap(tmpMap);
|
||||
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PullRequest.class, metaDataMap);
|
||||
}
|
||||
|
||||
public PullRequest() {
|
||||
}
|
||||
|
||||
public PullRequest(
|
||||
String title)
|
||||
{
|
||||
this();
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
public PullRequest(PullRequest other) {
|
||||
if (other.isSetTitle()) {
|
||||
this.title = other.title;
|
||||
}
|
||||
}
|
||||
|
||||
public PullRequest deepCopy() {
|
||||
return new PullRequest(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
this.title = null;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return this.title;
|
||||
}
|
||||
|
||||
public PullRequest setTitle(String title) {
|
||||
this.title = title;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetTitle() {
|
||||
this.title = null;
|
||||
}
|
||||
|
||||
/** Returns true if field title is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetTitle() {
|
||||
return this.title != null;
|
||||
}
|
||||
|
||||
public void setTitleIsSet(boolean value) {
|
||||
if (!value) {
|
||||
this.title = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void setFieldValue(_Fields field, Object value) {
|
||||
switch (field) {
|
||||
case TITLE:
|
||||
if (value == null) {
|
||||
unsetTitle();
|
||||
} else {
|
||||
setTitle((String)value);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public Object getFieldValue(_Fields field) {
|
||||
switch (field) {
|
||||
case TITLE:
|
||||
return getTitle();
|
||||
|
||||
}
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSet(_Fields field) {
|
||||
if (field == null) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
switch (field) {
|
||||
case TITLE:
|
||||
return isSetTitle();
|
||||
}
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
if (that instanceof PullRequest)
|
||||
return this.equals((PullRequest)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(PullRequest that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
|
||||
boolean this_present_title = true && this.isSetTitle();
|
||||
boolean that_present_title = true && that.isSetTitle();
|
||||
if (this_present_title || that_present_title) {
|
||||
if (!(this_present_title && that_present_title))
|
||||
return false;
|
||||
if (!this.title.equals(that.title))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
List<Object> list = new ArrayList<Object>();
|
||||
|
||||
boolean present_title = true && (isSetTitle());
|
||||
list.add(present_title);
|
||||
if (present_title)
|
||||
list.add(title);
|
||||
|
||||
return list.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(PullRequest other) {
|
||||
if (!getClass().equals(other.getClass())) {
|
||||
return getClass().getName().compareTo(other.getClass().getName());
|
||||
}
|
||||
|
||||
int lastComparison = 0;
|
||||
|
||||
lastComparison = Boolean.valueOf(isSetTitle()).compareTo(other.isSetTitle());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetTitle()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.title, other.title);
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public _Fields fieldForId(int fieldId) {
|
||||
return _Fields.findByThriftId(fieldId);
|
||||
}
|
||||
|
||||
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
|
||||
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
|
||||
}
|
||||
|
||||
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
|
||||
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder("PullRequest(");
|
||||
boolean first = true;
|
||||
|
||||
sb.append("title:");
|
||||
if (this.title == null) {
|
||||
sb.append("null");
|
||||
} else {
|
||||
sb.append(this.title);
|
||||
}
|
||||
first = false;
|
||||
sb.append(")");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void validate() throws org.apache.thrift.TException {
|
||||
// check for required fields
|
||||
// check for sub-struct validity
|
||||
}
|
||||
|
||||
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
|
||||
try {
|
||||
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
|
||||
} catch (org.apache.thrift.TException te) {
|
||||
throw new java.io.IOException(te);
|
||||
}
|
||||
}
|
||||
|
||||
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
|
||||
try {
|
||||
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
|
||||
} catch (org.apache.thrift.TException te) {
|
||||
throw new java.io.IOException(te);
|
||||
}
|
||||
}
|
||||
|
||||
private static class PullRequestStandardSchemeFactory implements SchemeFactory {
|
||||
public PullRequestStandardScheme getScheme() {
|
||||
return new PullRequestStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class PullRequestStandardScheme extends StandardScheme<PullRequest> {
|
||||
|
||||
public void read(org.apache.thrift.protocol.TProtocol iprot, PullRequest struct) throws org.apache.thrift.TException {
|
||||
org.apache.thrift.protocol.TField schemeField;
|
||||
iprot.readStructBegin();
|
||||
while (true)
|
||||
{
|
||||
schemeField = iprot.readFieldBegin();
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
|
||||
break;
|
||||
}
|
||||
switch (schemeField.id) {
|
||||
case 1: // TITLE
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
|
||||
struct.title = iprot.readString();
|
||||
struct.setTitleIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
iprot.readFieldEnd();
|
||||
}
|
||||
iprot.readStructEnd();
|
||||
|
||||
// check for required fields of primitive type, which can't be checked in the validate method
|
||||
struct.validate();
|
||||
}
|
||||
|
||||
public void write(org.apache.thrift.protocol.TProtocol oprot, PullRequest struct) throws org.apache.thrift.TException {
|
||||
struct.validate();
|
||||
|
||||
oprot.writeStructBegin(STRUCT_DESC);
|
||||
if (struct.title != null) {
|
||||
oprot.writeFieldBegin(TITLE_FIELD_DESC);
|
||||
oprot.writeString(struct.title);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class PullRequestTupleSchemeFactory implements SchemeFactory {
|
||||
public PullRequestTupleScheme getScheme() {
|
||||
return new PullRequestTupleScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class PullRequestTupleScheme extends TupleScheme<PullRequest> {
|
||||
|
||||
@Override
|
||||
public void write(org.apache.thrift.protocol.TProtocol prot, PullRequest struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol oprot = (TTupleProtocol) prot;
|
||||
BitSet optionals = new BitSet();
|
||||
if (struct.isSetTitle()) {
|
||||
optionals.set(0);
|
||||
}
|
||||
oprot.writeBitSet(optionals, 1);
|
||||
if (struct.isSetTitle()) {
|
||||
oprot.writeString(struct.title);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(org.apache.thrift.protocol.TProtocol prot, PullRequest struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol iprot = (TTupleProtocol) prot;
|
||||
BitSet incoming = iprot.readBitSet(1);
|
||||
if (incoming.get(0)) {
|
||||
struct.title = iprot.readString();
|
||||
struct.setTitleIsSet(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
60
samples/JavaScript/gen-js-linguist-thrift.js
Normal file
60
samples/JavaScript/gen-js-linguist-thrift.js
Normal file
@@ -0,0 +1,60 @@
|
||||
//
|
||||
// Autogenerated by Thrift Compiler (1.0.0-dev)
|
||||
//
|
||||
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
//
|
||||
|
||||
|
||||
PullRequest = function(args) {
|
||||
this.title = null;
|
||||
if (args) {
|
||||
if (args.title !== undefined) {
|
||||
this.title = args.title;
|
||||
}
|
||||
}
|
||||
};
|
||||
PullRequest.prototype = {};
|
||||
PullRequest.prototype.read = function(input) {
|
||||
input.readStructBegin();
|
||||
while (true)
|
||||
{
|
||||
var ret = input.readFieldBegin();
|
||||
var fname = ret.fname;
|
||||
var ftype = ret.ftype;
|
||||
var fid = ret.fid;
|
||||
if (ftype == Thrift.Type.STOP) {
|
||||
break;
|
||||
}
|
||||
switch (fid)
|
||||
{
|
||||
case 1:
|
||||
if (ftype == Thrift.Type.STRING) {
|
||||
this.title = input.readString().value;
|
||||
} else {
|
||||
input.skip(ftype);
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
input.skip(ftype);
|
||||
break;
|
||||
default:
|
||||
input.skip(ftype);
|
||||
}
|
||||
input.readFieldEnd();
|
||||
}
|
||||
input.readStructEnd();
|
||||
return;
|
||||
};
|
||||
|
||||
PullRequest.prototype.write = function(output) {
|
||||
output.writeStructBegin('PullRequest');
|
||||
if (this.title !== null && this.title !== undefined) {
|
||||
output.writeFieldBegin('title', Thrift.Type.STRING, 1);
|
||||
output.writeString(this.title);
|
||||
output.writeFieldEnd();
|
||||
}
|
||||
output.writeFieldStop();
|
||||
output.writeStructEnd();
|
||||
return;
|
||||
};
|
||||
|
||||
601
samples/Lex/zend_ini_scanner.l
Normal file
601
samples/Lex/zend_ini_scanner.l
Normal file
@@ -0,0 +1,601 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.zend.com/license/2_00.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Zeev Suraski <zeev@zend.com> |
|
||||
| Jani Taskinen <jani@php.net> |
|
||||
| Marcus Boerger <helly@php.net> |
|
||||
| Nuno Lopes <nlopess@php.net> |
|
||||
| Scott MacVicar <scottmac@php.net> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#include <errno.h>
|
||||
#include "zend.h"
|
||||
#include "zend_globals.h"
|
||||
#include <zend_ini_parser.h>
|
||||
#include "zend_ini_scanner.h"
|
||||
|
||||
#if 0
|
||||
# define YYDEBUG(s, c) printf("state: %d char: %c\n", s, c)
|
||||
#else
|
||||
# define YYDEBUG(s, c)
|
||||
#endif
|
||||
|
||||
#include "zend_ini_scanner_defs.h"
|
||||
|
||||
#define YYCTYPE unsigned char
|
||||
/* allow the scanner to read one null byte after the end of the string (from ZEND_MMAP_AHEAD)
|
||||
* so that if will be able to terminate to match the current token (e.g. non-enclosed string) */
|
||||
#define YYFILL(n) { if (YYCURSOR > YYLIMIT) return 0; }
|
||||
#define YYCURSOR SCNG(yy_cursor)
|
||||
#define YYLIMIT SCNG(yy_limit)
|
||||
#define YYMARKER SCNG(yy_marker)
|
||||
|
||||
#define YYGETCONDITION() SCNG(yy_state)
|
||||
#define YYSETCONDITION(s) SCNG(yy_state) = s
|
||||
|
||||
#define STATE(name) yyc##name
|
||||
|
||||
/* emulate flex constructs */
|
||||
#define BEGIN(state) YYSETCONDITION(STATE(state))
|
||||
#define YYSTATE YYGETCONDITION()
|
||||
#define yytext ((char*)SCNG(yy_text))
|
||||
#define yyleng SCNG(yy_leng)
|
||||
#define yyless(x) do { YYCURSOR = (unsigned char*)yytext + x; \
|
||||
yyleng = (unsigned int)x; } while(0)
|
||||
|
||||
/* #define yymore() goto yymore_restart */
|
||||
|
||||
/* perform sanity check. If this message is triggered you should
|
||||
increase the ZEND_MMAP_AHEAD value in the zend_streams.h file */
|
||||
/*!max:re2c */
|
||||
#if ZEND_MMAP_AHEAD < (YYMAXFILL + 1)
|
||||
# error ZEND_MMAP_AHEAD should be greater than YYMAXFILL
|
||||
#endif
|
||||
|
||||
|
||||
/* How it works (for the core ini directives):
|
||||
* ===========================================
|
||||
*
|
||||
* 1. Scanner scans file for tokens and passes them to parser.
|
||||
* 2. Parser parses the tokens and passes the name/value pairs to the callback
|
||||
* function which stores them in the configuration hash table.
|
||||
* 3. Later REGISTER_INI_ENTRIES() is called which triggers the actual
|
||||
* registering of ini entries and uses zend_get_configuration_directive()
|
||||
* to fetch the previously stored name/value pair from configuration hash table
|
||||
* and registers the static ini entries which match the name to the value
|
||||
* into EG(ini_directives) hash table.
|
||||
* 4. PATH section entries are used per-request from down to top, each overriding
|
||||
* previous if one exists. zend_alter_ini_entry() is called for each entry.
|
||||
* Settings in PATH section are ZEND_INI_SYSTEM accessible and thus mimics the
|
||||
* php_admin_* directives used within Apache httpd.conf when PHP is compiled as
|
||||
* module for Apache.
|
||||
* 5. User defined ini files (like .htaccess for apache) are parsed for each request and
|
||||
* stored in separate hash defined by SAPI.
|
||||
*/
|
||||
|
||||
/* TODO: (ordered by importance :-)
|
||||
* ===============================================================================
|
||||
*
|
||||
* - Separate constant lookup totally from plain strings (using CONSTANT pattern)
|
||||
* - Add #if .. #else .. #endif and ==, !=, <, > , <=, >= operators
|
||||
* - Add #include "some.ini"
|
||||
* - Allow variables to refer to options also when using parse_ini_file()
|
||||
*
|
||||
*/
|
||||
|
||||
/* Globals Macros */
|
||||
#define SCNG INI_SCNG
|
||||
#ifdef ZTS
|
||||
ZEND_API ts_rsrc_id ini_scanner_globals_id;
|
||||
#else
|
||||
ZEND_API zend_ini_scanner_globals ini_scanner_globals;
|
||||
#endif
|
||||
|
||||
/* Eat leading whitespace */
|
||||
#define EAT_LEADING_WHITESPACE() \
|
||||
while (yytext[0]) { \
|
||||
if (yytext[0] == ' ' || yytext[0] == '\t') { \
|
||||
SCNG(yy_text)++; \
|
||||
yyleng--; \
|
||||
} else { \
|
||||
break; \
|
||||
} \
|
||||
}
|
||||
|
||||
/* Eat trailing whitespace + extra char */
|
||||
#define EAT_TRAILING_WHITESPACE_EX(ch) \
|
||||
while (yyleng > 0 && ( \
|
||||
(ch != 'X' && yytext[yyleng - 1] == ch) || \
|
||||
yytext[yyleng - 1] == '\n' || \
|
||||
yytext[yyleng - 1] == '\r' || \
|
||||
yytext[yyleng - 1] == '\t' || \
|
||||
yytext[yyleng - 1] == ' ') \
|
||||
) { \
|
||||
yyleng--; \
|
||||
}
|
||||
|
||||
/* Eat trailing whitespace */
|
||||
#define EAT_TRAILING_WHITESPACE() EAT_TRAILING_WHITESPACE_EX('X')
|
||||
|
||||
#define zend_ini_copy_value(retval, str, len) { \
|
||||
Z_STRVAL_P(retval) = zend_strndup(str, len); \
|
||||
Z_STRLEN_P(retval) = len; \
|
||||
Z_TYPE_P(retval) = IS_STRING; \
|
||||
}
|
||||
|
||||
#define RETURN_TOKEN(type, str, len) { \
|
||||
zend_ini_copy_value(ini_lval, str, len); \
|
||||
return type; \
|
||||
}
|
||||
|
||||
static void _yy_push_state(int new_state TSRMLS_DC)
|
||||
{
|
||||
zend_stack_push(&SCNG(state_stack), (void *) &YYGETCONDITION(), sizeof(int));
|
||||
YYSETCONDITION(new_state);
|
||||
}
|
||||
|
||||
#define yy_push_state(state_and_tsrm) _yy_push_state(yyc##state_and_tsrm)
|
||||
|
||||
static void yy_pop_state(TSRMLS_D)
|
||||
{
|
||||
int *stack_state;
|
||||
zend_stack_top(&SCNG(state_stack), (void **) &stack_state);
|
||||
YYSETCONDITION(*stack_state);
|
||||
zend_stack_del_top(&SCNG(state_stack));
|
||||
}
|
||||
|
||||
static void yy_scan_buffer(char *str, unsigned int len TSRMLS_DC)
|
||||
{
|
||||
YYCURSOR = (YYCTYPE*)str;
|
||||
SCNG(yy_start) = YYCURSOR;
|
||||
YYLIMIT = YYCURSOR + len;
|
||||
}
|
||||
|
||||
#define ini_filename SCNG(filename)
|
||||
|
||||
/* {{{ init_ini_scanner()
|
||||
*/
|
||||
static int init_ini_scanner(int scanner_mode, zend_file_handle *fh TSRMLS_DC)
|
||||
{
|
||||
/* Sanity check */
|
||||
if (scanner_mode != ZEND_INI_SCANNER_NORMAL && scanner_mode != ZEND_INI_SCANNER_RAW) {
|
||||
zend_error(E_WARNING, "Invalid scanner mode");
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
SCNG(lineno) = 1;
|
||||
SCNG(scanner_mode) = scanner_mode;
|
||||
SCNG(yy_in) = fh;
|
||||
|
||||
if (fh != NULL) {
|
||||
ini_filename = zend_strndup(fh->filename, strlen(fh->filename));
|
||||
} else {
|
||||
ini_filename = NULL;
|
||||
}
|
||||
|
||||
zend_stack_init(&SCNG(state_stack));
|
||||
BEGIN(INITIAL);
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ shutdown_ini_scanner()
|
||||
*/
|
||||
void shutdown_ini_scanner(TSRMLS_D)
|
||||
{
|
||||
zend_stack_destroy(&SCNG(state_stack));
|
||||
if (ini_filename) {
|
||||
free(ini_filename);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ zend_ini_scanner_get_lineno()
|
||||
*/
|
||||
int zend_ini_scanner_get_lineno(TSRMLS_D)
|
||||
{
|
||||
return SCNG(lineno);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ zend_ini_scanner_get_filename()
|
||||
*/
|
||||
char *zend_ini_scanner_get_filename(TSRMLS_D)
|
||||
{
|
||||
return ini_filename ? ini_filename : "Unknown";
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ zend_ini_open_file_for_scanning()
|
||||
*/
|
||||
int zend_ini_open_file_for_scanning(zend_file_handle *fh, int scanner_mode TSRMLS_DC)
|
||||
{
|
||||
char *buf;
|
||||
size_t size;
|
||||
|
||||
if (zend_stream_fixup(fh, &buf, &size TSRMLS_CC) == FAILURE) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
if (init_ini_scanner(scanner_mode, fh TSRMLS_CC) == FAILURE) {
|
||||
zend_file_handle_dtor(fh TSRMLS_CC);
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
yy_scan_buffer(buf, size TSRMLS_CC);
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ zend_ini_prepare_string_for_scanning()
|
||||
*/
|
||||
int zend_ini_prepare_string_for_scanning(char *str, int scanner_mode TSRMLS_DC)
|
||||
{
|
||||
int len = strlen(str);
|
||||
|
||||
if (init_ini_scanner(scanner_mode, NULL TSRMLS_CC) == FAILURE) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
yy_scan_buffer(str, len TSRMLS_CC);
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ zend_ini_escape_string()
|
||||
*/
|
||||
static void zend_ini_escape_string(zval *lval, char *str, int len, char quote_type TSRMLS_DC)
|
||||
{
|
||||
register char *s, *t;
|
||||
char *end;
|
||||
|
||||
zend_ini_copy_value(lval, str, len);
|
||||
|
||||
/* convert escape sequences */
|
||||
s = t = Z_STRVAL_P(lval);
|
||||
end = s + Z_STRLEN_P(lval);
|
||||
|
||||
while (s < end) {
|
||||
if (*s == '\\') {
|
||||
s++;
|
||||
if (s >= end) {
|
||||
*t++ = '\\';
|
||||
continue;
|
||||
}
|
||||
switch (*s) {
|
||||
case '"':
|
||||
if (*s != quote_type) {
|
||||
*t++ = '\\';
|
||||
*t++ = *s;
|
||||
break;
|
||||
}
|
||||
case '\\':
|
||||
case '$':
|
||||
*t++ = *s;
|
||||
Z_STRLEN_P(lval)--;
|
||||
break;
|
||||
default:
|
||||
*t++ = '\\';
|
||||
*t++ = *s;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
*t++ = *s;
|
||||
}
|
||||
if (*s == '\n' || (*s == '\r' && (*(s+1) != '\n'))) {
|
||||
SCNG(lineno)++;
|
||||
}
|
||||
s++;
|
||||
}
|
||||
*t = 0;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
int ini_lex(zval *ini_lval TSRMLS_DC)
|
||||
{
|
||||
restart:
|
||||
SCNG(yy_text) = YYCURSOR;
|
||||
|
||||
/* yymore_restart: */
|
||||
/* detect EOF */
|
||||
if (YYCURSOR >= YYLIMIT) {
|
||||
if (YYSTATE == STATE(ST_VALUE) || YYSTATE == STATE(ST_RAW)) {
|
||||
BEGIN(INITIAL);
|
||||
return END_OF_LINE;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Eat any UTF-8 BOM we find in the first 3 bytes */
|
||||
if (YYCURSOR == SCNG(yy_start) && YYCURSOR + 3 < YYLIMIT) {
|
||||
if (memcmp(YYCURSOR, "\xef\xbb\xbf", 3) == 0) {
|
||||
YYCURSOR += 3;
|
||||
goto restart;
|
||||
}
|
||||
}
|
||||
/*!re2c
|
||||
re2c:yyfill:check = 0;
|
||||
LNUM [0-9]+
|
||||
DNUM ([0-9]*[\.][0-9]+)|([0-9]+[\.][0-9]*)
|
||||
NUMBER [-]?{LNUM}|{DNUM}
|
||||
ANY_CHAR (.|[\n\t])
|
||||
NEWLINE ("\r"|"\n"|"\r\n")
|
||||
TABS_AND_SPACES [ \t]
|
||||
WHITESPACE [ \t]+
|
||||
CONSTANT [a-zA-Z_][a-zA-Z0-9_]*
|
||||
LABEL [^=\n\r\t;|&$~(){}!"\[]+
|
||||
TOKENS [:,.\[\]"'()|^&+-/*=%$!~<>?@{}]
|
||||
OPERATORS [&|~()!]
|
||||
DOLLAR_CURLY "${"
|
||||
|
||||
SECTION_RAW_CHARS [^\]\n\r]
|
||||
SINGLE_QUOTED_CHARS [^']
|
||||
RAW_VALUE_CHARS [^"\n\r;\000]
|
||||
|
||||
LITERAL_DOLLAR ("$"([^{\000]|("\\"{ANY_CHAR})))
|
||||
VALUE_CHARS ([^$= \t\n\r;&|~()!"'\000]|{LITERAL_DOLLAR})
|
||||
SECTION_VALUE_CHARS ([^$\n\r;"'\]\\]|("\\"{ANY_CHAR})|{LITERAL_DOLLAR})
|
||||
|
||||
<!*> := yyleng = YYCURSOR - SCNG(yy_text);
|
||||
|
||||
<INITIAL>"[" { /* Section start */
|
||||
/* Enter section data lookup state */
|
||||
if (SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW) {
|
||||
yy_push_state(ST_SECTION_RAW TSRMLS_CC);
|
||||
} else {
|
||||
yy_push_state(ST_SECTION_VALUE TSRMLS_CC);
|
||||
}
|
||||
return TC_SECTION;
|
||||
}
|
||||
|
||||
<ST_VALUE,ST_SECTION_VALUE,ST_OFFSET>"'"{SINGLE_QUOTED_CHARS}+"'" { /* Raw string */
|
||||
/* Eat leading and trailing single quotes */
|
||||
if (yytext[0] == '\'' && yytext[yyleng - 1] == '\'') {
|
||||
SCNG(yy_text)++;
|
||||
yyleng = yyleng - 2;
|
||||
}
|
||||
RETURN_TOKEN(TC_RAW, yytext, yyleng);
|
||||
}
|
||||
|
||||
<ST_SECTION_RAW,ST_SECTION_VALUE>"]"{TABS_AND_SPACES}*{NEWLINE}? { /* End of section */
|
||||
BEGIN(INITIAL);
|
||||
SCNG(lineno)++;
|
||||
return ']';
|
||||
}
|
||||
|
||||
<INITIAL>{LABEL}"["{TABS_AND_SPACES}* { /* Start of option with offset */
|
||||
/* Eat leading whitespace */
|
||||
EAT_LEADING_WHITESPACE();
|
||||
|
||||
/* Eat trailing whitespace and [ */
|
||||
EAT_TRAILING_WHITESPACE_EX('[');
|
||||
|
||||
/* Enter offset lookup state */
|
||||
yy_push_state(ST_OFFSET TSRMLS_CC);
|
||||
|
||||
RETURN_TOKEN(TC_OFFSET, yytext, yyleng);
|
||||
}
|
||||
|
||||
<ST_OFFSET>{TABS_AND_SPACES}*"]" { /* End of section or an option offset */
|
||||
BEGIN(INITIAL);
|
||||
return ']';
|
||||
}
|
||||
|
||||
<ST_DOUBLE_QUOTES,ST_SECTION_VALUE,ST_VALUE,ST_OFFSET>{DOLLAR_CURLY} { /* Variable start */
|
||||
yy_push_state(ST_VARNAME TSRMLS_CC);
|
||||
return TC_DOLLAR_CURLY;
|
||||
}
|
||||
|
||||
<ST_VARNAME>{LABEL} { /* Variable name */
|
||||
/* Eat leading whitespace */
|
||||
EAT_LEADING_WHITESPACE();
|
||||
|
||||
/* Eat trailing whitespace */
|
||||
EAT_TRAILING_WHITESPACE();
|
||||
|
||||
RETURN_TOKEN(TC_VARNAME, yytext, yyleng);
|
||||
}
|
||||
|
||||
<ST_VARNAME>"}" { /* Variable end */
|
||||
yy_pop_state(TSRMLS_C);
|
||||
return '}';
|
||||
}
|
||||
|
||||
<INITIAL,ST_VALUE>("true"|"on"|"yes"){TABS_AND_SPACES}* { /* TRUE value (when used outside option value/offset this causes parse error!) */
|
||||
RETURN_TOKEN(BOOL_TRUE, "1", 1);
|
||||
}
|
||||
|
||||
<INITIAL,ST_VALUE>("false"|"off"|"no"|"none"|"null"){TABS_AND_SPACES}* { /* FALSE value (when used outside option value/offset this causes parse error!)*/
|
||||
RETURN_TOKEN(BOOL_FALSE, "", 0);
|
||||
}
|
||||
|
||||
<INITIAL>{LABEL} { /* Get option name */
|
||||
/* Eat leading whitespace */
|
||||
EAT_LEADING_WHITESPACE();
|
||||
|
||||
/* Eat trailing whitespace */
|
||||
EAT_TRAILING_WHITESPACE();
|
||||
|
||||
RETURN_TOKEN(TC_LABEL, yytext, yyleng);
|
||||
}
|
||||
|
||||
<INITIAL>{TABS_AND_SPACES}*[=]{TABS_AND_SPACES}* { /* Start option value */
|
||||
if (SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW) {
|
||||
yy_push_state(ST_RAW TSRMLS_CC);
|
||||
} else {
|
||||
yy_push_state(ST_VALUE TSRMLS_CC);
|
||||
}
|
||||
return '=';
|
||||
}
|
||||
|
||||
<ST_RAW>["] {
|
||||
while (YYCURSOR < YYLIMIT) {
|
||||
switch (*YYCURSOR++) {
|
||||
case '\n':
|
||||
SCNG(lineno)++;
|
||||
break;
|
||||
case '\r':
|
||||
if (*YYCURSOR != '\n') {
|
||||
SCNG(lineno)++;
|
||||
}
|
||||
break;
|
||||
case '"':
|
||||
yyleng = YYCURSOR - SCNG(yy_text) - 2;
|
||||
SCNG(yy_text)++;
|
||||
RETURN_TOKEN(TC_RAW, yytext, yyleng);
|
||||
case '\\':
|
||||
if (YYCURSOR < YYLIMIT) {
|
||||
YYCURSOR++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
RETURN_TOKEN(TC_RAW, yytext, yyleng);
|
||||
}
|
||||
|
||||
<ST_RAW>{RAW_VALUE_CHARS}+ { /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */
|
||||
RETURN_TOKEN(TC_RAW, yytext, yyleng);
|
||||
}
|
||||
|
||||
<ST_SECTION_RAW>{SECTION_RAW_CHARS}+ { /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */
|
||||
RETURN_TOKEN(TC_RAW, yytext, yyleng);
|
||||
}
|
||||
|
||||
<ST_VALUE,ST_RAW>{TABS_AND_SPACES}*{NEWLINE} { /* End of option value */
|
||||
BEGIN(INITIAL);
|
||||
SCNG(lineno)++;
|
||||
return END_OF_LINE;
|
||||
}
|
||||
|
||||
<ST_SECTION_VALUE,ST_VALUE,ST_OFFSET>{CONSTANT} { /* Get constant option value */
|
||||
RETURN_TOKEN(TC_CONSTANT, yytext, yyleng);
|
||||
}
|
||||
|
||||
<ST_SECTION_VALUE,ST_VALUE,ST_OFFSET>{NUMBER} { /* Get number option value as string */
|
||||
RETURN_TOKEN(TC_NUMBER, yytext, yyleng);
|
||||
}
|
||||
|
||||
<INITIAL>{TOKENS} { /* Disallow these chars outside option values */
|
||||
return yytext[0];
|
||||
}
|
||||
|
||||
<ST_VALUE>{OPERATORS}{TABS_AND_SPACES}* { /* Boolean operators */
|
||||
return yytext[0];
|
||||
}
|
||||
|
||||
<ST_VALUE>[=] { /* Make = used in option value to trigger error */
|
||||
yyless(0);
|
||||
BEGIN(INITIAL);
|
||||
return END_OF_LINE;
|
||||
}
|
||||
|
||||
<ST_VALUE>{VALUE_CHARS}+ { /* Get everything else as option/offset value */
|
||||
RETURN_TOKEN(TC_STRING, yytext, yyleng);
|
||||
}
|
||||
|
||||
<ST_SECTION_VALUE,ST_OFFSET>{SECTION_VALUE_CHARS}+ { /* Get rest as section/offset value */
|
||||
RETURN_TOKEN(TC_STRING, yytext, yyleng);
|
||||
}
|
||||
|
||||
<ST_SECTION_VALUE,ST_VALUE,ST_OFFSET>{TABS_AND_SPACES}*["] { /* Double quoted '"' string start */
|
||||
yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC);
|
||||
return '"';
|
||||
}
|
||||
|
||||
<ST_DOUBLE_QUOTES>["]{TABS_AND_SPACES}* { /* Double quoted '"' string ends */
|
||||
yy_pop_state(TSRMLS_C);
|
||||
return '"';
|
||||
}
|
||||
|
||||
<ST_DOUBLE_QUOTES>[^] { /* Escape double quoted string contents */
|
||||
if (YYCURSOR > YYLIMIT) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
while (YYCURSOR < YYLIMIT) {
|
||||
switch (*YYCURSOR++) {
|
||||
case '"':
|
||||
if (YYCURSOR < YYLIMIT && YYCURSOR[-2] == '\\' && *YYCURSOR != '\r' && *YYCURSOR != '\n') {
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
case '$':
|
||||
if (*YYCURSOR == '{') {
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
case '\\':
|
||||
if (YYCURSOR < YYLIMIT && *YYCURSOR != '"') {
|
||||
YYCURSOR++;
|
||||
}
|
||||
/* fall through */
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
|
||||
YYCURSOR--;
|
||||
break;
|
||||
}
|
||||
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
|
||||
zend_ini_escape_string(ini_lval, yytext, yyleng, '"' TSRMLS_CC);
|
||||
return TC_QUOTED_STRING;
|
||||
}
|
||||
|
||||
<ST_SECTION_VALUE,ST_VALUE,ST_OFFSET>{WHITESPACE} {
|
||||
RETURN_TOKEN(TC_WHITESPACE, yytext, yyleng);
|
||||
}
|
||||
|
||||
<INITIAL,ST_RAW>{TABS_AND_SPACES}+ {
|
||||
/* eat whitespace */
|
||||
goto restart;
|
||||
}
|
||||
|
||||
<INITIAL>{TABS_AND_SPACES}*{NEWLINE} {
|
||||
SCNG(lineno)++;
|
||||
return END_OF_LINE;
|
||||
}
|
||||
|
||||
<INITIAL,ST_VALUE,ST_RAW>{TABS_AND_SPACES}*[;][^\r\n]*{NEWLINE} { /* Comment */
|
||||
BEGIN(INITIAL);
|
||||
SCNG(lineno)++;
|
||||
return END_OF_LINE;
|
||||
}
|
||||
|
||||
<INITIAL>{TABS_AND_SPACES}*[#][^\r\n]*{NEWLINE} { /* #Comment */
|
||||
zend_error(E_DEPRECATED, "Comments starting with '#' are deprecated in %s on line %d", zend_ini_scanner_get_filename(TSRMLS_C), SCNG(lineno));
|
||||
BEGIN(INITIAL);
|
||||
SCNG(lineno)++;
|
||||
return END_OF_LINE;
|
||||
}
|
||||
|
||||
<ST_VALUE,ST_RAW>[^] { /* End of option value (if EOF is reached before EOL */
|
||||
BEGIN(INITIAL);
|
||||
return END_OF_LINE;
|
||||
}
|
||||
|
||||
<*>[^] {
|
||||
return 0;
|
||||
}
|
||||
|
||||
*/
|
||||
}
|
||||
23
samples/Makefile/filenames/Kbuild
Normal file
23
samples/Makefile/filenames/Kbuild
Normal file
@@ -0,0 +1,23 @@
|
||||
# Fail on warnings - also for files referenced in subdirs
|
||||
# -Werror can be disabled for specific files using:
|
||||
# CFLAGS_<file.o> := -Wno-error
|
||||
subdir-ccflags-y := -Werror
|
||||
|
||||
# platform specific definitions
|
||||
include arch/mips/Kbuild.platforms
|
||||
obj-y := $(platform-y)
|
||||
|
||||
# make clean traverses $(obj-) without having included .config, so
|
||||
# everything ends up here
|
||||
obj- := $(platform-)
|
||||
|
||||
# mips object files
|
||||
# The object files are linked as core-y files would be linked
|
||||
|
||||
obj-y += kernel/
|
||||
obj-y += mm/
|
||||
obj-y += net/
|
||||
|
||||
ifdef CONFIG_KVM
|
||||
obj-y += kvm/
|
||||
endif
|
||||
242
samples/Nginx/example.com.vhost
Normal file
242
samples/Nginx/example.com.vhost
Normal file
@@ -0,0 +1,242 @@
|
||||
# Move the www people to no-www
|
||||
server {
|
||||
listen 80;
|
||||
server_name www.example.com;
|
||||
return 301 $scheme://example.com$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
listen 443 ssl;
|
||||
server_name example.com;
|
||||
|
||||
# Certs sent to the client in SERVER HELLO are concatenated in ssl_certificate
|
||||
ssl_certificate /srv/www/example.com/ssl/example.com.crt;
|
||||
ssl_certificate_key /srv/www/example.com/ssl/example.com.key;
|
||||
|
||||
# Allow multiple connections to use the same key data
|
||||
ssl_session_timeout 5m;
|
||||
ssl_session_cache shared:SSL:50m;
|
||||
|
||||
# Diffie-Hellman parameter for DHE ciphersuites, recommended 2048 bits
|
||||
ssl_dhparam /etc/ssl/certs/dhparam.pem;
|
||||
|
||||
# Intermediate configuration. tweak to your needs
|
||||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
||||
include snippets/ssl_ciphers_intermediate.conf;
|
||||
ssl_prefer_server_ciphers on;
|
||||
|
||||
# HSTS (ngx_http_headers_module is required) (15768000 seconds = 6 months)
|
||||
#add_header Strict-Transport-Security max-age=15768000;
|
||||
|
||||
# OCSP Stapling - fetch OCSP records from URL in ssl_certificate and cache them
|
||||
ssl_stapling on;
|
||||
ssl_stapling_verify on;
|
||||
|
||||
# Verify chain of trust of OCSP response using Root CA and Intermediate certs
|
||||
ssl_trusted_certificate /srv/www/example.com/ssl/unified-ssl.crt;
|
||||
resolver 8.8.8.8 8.8.4.4;
|
||||
resolver_timeout 10s;
|
||||
|
||||
root /srv/www/example.com/htdocs;
|
||||
index index.php index.html index.htm;
|
||||
charset UTF-8;
|
||||
autoindex off;
|
||||
|
||||
# Deny access based on HTTP method (set in HTTP level)
|
||||
if ($bad_method = 1) {
|
||||
return 444;
|
||||
}
|
||||
|
||||
# Show "Not Found" 404 errors in place of "Forbidden" 403 errors, because
|
||||
# forbidden errors allow attackers potential insight into your server's
|
||||
# layout and contents
|
||||
error_page 403 = 404;
|
||||
|
||||
# It's always good to set logs, note however you cannot turn off the error log
|
||||
# setting error_log off; will simply create a file called 'off'.
|
||||
access_log /var/log/nginx/example.com.access.log;
|
||||
error_log /var/log/nginx/example.com.error.log;
|
||||
|
||||
# Add trailing slash to */wp-admin requests.
|
||||
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
|
||||
|
||||
location / {
|
||||
# This try_files directive is used to enable pretty, SEO-friendly URLs
|
||||
# and permalinks for Wordpress. Leave it *off* to start with, and then
|
||||
# turn it on once you've gotten Wordpress configured!
|
||||
try_files $uri $uri/ /index.php?$args;
|
||||
}
|
||||
|
||||
# Option to create password protected directory
|
||||
# http://www.howtoforge.com/basic-http-authentication-with-nginx
|
||||
# location /admin {
|
||||
# auth_basic "Administrator Login";
|
||||
# auth_basic_user_file /var/www/domain.com/admin/.htpasswd;
|
||||
# }
|
||||
|
||||
# Do not log access to these to keep the logs cleaner
|
||||
location = /favicon.ico {
|
||||
log_not_found off;
|
||||
access_log off;
|
||||
}
|
||||
|
||||
location = /apple-touch-icon.png {
|
||||
log_not_found off;
|
||||
access_log off;
|
||||
}
|
||||
|
||||
location = /apple-touch-icon-precomposed.png {
|
||||
log_not_found off;
|
||||
access_log off;
|
||||
}
|
||||
|
||||
# This block will catch static file requests, such as images, css, js
|
||||
# The ?: prefix is a 'non-capturing' mark, meaning we do not require
|
||||
# the pattern to be captured into $1 which should help improve performance
|
||||
location ~* \.(?:3gp|gif|jpg|jpe?g|png|ico|wmv|avi|asf|asx|mpg|mpeg|mp4|pls|mp3|mid|wav|swf|flv|html|htm|txt|js|css|exe|zip|tar|rar|gz|tgz|bz2|uha|7z|doc|docx|xls|xlsx|pdf|iso|woff)$ {
|
||||
# Some basic cache-control for static files to be sent to the browser
|
||||
expires max;
|
||||
add_header Pragma public;
|
||||
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
|
||||
}
|
||||
|
||||
# Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
|
||||
# Keep logging the requests to parse later (or to pass to firewall utilities such as fail2ban)
|
||||
location ~ /\. {
|
||||
access_log off;
|
||||
log_not_found off;
|
||||
deny all;
|
||||
}
|
||||
|
||||
location ~ ~$ {
|
||||
access_log off;
|
||||
log_not_found off;
|
||||
deny all;
|
||||
}
|
||||
|
||||
# Common deny or internal locations, to help prevent access to areas of
|
||||
# the site that should not be public
|
||||
location ~* wp-admin/includes {
|
||||
deny all;
|
||||
}
|
||||
|
||||
location ~* wp-includes/theme-compat/ {
|
||||
deny all;
|
||||
}
|
||||
|
||||
location ~* wp-includes/js/tinymce/langs/.*\.php {
|
||||
deny all;
|
||||
}
|
||||
|
||||
location /wp-content/ {
|
||||
internal;
|
||||
}
|
||||
|
||||
# Deny access to any files with a .php extension in the uploads directory
|
||||
# Works in sub-directory installs and also in multisite network
|
||||
# Keep logging the requests to parse later (or to pass to firewall utilities such as fail2ban)
|
||||
location ~* /(?:uploads|files)/.*\.php$ {
|
||||
deny all;
|
||||
}
|
||||
|
||||
# Make sure these get through, esp with dynamic WP sitmap plugin
|
||||
location = /robots.txt {
|
||||
try_files $uri /index.php;
|
||||
}
|
||||
|
||||
location = /sitemap.xml {
|
||||
try_files $uri /index.php;
|
||||
}
|
||||
|
||||
location = /sitemap.xml.gz {
|
||||
try_files $uri /index.php;
|
||||
}
|
||||
|
||||
# Fix for Firefox issue with cross site font icons
|
||||
location ~* \.(eot|otf|ttf|woff)$ {
|
||||
add_header Access-Control-Allow-Origin *;
|
||||
}
|
||||
|
||||
# Redirect server error pages to the static page /50x.html
|
||||
# Make sure 50x.html exists at that location
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root /usr/share/nginx/html;
|
||||
}
|
||||
|
||||
# Cache everything by default
|
||||
set $skip_cache 0;
|
||||
|
||||
# POST requests and urls with a query string should always go to PHP
|
||||
if ($request_method = POST) {
|
||||
set $skip_cache 1;
|
||||
}
|
||||
if ($query_string != "") {
|
||||
set $skip_cache 1;
|
||||
}
|
||||
|
||||
# Don't cache uris containing the following segments
|
||||
if ($request_uri ~* "/wp-admin/|/xmlrpc.php|wp-.*.php|/feed/|index.php|sitemap(_index)?.xml") {
|
||||
set $skip_cache 1;
|
||||
}
|
||||
|
||||
# Don't use the cache for logged in users or recent commenters
|
||||
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in") {
|
||||
set $skip_cache 1;
|
||||
}
|
||||
|
||||
# Pass all .php files onto a php-fpm/php-fcgi server.
|
||||
location ~ [^/]\.php(/|$) {
|
||||
# regex to split $uri to $fastcgi_script_name and $fastcgi_path
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
|
||||
# Check that the PHP script exists before passing it
|
||||
try_files $fastcgi_script_name =404;
|
||||
|
||||
# Bypass the fact that try_files resets $fastcgi_path_info
|
||||
# see: http://trac.nginx.org/nginx/ticket/321
|
||||
set $path_info $fastcgi_path_info;
|
||||
fastcgi_param PATH_INFO $path_info;
|
||||
|
||||
fastcgi_pass unix:/var/run/example.com.sock;
|
||||
fastcgi_index index.php;
|
||||
# Uncomment if site is HTTPS
|
||||
#fastcgi_param HTTPS on;
|
||||
include fastcgi.conf;
|
||||
|
||||
fastcgi_cache_bypass $skip_cache;
|
||||
fastcgi_no_cache $skip_cache;
|
||||
|
||||
fastcgi_cache WORDPRESS;
|
||||
fastcgi_cache_valid 60m;
|
||||
}
|
||||
|
||||
location ~ /purge(/.*) {
|
||||
fastcgi_cache_purge WORDPRESS "$scheme$request_method$host$1";
|
||||
}
|
||||
|
||||
# Use this block if PHPMyAdmin is enabled for this domain
|
||||
location /phpmyadmin {
|
||||
root /usr/share/;
|
||||
index index.php index.html index.htm;
|
||||
|
||||
location ~ ^/phpmyadmin/(.+\.php)$ {
|
||||
try_files $uri =404;
|
||||
root /usr/share/;
|
||||
fastcgi_pass unix:/var/run/example.com.sock;
|
||||
fastcgi_index index.php;
|
||||
include fastcgi.conf;
|
||||
}
|
||||
|
||||
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
|
||||
root /usr/share/;
|
||||
}
|
||||
}
|
||||
|
||||
location /phpMyAdmin {
|
||||
rewrite ^/* /phpmyadmin last;
|
||||
}
|
||||
# End PHPMyAdmin block
|
||||
|
||||
} # End of server block.
|
||||
176
samples/Objective-C/gen-cocoa-linguist-thrift.m
Normal file
176
samples/Objective-C/gen-cocoa-linguist-thrift.m
Normal file
@@ -0,0 +1,176 @@
|
||||
/**
|
||||
* Autogenerated by Thrift Compiler (1.0.0-dev)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "TProtocol.h"
|
||||
#import "TApplicationException.h"
|
||||
#import "TProtocolException.h"
|
||||
#import "TProtocolUtil.h"
|
||||
#import "TProcessor.h"
|
||||
#import "TObjective-C.h"
|
||||
#import "TBase.h"
|
||||
|
||||
|
||||
#import "linguist.h"
|
||||
|
||||
@implementation PullRequest
|
||||
|
||||
- (id) init
|
||||
{
|
||||
self = [super init];
|
||||
#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
|
||||
#endif
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id) initWithTitle: (NSString *) title
|
||||
{
|
||||
self = [super init];
|
||||
__title = [title retain_stub];
|
||||
__title_isset = YES;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id) initWithCoder: (NSCoder *) decoder
|
||||
{
|
||||
self = [super init];
|
||||
if ([decoder containsValueForKey: @"title"])
|
||||
{
|
||||
__title = [[decoder decodeObjectForKey: @"title"] retain_stub];
|
||||
__title_isset = YES;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) encodeWithCoder: (NSCoder *) encoder
|
||||
{
|
||||
if (__title_isset)
|
||||
{
|
||||
[encoder encodeObject: __title forKey: @"title"];
|
||||
}
|
||||
}
|
||||
|
||||
- (NSUInteger) hash
|
||||
{
|
||||
NSUInteger hash = 17;
|
||||
hash = (hash * 31) ^ __title_isset ? 2654435761 : 0;
|
||||
if (__title_isset)
|
||||
{
|
||||
hash = (hash * 31) ^ [__title hash];
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
|
||||
- (BOOL) isEqual: (id) anObject
|
||||
{
|
||||
if (self == anObject) {
|
||||
return YES;
|
||||
}
|
||||
if (![anObject isKindOfClass:[PullRequest class]]) {
|
||||
return NO;
|
||||
}
|
||||
PullRequest *other = (PullRequest *)anObject;
|
||||
if ((__title_isset != other->__title_isset) ||
|
||||
(__title_isset && ((__title || other->__title) && ![__title isEqual:other->__title]))) {
|
||||
return NO;
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
[__title release_stub];
|
||||
[super dealloc_stub];
|
||||
}
|
||||
|
||||
- (NSString *) title {
|
||||
return [[__title retain_stub] autorelease_stub];
|
||||
}
|
||||
|
||||
- (void) setTitle: (NSString *) title {
|
||||
[title retain_stub];
|
||||
[__title release_stub];
|
||||
__title = title;
|
||||
__title_isset = YES;
|
||||
}
|
||||
|
||||
- (BOOL) titleIsSet {
|
||||
return __title_isset;
|
||||
}
|
||||
|
||||
- (void) unsetTitle {
|
||||
[__title release_stub];
|
||||
__title = nil;
|
||||
__title_isset = NO;
|
||||
}
|
||||
|
||||
- (void) read: (id <TProtocol>) inProtocol
|
||||
{
|
||||
NSString * fieldName;
|
||||
int fieldType;
|
||||
int fieldID;
|
||||
|
||||
[inProtocol readStructBeginReturningName: NULL];
|
||||
while (true)
|
||||
{
|
||||
[inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID];
|
||||
if (fieldType == TType_STOP) {
|
||||
break;
|
||||
}
|
||||
switch (fieldID)
|
||||
{
|
||||
case 1:
|
||||
if (fieldType == TType_STRING) {
|
||||
NSString * fieldValue = [inProtocol readString];
|
||||
[self setTitle: fieldValue];
|
||||
} else {
|
||||
[TProtocolUtil skipType: fieldType onProtocol: inProtocol];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
[TProtocolUtil skipType: fieldType onProtocol: inProtocol];
|
||||
break;
|
||||
}
|
||||
[inProtocol readFieldEnd];
|
||||
}
|
||||
[inProtocol readStructEnd];
|
||||
}
|
||||
|
||||
- (void) write: (id <TProtocol>) outProtocol {
|
||||
[outProtocol writeStructBeginWithName: @"PullRequest"];
|
||||
if (__title_isset) {
|
||||
if (__title != nil) {
|
||||
[outProtocol writeFieldBeginWithName: @"title" type: TType_STRING fieldID: 1];
|
||||
[outProtocol writeString: __title];
|
||||
[outProtocol writeFieldEnd];
|
||||
}
|
||||
}
|
||||
[outProtocol writeFieldStop];
|
||||
[outProtocol writeStructEnd];
|
||||
}
|
||||
|
||||
- (void) validate {
|
||||
// check for required fields
|
||||
}
|
||||
|
||||
- (NSString *) description {
|
||||
NSMutableString * ms = [NSMutableString stringWithString: @"PullRequest("];
|
||||
[ms appendString: @"title:"];
|
||||
[ms appendFormat: @"\"%@\"", __title];
|
||||
[ms appendString: @")"];
|
||||
return [NSString stringWithString: ms];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation linguistConstants
|
||||
+ (void) initialize {
|
||||
}
|
||||
@end
|
||||
|
||||
6
samples/PHP/root.php
Normal file
6
samples/PHP/root.php
Normal file
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
////////////////////////////////////
|
||||
// I am not Isabelle ROOT //
|
||||
////////////////////////////////////
|
||||
|
||||
?>
|
||||
13
samples/Perl/getchar.al
Normal file
13
samples/Perl/getchar.al
Normal file
@@ -0,0 +1,13 @@
|
||||
# NOTE: Derived from ../../lib/POSIX.pm.
|
||||
# Changes made here will be lost when autosplit is run again.
|
||||
# See AutoSplit.pm.
|
||||
package POSIX;
|
||||
|
||||
#line 318 "../../lib/POSIX.pm (autosplit into ../../lib/auto/POSIX/getchar.al)"
|
||||
sub getchar {
|
||||
usage "getchar()" if @_ != 0;
|
||||
CORE::getc(STDIN);
|
||||
}
|
||||
|
||||
# end of POSIX::getchar
|
||||
1;
|
||||
@@ -1,4 +1,5 @@
|
||||
use Test::Base;
|
||||
use Test::More;
|
||||
|
||||
__DATA__
|
||||
=== Strict Test
|
||||
|
||||
@@ -73,26 +73,6 @@ Here's some POD! Wooo
|
||||
|
||||
say('this is not!');
|
||||
|
||||
=table
|
||||
Of role things
|
||||
|
||||
say('not in your table');
|
||||
#= A single line declarator "block" (with a keyword like role)
|
||||
#| Another single line declarator "block" (with a keyword like role)
|
||||
#={
|
||||
A declarator block (with a keyword like role)
|
||||
}
|
||||
#|{
|
||||
Another declarator block (with a keyword like role)
|
||||
}
|
||||
#= { A single line declarator "block" with a brace (with a keyword like role)
|
||||
#=«
|
||||
More declarator blocks! (with a keyword like role)
|
||||
»
|
||||
#|«
|
||||
More declarator blocks! (with a keyword like role)
|
||||
»
|
||||
|
||||
say 'Moar code!';
|
||||
|
||||
my $don't = 16;
|
||||
|
||||
165
samples/PicoLisp/simul.l
Normal file
165
samples/PicoLisp/simul.l
Normal file
@@ -0,0 +1,165 @@
|
||||
# 11dec13abu
|
||||
# (c) Software Lab. Alexander Burger
|
||||
|
||||
(de permute (Lst)
|
||||
(ifn (cdr Lst)
|
||||
(cons Lst)
|
||||
(mapcan
|
||||
'((X)
|
||||
(mapcar
|
||||
'((Y) (cons X Y))
|
||||
(permute (delete X Lst)) ) )
|
||||
Lst ) ) )
|
||||
|
||||
(de subsets (N Lst)
|
||||
(cond
|
||||
((=0 N) '(NIL))
|
||||
((not Lst))
|
||||
(T
|
||||
(conc
|
||||
(mapcar
|
||||
'((X) (cons (car Lst) X))
|
||||
(subsets (dec N) (cdr Lst)) )
|
||||
(subsets N (cdr Lst)) ) ) ) )
|
||||
|
||||
(de shuffle (Lst)
|
||||
(by '(NIL (rand)) sort Lst) )
|
||||
|
||||
(de samples (Cnt Lst)
|
||||
(make
|
||||
(until (=0 Cnt)
|
||||
(when (>= Cnt (rand 1 (length Lst)))
|
||||
(link (car Lst))
|
||||
(dec 'Cnt) )
|
||||
(pop 'Lst) ) ) )
|
||||
|
||||
|
||||
# Genetic Algorithm
|
||||
(de gen ("Pop" "Cond" "Re" "Mu" "Se")
|
||||
(until ("Cond" "Pop")
|
||||
(for ("P" "Pop" "P" (cdr "P"))
|
||||
(set "P"
|
||||
(maxi "Se" # Selection
|
||||
(make
|
||||
(for ("P" "Pop" "P")
|
||||
(rot "P" (rand 1 (length "P")))
|
||||
(link # Recombination + Mutation
|
||||
("Mu" ("Re" (pop '"P") (pop '"P"))) ) ) ) ) ) ) )
|
||||
(maxi "Se" "Pop") )
|
||||
|
||||
|
||||
# Alpha-Beta tree search
|
||||
(de game ("Flg" "Cnt" "Moves" "Move" "Cost")
|
||||
(let ("Alpha" '(1000000) "Beta" -1000000)
|
||||
(recur ("Flg" "Cnt" "Alpha" "Beta")
|
||||
(let? "Lst" ("Moves" "Flg")
|
||||
(if (=0 (dec '"Cnt"))
|
||||
(loop
|
||||
("Move" (caar "Lst"))
|
||||
(setq "*Val" (list ("Cost" "Flg") (car "Lst")))
|
||||
("Move" (cdar "Lst"))
|
||||
(T (>= "Beta" (car "*Val"))
|
||||
(cons "Beta" (car "Lst") (cdr "Alpha")) )
|
||||
(when (> (car "Alpha") (car "*Val"))
|
||||
(setq "Alpha" "*Val") )
|
||||
(NIL (setq "Lst" (cdr "Lst")) "Alpha") )
|
||||
(setq "Lst"
|
||||
(sort
|
||||
(mapcar
|
||||
'(("Mov")
|
||||
(prog2
|
||||
("Move" (car "Mov"))
|
||||
(cons ("Cost" "Flg") "Mov")
|
||||
("Move" (cdr "Mov")) ) )
|
||||
"Lst" ) ) )
|
||||
(loop
|
||||
("Move" (cadar "Lst"))
|
||||
(setq "*Val"
|
||||
(if (recurse (not "Flg") "Cnt" (cons (- "Beta")) (- (car "Alpha")))
|
||||
(cons (- (car @)) (cdar "Lst") (cdr @))
|
||||
(list (caar "Lst") (cdar "Lst")) ) )
|
||||
("Move" (cddar "Lst"))
|
||||
(T (>= "Beta" (car "*Val"))
|
||||
(cons "Beta" (cdar "Lst") (cdr "Alpha")) )
|
||||
(when (> (car "Alpha") (car "*Val"))
|
||||
(setq "Alpha" "*Val") )
|
||||
(NIL (setq "Lst" (cdr "Lst")) "Alpha") ) ) ) ) ) )
|
||||
|
||||
|
||||
### Grids ###
|
||||
(de grid (DX DY FX FY)
|
||||
(let Grid
|
||||
(make
|
||||
(for X DX
|
||||
(link
|
||||
(make
|
||||
(for Y DY
|
||||
(set
|
||||
(link
|
||||
(if (> DX 26)
|
||||
(box)
|
||||
(intern (pack (char (+ X 96)) Y)) ) )
|
||||
(cons (cons) (cons)) ) ) ) ) ) )
|
||||
(let West (and FX (last Grid))
|
||||
(for (Lst Grid Lst)
|
||||
(let
|
||||
(Col (pop 'Lst)
|
||||
East (or (car Lst) (and FX (car Grid)))
|
||||
South (and FY (last Col)) )
|
||||
(for (L Col L)
|
||||
(with (pop 'L)
|
||||
(set (: 0 1) (pop 'West)) # west
|
||||
(con (: 0 1) (pop 'East)) # east
|
||||
(set (: 0 -1) South) # south
|
||||
(con (: 0 -1) # north
|
||||
(or (car L) (and FY (car Col))) )
|
||||
(setq South This) ) )
|
||||
(setq West Col) ) ) )
|
||||
Grid ) )
|
||||
|
||||
(de west (This)
|
||||
(: 0 1 1) )
|
||||
|
||||
(de east (This)
|
||||
(: 0 1 -1) )
|
||||
|
||||
(de south (This)
|
||||
(: 0 -1 1) )
|
||||
|
||||
(de north (This)
|
||||
(: 0 -1 -1) )
|
||||
|
||||
(de disp ("Grid" "How" "Fun" "X" "Y" "DX" "DY")
|
||||
(setq "Grid"
|
||||
(if "X"
|
||||
(mapcar
|
||||
'((L) (flip (head "DY" (nth L "Y"))))
|
||||
(head "DX" (nth "Grid" "X")) )
|
||||
(mapcar reverse "Grid") ) )
|
||||
(let (N (+ (length (cdar "Grid")) (or "Y" 1)) Sp (length N))
|
||||
("border" north)
|
||||
(while (caar "Grid")
|
||||
(prin " " (align Sp N) " "
|
||||
(and "How" (if (and (nT "How") (west (caar "Grid"))) " " '|)) )
|
||||
(for L "Grid"
|
||||
(prin
|
||||
("Fun" (car L))
|
||||
(and "How" (if (and (nT "How") (east (car L))) " " '|)) ) )
|
||||
(prinl)
|
||||
("border" south)
|
||||
(map pop "Grid")
|
||||
(dec 'N) )
|
||||
(unless (> (default "X" 1) 26)
|
||||
(space (inc Sp))
|
||||
(for @ "Grid"
|
||||
(prin " " (and "How" " ") (char (+ 96 "X")))
|
||||
(T (> (inc '"X") 26)) )
|
||||
(prinl) ) ) )
|
||||
|
||||
(de "border" (Dir)
|
||||
(when "How"
|
||||
(space Sp)
|
||||
(prin " +")
|
||||
(for L "Grid"
|
||||
(prin (if (and (nT "How") (Dir (car L))) " +" "---+")) )
|
||||
(prinl) ) )
|
||||
83
samples/Python/gen-py-linguist-thrift.py
Normal file
83
samples/Python/gen-py-linguist-thrift.py
Normal file
@@ -0,0 +1,83 @@
|
||||
#
|
||||
# Autogenerated by Thrift Compiler (1.0.0-dev)
|
||||
#
|
||||
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
#
|
||||
# options string: py
|
||||
#
|
||||
|
||||
from thrift.Thrift import TType, TMessageType, TException, TApplicationException
|
||||
|
||||
from thrift.transport import TTransport
|
||||
from thrift.protocol import TBinaryProtocol, TProtocol
|
||||
try:
|
||||
from thrift.protocol import fastbinary
|
||||
except:
|
||||
fastbinary = None
|
||||
|
||||
|
||||
|
||||
class PullRequest:
|
||||
"""
|
||||
Attributes:
|
||||
- title
|
||||
"""
|
||||
|
||||
thrift_spec = (
|
||||
None, # 0
|
||||
(1, TType.STRING, 'title', None, None, ), # 1
|
||||
)
|
||||
|
||||
def __init__(self, title=None,):
|
||||
self.title = title
|
||||
|
||||
def read(self, iprot):
|
||||
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
|
||||
fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
|
||||
return
|
||||
iprot.readStructBegin()
|
||||
while True:
|
||||
(fname, ftype, fid) = iprot.readFieldBegin()
|
||||
if ftype == TType.STOP:
|
||||
break
|
||||
if fid == 1:
|
||||
if ftype == TType.STRING:
|
||||
self.title = iprot.readString()
|
||||
else:
|
||||
iprot.skip(ftype)
|
||||
else:
|
||||
iprot.skip(ftype)
|
||||
iprot.readFieldEnd()
|
||||
iprot.readStructEnd()
|
||||
|
||||
def write(self, oprot):
|
||||
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
|
||||
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
|
||||
return
|
||||
oprot.writeStructBegin('PullRequest')
|
||||
if self.title is not None:
|
||||
oprot.writeFieldBegin('title', TType.STRING, 1)
|
||||
oprot.writeString(self.title)
|
||||
oprot.writeFieldEnd()
|
||||
oprot.writeFieldStop()
|
||||
oprot.writeStructEnd()
|
||||
|
||||
def validate(self):
|
||||
return
|
||||
|
||||
|
||||
def __hash__(self):
|
||||
value = 17
|
||||
value = (value * 31) ^ hash(self.title)
|
||||
return value
|
||||
|
||||
def __repr__(self):
|
||||
L = ['%s=%r' % (key, value)
|
||||
for key, value in self.__dict__.iteritems()]
|
||||
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
|
||||
|
||||
def __eq__(self, other):
|
||||
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
|
||||
|
||||
def __ne__(self, other):
|
||||
return not (self == other)
|
||||
155
samples/QML/common.qbs
Normal file
155
samples/QML/common.qbs
Normal file
@@ -0,0 +1,155 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2015 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing
|
||||
**
|
||||
** This file is part of the Qt Build Suite.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms and
|
||||
** conditions see http://www.qt.io/terms-conditions. For further information
|
||||
** use the contact form at http://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 or version 3 as published by the Free
|
||||
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
||||
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
||||
** following information to ensure the GNU Lesser General Public License
|
||||
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, The Qt Company gives you certain additional
|
||||
** rights. These rights are described in The Qt Company LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import qbs 1.0
|
||||
import qbs.FileInfo
|
||||
import qbs.ModUtils
|
||||
|
||||
Module {
|
||||
property string buildVariant: "debug"
|
||||
property bool enableDebugCode: buildVariant == "debug"
|
||||
property bool debugInformation: (buildVariant == "debug")
|
||||
property string optimization: (buildVariant == "debug" ? "none" : "fast")
|
||||
readonly property stringList hostOS: undefined // set internally
|
||||
property string hostOSVersion: {
|
||||
if (hostOS && hostOS.contains("osx")) {
|
||||
return getNativeSetting("/System/Library/CoreServices/ServerVersion.plist", "ProductVersion") ||
|
||||
getNativeSetting("/System/Library/CoreServices/SystemVersion.plist", "ProductVersion");
|
||||
} else if (hostOS && hostOS.contains("windows")) {
|
||||
var version = getNativeSetting("HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion", "CurrentVersion");
|
||||
return version + "." + hostOSBuildVersion;
|
||||
}
|
||||
}
|
||||
|
||||
property string hostOSBuildVersion: {
|
||||
if (hostOS.contains("osx")) {
|
||||
return getNativeSetting("/System/Library/CoreServices/ServerVersion.plist", "ProductBuildVersion") ||
|
||||
getNativeSetting("/System/Library/CoreServices/SystemVersion.plist", "ProductBuildVersion");
|
||||
} else if (hostOS.contains("windows")) {
|
||||
return getNativeSetting("HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion", "CurrentBuildNumber");
|
||||
}
|
||||
}
|
||||
|
||||
readonly property var hostOSVersionParts: hostOSVersion ? hostOSVersion.split('.').map(function(item) { return parseInt(item, 10); }) : []
|
||||
readonly property int hostOSVersionMajor: hostOSVersionParts[0] || 0
|
||||
readonly property int hostOSVersionMinor: hostOSVersionParts[1] || 0
|
||||
readonly property int hostOSVersionPatch: hostOSVersionParts[2] || 0
|
||||
|
||||
property stringList targetOS: hostOS
|
||||
property string pathListSeparator: hostOS.contains("windows") ? ";" : ":"
|
||||
property string pathSeparator: hostOS.contains("windows") ? "\\" : "/"
|
||||
property string profile
|
||||
property stringList toolchain
|
||||
property string architecture
|
||||
property bool install: false
|
||||
property string installSourceBase
|
||||
readonly property string installRoot: undefined
|
||||
property string installDir
|
||||
property string installPrefix: ""
|
||||
property path sysroot
|
||||
|
||||
PropertyOptions {
|
||||
name: "buildVariant"
|
||||
allowedValues: ['debug', 'release']
|
||||
description: "name of the build variant"
|
||||
}
|
||||
|
||||
PropertyOptions {
|
||||
name: "optimization"
|
||||
allowedValues: ['none', 'fast', 'small']
|
||||
description: "optimization level"
|
||||
}
|
||||
|
||||
validate: {
|
||||
var validator = new ModUtils.PropertyValidator("qbs");
|
||||
validator.setRequiredProperty("architecture", architecture,
|
||||
"you might want to re-run 'qbs-setup-toolchains'");
|
||||
validator.setRequiredProperty("hostOS", hostOS);
|
||||
validator.setRequiredProperty("targetOS", targetOS);
|
||||
if (hostOS && (hostOS.contains("windows") || hostOS.contains("osx"))) {
|
||||
validator.setRequiredProperty("hostOSVersion", hostOSVersion,
|
||||
"could not detect host operating system version; " +
|
||||
"verify that system files and registry keys have not " +
|
||||
"been modified.");
|
||||
if (hostOSVersion)
|
||||
validator.addVersionValidator("hostOSVersion", hostOSVersion, 2, 4);
|
||||
|
||||
validator.setRequiredProperty("hostOSBuildVersion", hostOSBuildVersion,
|
||||
"could not detect host operating system build version; " +
|
||||
"verify that system files or registry have not been " +
|
||||
"tampered with.");
|
||||
}
|
||||
|
||||
validator.addCustomValidator("architecture", architecture, function (value) {
|
||||
return architecture === canonicalArchitecture(architecture);
|
||||
}, "'" + architecture + "' is invalid. You must use the canonical name '" +
|
||||
canonicalArchitecture(architecture) + "'");
|
||||
|
||||
validator.validate();
|
||||
}
|
||||
|
||||
// private properties
|
||||
property var commonRunEnvironment: {
|
||||
var env = {};
|
||||
if (targetOS.contains("windows")) {
|
||||
env["PATH"] = [
|
||||
FileInfo.joinPaths(installRoot, installPrefix)
|
||||
];
|
||||
} else if (hostOS.contains("darwin") && targetOS.contains("darwin")) {
|
||||
env["DYLD_FRAMEWORK_PATH"] = [
|
||||
FileInfo.joinPaths(installRoot, installPrefix, "Library", "Frameworks"),
|
||||
FileInfo.joinPaths(installRoot, installPrefix, "lib"),
|
||||
FileInfo.joinPaths(installRoot, installPrefix)
|
||||
].join(pathListSeparator);
|
||||
|
||||
env["DYLD_LIBRARY_PATH"] = [
|
||||
FileInfo.joinPaths(installRoot, installPrefix, "lib"),
|
||||
FileInfo.joinPaths(installRoot, installPrefix, "Library", "Frameworks"),
|
||||
FileInfo.joinPaths(installRoot, installPrefix)
|
||||
].join(pathListSeparator);
|
||||
|
||||
if (targetOS.contains("ios-simulator") && sysroot) {
|
||||
env["DYLD_ROOT_PATH"] = [sysroot];
|
||||
}
|
||||
} else if (hostOS.contains("unix") && targetOS.contains("unix")) {
|
||||
env["LD_LIBRARY_PATH"] = [
|
||||
FileInfo.joinPaths(installRoot, installPrefix, "lib")
|
||||
];
|
||||
}
|
||||
|
||||
return env;
|
||||
}
|
||||
|
||||
// internal properties
|
||||
readonly property string version: [versionMajor, versionMinor, versionPatch].join(".")
|
||||
readonly property int versionMajor: undefined // set internally
|
||||
readonly property int versionMinor: undefined // set internally
|
||||
readonly property int versionPatch: undefined // set internally
|
||||
}
|
||||
50
samples/Ruby/filenames/Deliverfile
Normal file
50
samples/Ruby/filenames/Deliverfile
Normal file
@@ -0,0 +1,50 @@
|
||||
require 'open-uri'
|
||||
|
||||
framework_version = JSON.parse(open(url).read)
|
||||
|
||||
# The URL below is password protected
|
||||
apps = JSON.parse(open(url).read)
|
||||
|
||||
app_id = Dir.pwd.split("/")[-2].to_i
|
||||
app = apps[app_id.to_s]
|
||||
|
||||
# The app identifier is required
|
||||
app_identifier "net.sunapps.#{app_id}"
|
||||
|
||||
version framework_version['version_number']
|
||||
|
||||
title(
|
||||
'de-DE' => app["fullName"]
|
||||
)
|
||||
|
||||
description(
|
||||
'de-DE' => app["description"]["de"]
|
||||
)
|
||||
|
||||
changelog(
|
||||
'de-DE' => framework_version["public_description"]["de"]
|
||||
)
|
||||
|
||||
keywords(
|
||||
'de-DE' => app["keywords"]["de"].split(",")
|
||||
)
|
||||
|
||||
app_icon "../Submission/AppIconFull.png"
|
||||
|
||||
price_tier 0 # free app
|
||||
|
||||
primary_category "Reference"
|
||||
|
||||
secondary_category "Business"
|
||||
|
||||
automatic_release true
|
||||
|
||||
ratings_config_path "./ratings_config.json"
|
||||
|
||||
app_review_information({
|
||||
first_name: "Felix",
|
||||
phone_number: "My Phone Number",
|
||||
demo_user: "",
|
||||
demo_password: "",
|
||||
notes: ""
|
||||
})
|
||||
115
samples/Ruby/filenames/Fastfile
Normal file
115
samples/Ruby/filenames/Fastfile
Normal file
@@ -0,0 +1,115 @@
|
||||
# Customise this file, documentation can be found here:
|
||||
# https://github.com/KrauseFx/fastlane/tree/master/docs
|
||||
|
||||
$:.unshift File.dirname(__FILE__)
|
||||
require 'lib/utils.rb'
|
||||
|
||||
fastlane_version "1.0.0"
|
||||
|
||||
default_platform :ios
|
||||
|
||||
platform :ios do
|
||||
before_all do
|
||||
ENV['DELIVER_WHAT_TO_TEST'] = git_commit_log
|
||||
ensure_git_status_clean
|
||||
end
|
||||
|
||||
desc "Runs linting (and eventually static analysis)"
|
||||
lane :analyze do
|
||||
return if test_disabled?
|
||||
make 'lint'
|
||||
end
|
||||
|
||||
desc "Runs all the unit tests."
|
||||
lane :test do
|
||||
return if test_disabled?
|
||||
# TODO: lint & test JS code
|
||||
xctest(
|
||||
scheme: 'Wikipedia',
|
||||
destination: "platform=iOS Simulator,name=iPhone 6,OS=8.3",
|
||||
reports: [
|
||||
{
|
||||
report: "html",
|
||||
output: "build/reports/unit-tests.html"
|
||||
},
|
||||
{
|
||||
report: "junit",
|
||||
output: "build/reports/unit-tests.xml"
|
||||
}
|
||||
],
|
||||
clean: nil
|
||||
)
|
||||
end
|
||||
|
||||
desc "Bump the version, and submit a new **Wikipedia Alpha** Build to Apple TestFlight"
|
||||
lane :alpha do
|
||||
# snapshot
|
||||
sigh
|
||||
increment_build_number
|
||||
|
||||
# uncomment when CI is able to push tags
|
||||
if ENV['WMF_BUMP']
|
||||
commit_version_bump
|
||||
plist_version = get_version_short_string File.expand_path(File.join(ENV['PWD'], 'Wikipedia/Wikipedia-Info.plist'))
|
||||
# tag must be added after the version bump is committed
|
||||
add_git_tag(tag: "#{plist_version}.#{Actions.lane_context[Actions::SharedValues::BUILD_NUMBER]}")
|
||||
end
|
||||
|
||||
ipa(
|
||||
configuration: "Alpha",
|
||||
scheme: "Wikipedia Alpha",
|
||||
)
|
||||
hockey(
|
||||
notes: '',
|
||||
notify: '0', # Means do not notify
|
||||
status: '1', # Means do not make available for download
|
||||
)
|
||||
deliver skip_deploy: true, beta: true
|
||||
|
||||
# uncomment when CI is able to push tags
|
||||
if ENV['WMF_BUMP']
|
||||
# only push after everything else has succeeded
|
||||
push_to_git_remote
|
||||
end
|
||||
end
|
||||
|
||||
desc "Submit a new **Wikipedia Beta** build to Apple TestFlight"
|
||||
lane :beta do
|
||||
# snapshot
|
||||
sigh
|
||||
ipa(
|
||||
configuration: "Beta",
|
||||
scheme: "Wikipedia Beta",
|
||||
)
|
||||
hockey(
|
||||
notes: '',
|
||||
notify: '0', # Means do not notify
|
||||
status: '1', # Means do not make available for download
|
||||
)
|
||||
deliver skip_deploy: true, beta: true
|
||||
end
|
||||
|
||||
desc "Deploy a new version to the App Store"
|
||||
lane :store do
|
||||
# snapshot
|
||||
sigh
|
||||
ipa(
|
||||
configuration: "Wikipedia",
|
||||
scheme: "Wikipedia",
|
||||
)
|
||||
hockey(
|
||||
notes: '',
|
||||
notify: '0', # Means do not notify
|
||||
status: '1', # Means do not make available for download
|
||||
)
|
||||
deliver skip_deploy: true, force: true
|
||||
end
|
||||
|
||||
after_all do |lane|
|
||||
|
||||
end
|
||||
|
||||
error do |lane, exception|
|
||||
|
||||
end
|
||||
end
|
||||
18
samples/Ruby/filenames/Podfile
Normal file
18
samples/Ruby/filenames/Podfile
Normal file
@@ -0,0 +1,18 @@
|
||||
source 'https://github.com/CocoaPods/Specs.git'
|
||||
|
||||
platform :ios, :deployment_target => '6.0'
|
||||
|
||||
inhibit_all_warnings!
|
||||
|
||||
xcodeproj 'Wikipedia'
|
||||
|
||||
pod 'AFNetworking/NSURLConnection', '~> 2.5'
|
||||
pod 'hpple', '~> 0.2'
|
||||
pod 'blockskit/Core', '~> 2.2'
|
||||
pod 'Masonry', '~> 0.6'
|
||||
pod 'HockeySDK', '3.6.2'
|
||||
|
||||
target 'WikipediaUnitTests', :exclusive => false do
|
||||
pod 'OCMockito', '~> 1.4'
|
||||
pod 'OCHamcrest', '~> 4.1'
|
||||
end
|
||||
26
samples/Ruby/filenames/Snapfile
Normal file
26
samples/Ruby/filenames/Snapfile
Normal file
@@ -0,0 +1,26 @@
|
||||
|
||||
# Download the latest screenshot information from the CMS
|
||||
app_id = Dir.pwd.split("/")[-2].to_i
|
||||
File.write("./screenshots.json", open("https://...amazonaws.com/1.0/#{app_id}/....json").read) rescue nil
|
||||
|
||||
|
||||
# A list of devices you want to take the screenshots from
|
||||
devices([
|
||||
"iPhone 6",
|
||||
"iPhone 6 Plus",
|
||||
"iPhone 5",
|
||||
"iPhone 4s"
|
||||
])
|
||||
|
||||
languages([
|
||||
'de-DE'
|
||||
])
|
||||
|
||||
# Where should the resulting screenshots be stored?
|
||||
screenshots_path "./screenshots"
|
||||
|
||||
# JavaScript UIAutomation file
|
||||
js_file './snapshot.js'
|
||||
|
||||
# The name of the project's scheme
|
||||
scheme 'Release'
|
||||
9
samples/Ruby/gen-rb-linguist-thrift.rb
Normal file
9
samples/Ruby/gen-rb-linguist-thrift.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
#
|
||||
# Autogenerated by Thrift Compiler (1.0.0-dev)
|
||||
#
|
||||
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
#
|
||||
|
||||
require 'thrift'
|
||||
require 'linguist_types'
|
||||
|
||||
4
samples/Ruby/rexpl
Executable file
4
samples/Ruby/rexpl
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env rbx
|
||||
$: << 'lib'
|
||||
require 'rexpl'
|
||||
Rexpl::Environment.run
|
||||
11
samples/Ruby/shoes-swt
Executable file
11
samples/Ruby/shoes-swt
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env jruby
|
||||
lib_directory = File.expand_path('../../lib', __FILE__)
|
||||
$LOAD_PATH << lib_directory
|
||||
|
||||
if File.exist?("Gemfile")
|
||||
require "bundler/setup"
|
||||
Bundler.require
|
||||
end
|
||||
|
||||
require 'shoes/ui/cli'
|
||||
Shoes::CLI.new("swt").run ARGV
|
||||
20
samples/SMT/bignum_lia1.smt2
Normal file
20
samples/SMT/bignum_lia1.smt2
Normal file
@@ -0,0 +1,20 @@
|
||||
(set-logic QF_LIA)
|
||||
(set-info :source | SMT-COMP'06 organizers |)
|
||||
(set-info :smt-lib-version 2.0)
|
||||
(set-info :category "check")
|
||||
(set-info :status unsat)
|
||||
(set-info :notes |This benchmark is designed to check if the DP supports bignumbers.|)
|
||||
(declare-fun x1 () Int)
|
||||
(declare-fun x2 () Int)
|
||||
(declare-fun x3 () Int)
|
||||
(declare-fun x4 () Int)
|
||||
(declare-fun x5 () Int)
|
||||
(declare-fun x6 () Int)
|
||||
(assert (and (or (>= x1 1000) (>= x1 1002))
|
||||
(or (>= x2 (* 1230 x1)) (>= x2 (* 1003 x1)))
|
||||
(or (>= x3 (* 1310 x2)) (>= x3 (* 1999 x2)))
|
||||
(or (>= x4 (* 4000 x3)) (>= x4 (* 8000 x3)))
|
||||
(or (<= x5 (* (- 4000) x4)) (<= x5 (* (- 8000) x4)))
|
||||
(or (>= x6 (* (- 3) x5)) (>= x6 (* (- 2) x5))) (< x6 0)))
|
||||
(check-sat)
|
||||
(exit)
|
||||
20
samples/SMT/list4.smt2
Normal file
20
samples/SMT/list4.smt2
Normal file
@@ -0,0 +1,20 @@
|
||||
(set-logic AUFLIRA)
|
||||
(set-info :source | Buggy list theorem |)
|
||||
(set-info :smt-lib-version 2.0)
|
||||
(set-info :category "crafted")
|
||||
(set-info :status sat)
|
||||
(declare-sort List 0)
|
||||
(declare-fun cons (Real List) List)
|
||||
(declare-fun nil () List)
|
||||
(declare-fun car (List) Real)
|
||||
(declare-fun cdr (List) List)
|
||||
(declare-fun len (List) Int)
|
||||
(assert (forall ((?x Real) (?y List)) (= (car (cons ?x ?y)) ?x)))
|
||||
(assert (forall ((?x Real) (?y List)) (= (cdr (cons ?x ?y)) ?y)))
|
||||
(assert (= (len nil) 0))
|
||||
(assert (forall ((?x Real) (?y List)) (= (len (cons ?x ?y)) (+ (len ?y) 1))))
|
||||
(declare-fun append (List List) List)
|
||||
(assert (forall ((?x Real) (?y1 List) (?y2 List)) (= (append (cons ?x ?y1) ?y2) (cons ?x (append ?y1 ?y2)))))
|
||||
(assert (not (forall ((?x Real) (?y List)) (= (append (cons ?x nil) ?y) (cons ?x ?y)))))
|
||||
(check-sat)
|
||||
(exit)
|
||||
123
samples/SMT/queen10-1.smt2
Normal file
123
samples/SMT/queen10-1.smt2
Normal file
@@ -0,0 +1,123 @@
|
||||
(set-logic QF_IDL)
|
||||
(set-info :source |
|
||||
Queens benchmarks generated by Hyondeuk Kim in SMT-LIB format.
|
||||
|)
|
||||
(set-info :smt-lib-version 2.0)
|
||||
(set-info :category "crafted")
|
||||
(set-info :status sat)
|
||||
(declare-fun x0 () Int)
|
||||
(declare-fun x1 () Int)
|
||||
(declare-fun x2 () Int)
|
||||
(declare-fun x3 () Int)
|
||||
(declare-fun x4 () Int)
|
||||
(declare-fun x5 () Int)
|
||||
(declare-fun x6 () Int)
|
||||
(declare-fun x7 () Int)
|
||||
(declare-fun x8 () Int)
|
||||
(declare-fun x9 () Int)
|
||||
(declare-fun x10 () Int)
|
||||
(assert
|
||||
(let
|
||||
((?v_0 (- x0 x10))
|
||||
(?v_1 (- x1 x10))
|
||||
(?v_2 (- x2 x10))
|
||||
(?v_3 (- x3 x10))
|
||||
(?v_4 (- x4 x10))
|
||||
(?v_5 (- x5 x10))
|
||||
(?v_6 (- x6 x10))
|
||||
(?v_7 (- x7 x10))
|
||||
(?v_8 (- x8 x10))
|
||||
(?v_9 (- x9 x10))
|
||||
(?v_10 (- x0 x1))
|
||||
(?v_11 (- x0 x2))
|
||||
(?v_12 (- x0 x3))
|
||||
(?v_13 (- x0 x4))
|
||||
(?v_14 (- x0 x5))
|
||||
(?v_15 (- x0 x6))
|
||||
(?v_16 (- x0 x7))
|
||||
(?v_17 (- x0 x8))
|
||||
(?v_18 (- x0 x9))
|
||||
(?v_19 (- x1 x2))
|
||||
(?v_20 (- x1 x3))
|
||||
(?v_21 (- x1 x4))
|
||||
(?v_22 (- x1 x5))
|
||||
(?v_23 (- x1 x6))
|
||||
(?v_24 (- x1 x7))
|
||||
(?v_25 (- x1 x8))
|
||||
(?v_26 (- x1 x9))
|
||||
(?v_27 (- x2 x3))
|
||||
(?v_28 (- x2 x4))
|
||||
(?v_29 (- x2 x5))
|
||||
(?v_30 (- x2 x6))
|
||||
(?v_31 (- x2 x7))
|
||||
(?v_32 (- x2 x8))
|
||||
(?v_33 (- x2 x9))
|
||||
(?v_34 (- x3 x4))
|
||||
(?v_35 (- x3 x5))
|
||||
(?v_36 (- x3 x6))
|
||||
(?v_37 (- x3 x7))
|
||||
(?v_38 (- x3 x8))
|
||||
(?v_39 (- x3 x9))
|
||||
(?v_40 (- x4 x5))
|
||||
(?v_41 (- x4 x6))
|
||||
(?v_42 (- x4 x7))
|
||||
(?v_43 (- x4 x8))
|
||||
(?v_44 (- x4 x9))
|
||||
(?v_45 (- x5 x6))
|
||||
(?v_46 (- x5 x7))
|
||||
(?v_47 (- x5 x8))
|
||||
(?v_48 (- x5 x9))
|
||||
(?v_49 (- x6 x7))
|
||||
(?v_50 (- x6 x8))
|
||||
(?v_51 (- x6 x9))
|
||||
(?v_52 (- x7 x8))
|
||||
(?v_53 (- x7 x9))
|
||||
(?v_54 (- x8 x9)))
|
||||
(and (<= ?v_0 9) (>= ?v_0 0) (<= ?v_1 9) (>= ?v_1 0) (<= ?v_2 9) (>= ?v_2 0)
|
||||
(<= ?v_3 9) (>= ?v_3 0) (<= ?v_4 9) (>= ?v_4 0) (<= ?v_5 9) (>= ?v_5 0)
|
||||
(<= ?v_6 9) (>= ?v_6 0) (<= ?v_7 9) (>= ?v_7 0) (<= ?v_8 9) (>= ?v_8 0)
|
||||
(<= ?v_9 9) (>= ?v_9 0)
|
||||
(not (= x0 x1)) (not (= x0 x2)) (not (= x0 x3)) (not (= x0 x4))
|
||||
(not (= x0 x5)) (not (= x0 x6)) (not (= x0 x7)) (not (= x0 x8))
|
||||
(not (= x0 x9)) (not (= x1 x2)) (not (= x1 x3)) (not (= x1 x4))
|
||||
(not (= x1 x5)) (not (= x1 x6)) (not (= x1 x7)) (not (= x1 x8))
|
||||
(not (= x1 x9)) (not (= x2 x3)) (not (= x2 x4)) (not (= x2 x5))
|
||||
(not (= x2 x6)) (not (= x2 x7)) (not (= x2 x8)) (not (= x2 x9))
|
||||
(not (= x3 x4)) (not (= x3 x5)) (not (= x3 x6)) (not (= x3 x7))
|
||||
(not (= x3 x8)) (not (= x3 x9)) (not (= x4 x5)) (not (= x4 x6))
|
||||
(not (= x4 x7)) (not (= x4 x8)) (not (= x4 x9)) (not (= x5 x6))
|
||||
(not (= x5 x7)) (not (= x5 x8)) (not (= x5 x9)) (not (= x6 x7))
|
||||
(not (= x6 x8)) (not (= x6 x9)) (not (= x7 x8)) (not (= x7 x9))
|
||||
(not (= x8 x9))
|
||||
(not (= ?v_10 1)) (not (= ?v_10 (- 1))) (not (= ?v_11 2))
|
||||
(not (= ?v_11 (- 2))) (not (= ?v_12 3)) (not (= ?v_12 (- 3)))
|
||||
(not (= ?v_13 4)) (not (= ?v_13 (- 4))) (not (= ?v_14 5))
|
||||
(not (= ?v_14 (- 5))) (not (= ?v_15 6)) (not (= ?v_15 (- 6)))
|
||||
(not (= ?v_16 7)) (not (= ?v_16 (- 7))) (not (= ?v_17 8))
|
||||
(not (= ?v_17 (- 8))) (not (= ?v_18 9)) (not (= ?v_18 (- 9)))
|
||||
(not (= ?v_19 1)) (not (= ?v_19 (- 1))) (not (= ?v_20 2))
|
||||
(not (= ?v_20 (- 2))) (not (= ?v_21 3)) (not (= ?v_21 (- 3)))
|
||||
(not (= ?v_22 4)) (not (= ?v_22 (- 4))) (not (= ?v_23 5))
|
||||
(not (= ?v_23 (- 5))) (not (= ?v_24 6)) (not (= ?v_24 (- 6)))
|
||||
(not (= ?v_25 7)) (not (= ?v_25 (- 7))) (not (= ?v_26 8))
|
||||
(not (= ?v_26 (- 8))) (not (= ?v_27 1)) (not (= ?v_27 (- 1)))
|
||||
(not (= ?v_28 2)) (not (= ?v_28 (- 2))) (not (= ?v_29 3))
|
||||
(not (= ?v_29 (- 3))) (not (= ?v_30 4)) (not (= ?v_30 (- 4)))
|
||||
(not (= ?v_31 5)) (not (= ?v_31 (- 5))) (not (= ?v_32 6))
|
||||
(not (= ?v_32 (- 6))) (not (= ?v_33 7)) (not (= ?v_33 (- 7)))
|
||||
(not (= ?v_34 1)) (not (= ?v_34 (- 1))) (not (= ?v_35 2))
|
||||
(not (= ?v_35 (- 2))) (not (= ?v_36 3)) (not (= ?v_36 (- 3)))
|
||||
(not (= ?v_37 4)) (not (= ?v_37 (- 4))) (not (= ?v_38 5))
|
||||
(not (= ?v_38 (- 5))) (not (= ?v_39 6)) (not (= ?v_39 (- 6)))
|
||||
(not (= ?v_40 1)) (not (= ?v_40 (- 1))) (not (= ?v_41 2))
|
||||
(not (= ?v_41 (- 2))) (not (= ?v_42 3)) (not (= ?v_42 (- 3)))
|
||||
(not (= ?v_43 4)) (not (= ?v_43 (- 4))) (not (= ?v_44 5))
|
||||
(not (= ?v_44 (- 5))) (not (= ?v_45 1)) (not (= ?v_45 (- 1)))
|
||||
(not (= ?v_46 2)) (not (= ?v_46 (- 2))) (not (= ?v_47 3))
|
||||
(not (= ?v_47 (- 3))) (not (= ?v_48 4)) (not (= ?v_48 (- 4)))
|
||||
(not (= ?v_49 1)) (not (= ?v_49 (- 1))) (not (= ?v_50 2))
|
||||
(not (= ?v_50 (- 2))) (not (= ?v_51 3)) (not (= ?v_51 (- 3)))
|
||||
(not (= ?v_52 1)) (not (= ?v_52 (- 1))) (not (= ?v_53 2))
|
||||
(not (= ?v_53 (- 2))) (not (= ?v_54 1)) (not (= ?v_54 (- 1))))))
|
||||
(check-sat)
|
||||
(exit)
|
||||
2104
samples/SMT/shufflevector.smt
Normal file
2104
samples/SMT/shufflevector.smt
Normal file
File diff suppressed because it is too large
Load Diff
551
samples/Smali/ActionBarDrawerToggle.smali
Normal file
551
samples/Smali/ActionBarDrawerToggle.smali
Normal file
@@ -0,0 +1,551 @@
|
||||
.class public Landroid/support/v4/app/ActionBarDrawerToggle;
|
||||
.super Ljava/lang/Object;
|
||||
.source "ActionBarDrawerToggle.java"
|
||||
|
||||
# interfaces
|
||||
.implements Landroid/support/v4/widget/DrawerLayout$DrawerListener;
|
||||
|
||||
|
||||
# annotations
|
||||
.annotation system Ldalvik/annotation/MemberClasses;
|
||||
value = {
|
||||
Landroid/support/v4/app/ActionBarDrawerToggle$1;,
|
||||
Landroid/support/v4/app/ActionBarDrawerToggle$SlideDrawable;,
|
||||
Landroid/support/v4/app/ActionBarDrawerToggle$ActionBarDrawerToggleImplHC;,
|
||||
Landroid/support/v4/app/ActionBarDrawerToggle$ActionBarDrawerToggleImplBase;,
|
||||
Landroid/support/v4/app/ActionBarDrawerToggle$ActionBarDrawerToggleImpl;
|
||||
}
|
||||
.end annotation
|
||||
|
||||
|
||||
# static fields
|
||||
.field private static final ID_HOME:I = 0x102002c
|
||||
|
||||
.field private static final IMPL:Landroid/support/v4/app/ActionBarDrawerToggle$ActionBarDrawerToggleImpl;
|
||||
|
||||
|
||||
# instance fields
|
||||
.field private final mActivity:Landroid/app/Activity;
|
||||
|
||||
.field private final mCloseDrawerContentDescRes:I
|
||||
|
||||
.field private mDrawerImage:Landroid/graphics/drawable/Drawable;
|
||||
|
||||
.field private final mDrawerImageResource:I
|
||||
|
||||
.field private mDrawerIndicatorEnabled:Z
|
||||
|
||||
.field private final mDrawerLayout:Landroid/support/v4/widget/DrawerLayout;
|
||||
|
||||
.field private final mOpenDrawerContentDescRes:I
|
||||
|
||||
.field private mSetIndicatorInfo:Ljava/lang/Object;
|
||||
|
||||
.field private mSlider:Landroid/support/v4/app/ActionBarDrawerToggle$SlideDrawable;
|
||||
|
||||
.field private mThemeImage:Landroid/graphics/drawable/Drawable;
|
||||
|
||||
|
||||
# direct methods
|
||||
.method static constructor <clinit>()V
|
||||
.registers 3
|
||||
|
||||
.prologue
|
||||
const/4 v2, 0x0
|
||||
|
||||
.line 108
|
||||
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
||||
|
||||
.line 109
|
||||
.local v0, "version":I
|
||||
const/16 v1, 0xb
|
||||
|
||||
if-lt v0, v1, :cond_f
|
||||
|
||||
.line 110
|
||||
new-instance v1, Landroid/support/v4/app/ActionBarDrawerToggle$ActionBarDrawerToggleImplHC;
|
||||
|
||||
invoke-direct {v1, v2}, Landroid/support/v4/app/ActionBarDrawerToggle$ActionBarDrawerToggleImplHC;-><init>(Landroid/support/v4/app/ActionBarDrawerToggle$1;)V
|
||||
|
||||
sput-object v1, Landroid/support/v4/app/ActionBarDrawerToggle;->IMPL:Landroid/support/v4/app/ActionBarDrawerToggle$ActionBarDrawerToggleImpl;
|
||||
|
||||
.line 114
|
||||
:goto_e
|
||||
return-void
|
||||
|
||||
.line 112
|
||||
:cond_f
|
||||
new-instance v1, Landroid/support/v4/app/ActionBarDrawerToggle$ActionBarDrawerToggleImplBase;
|
||||
|
||||
invoke-direct {v1, v2}, Landroid/support/v4/app/ActionBarDrawerToggle$ActionBarDrawerToggleImplBase;-><init>(Landroid/support/v4/app/ActionBarDrawerToggle$1;)V
|
||||
|
||||
sput-object v1, Landroid/support/v4/app/ActionBarDrawerToggle;->IMPL:Landroid/support/v4/app/ActionBarDrawerToggle$ActionBarDrawerToggleImpl;
|
||||
|
||||
goto :goto_e
|
||||
.end method
|
||||
|
||||
.method public constructor <init>(Landroid/app/Activity;Landroid/support/v4/widget/DrawerLayout;III)V
|
||||
.registers 8
|
||||
.param p1, "activity" # Landroid/app/Activity;
|
||||
.param p2, "drawerLayout" # Landroid/support/v4/widget/DrawerLayout;
|
||||
.param p3, "drawerImageRes" # I
|
||||
.param p4, "openDrawerContentDescRes" # I
|
||||
.param p5, "closeDrawerContentDescRes" # I
|
||||
|
||||
.prologue
|
||||
.line 152
|
||||
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
||||
|
||||
.line 121
|
||||
const/4 v0, 0x1
|
||||
|
||||
iput-boolean v0, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mDrawerIndicatorEnabled:Z
|
||||
|
||||
.line 153
|
||||
iput-object p1, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mActivity:Landroid/app/Activity;
|
||||
|
||||
.line 154
|
||||
iput-object p2, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mDrawerLayout:Landroid/support/v4/widget/DrawerLayout;
|
||||
|
||||
.line 155
|
||||
iput p3, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mDrawerImageResource:I
|
||||
|
||||
.line 156
|
||||
iput p4, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mOpenDrawerContentDescRes:I
|
||||
|
||||
.line 157
|
||||
iput p5, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mCloseDrawerContentDescRes:I
|
||||
|
||||
.line 159
|
||||
sget-object v0, Landroid/support/v4/app/ActionBarDrawerToggle;->IMPL:Landroid/support/v4/app/ActionBarDrawerToggle$ActionBarDrawerToggleImpl;
|
||||
|
||||
invoke-interface {v0, p1}, Landroid/support/v4/app/ActionBarDrawerToggle$ActionBarDrawerToggleImpl;->getThemeUpIndicator(Landroid/app/Activity;)Landroid/graphics/drawable/Drawable;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
iput-object v0, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mThemeImage:Landroid/graphics/drawable/Drawable;
|
||||
|
||||
.line 160
|
||||
invoke-virtual {p1}, Landroid/app/Activity;->getResources()Landroid/content/res/Resources;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
invoke-virtual {v0, p3}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
iput-object v0, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mDrawerImage:Landroid/graphics/drawable/Drawable;
|
||||
|
||||
.line 161
|
||||
new-instance v0, Landroid/support/v4/app/ActionBarDrawerToggle$SlideDrawable;
|
||||
|
||||
iget-object v1, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mDrawerImage:Landroid/graphics/drawable/Drawable;
|
||||
|
||||
invoke-direct {v0, v1}, Landroid/support/v4/app/ActionBarDrawerToggle$SlideDrawable;-><init>(Landroid/graphics/drawable/Drawable;)V
|
||||
|
||||
iput-object v0, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mSlider:Landroid/support/v4/app/ActionBarDrawerToggle$SlideDrawable;
|
||||
|
||||
.line 162
|
||||
iget-object v0, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mSlider:Landroid/support/v4/app/ActionBarDrawerToggle$SlideDrawable;
|
||||
|
||||
const v1, 0x3eaaaaab
|
||||
|
||||
invoke-virtual {v0, v1}, Landroid/support/v4/app/ActionBarDrawerToggle$SlideDrawable;->setOffsetBy(F)V
|
||||
|
||||
.line 163
|
||||
return-void
|
||||
.end method
|
||||
|
||||
|
||||
# virtual methods
|
||||
.method public isDrawerIndicatorEnabled()Z
|
||||
.registers 2
|
||||
|
||||
.prologue
|
||||
.line 217
|
||||
iget-boolean v0, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mDrawerIndicatorEnabled:Z
|
||||
|
||||
return v0
|
||||
.end method
|
||||
|
||||
.method public onConfigurationChanged(Landroid/content/res/Configuration;)V
|
||||
.registers 4
|
||||
.param p1, "newConfig" # Landroid/content/res/Configuration;
|
||||
|
||||
.prologue
|
||||
.line 229
|
||||
sget-object v0, Landroid/support/v4/app/ActionBarDrawerToggle;->IMPL:Landroid/support/v4/app/ActionBarDrawerToggle$ActionBarDrawerToggleImpl;
|
||||
|
||||
iget-object v1, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mActivity:Landroid/app/Activity;
|
||||
|
||||
invoke-interface {v0, v1}, Landroid/support/v4/app/ActionBarDrawerToggle$ActionBarDrawerToggleImpl;->getThemeUpIndicator(Landroid/app/Activity;)Landroid/graphics/drawable/Drawable;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
iput-object v0, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mThemeImage:Landroid/graphics/drawable/Drawable;
|
||||
|
||||
.line 230
|
||||
iget-object v0, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mActivity:Landroid/app/Activity;
|
||||
|
||||
invoke-virtual {v0}, Landroid/app/Activity;->getResources()Landroid/content/res/Resources;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
iget v1, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mDrawerImageResource:I
|
||||
|
||||
invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
iput-object v0, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mDrawerImage:Landroid/graphics/drawable/Drawable;
|
||||
|
||||
.line 231
|
||||
invoke-virtual {p0}, Landroid/support/v4/app/ActionBarDrawerToggle;->syncState()V
|
||||
|
||||
.line 232
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method public onDrawerClosed(Landroid/view/View;)V
|
||||
.registers 6
|
||||
.param p1, "drawerView" # Landroid/view/View;
|
||||
|
||||
.prologue
|
||||
.line 298
|
||||
iget-object v0, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mSlider:Landroid/support/v4/app/ActionBarDrawerToggle$SlideDrawable;
|
||||
|
||||
const/4 v1, 0x0
|
||||
|
||||
invoke-virtual {v0, v1}, Landroid/support/v4/app/ActionBarDrawerToggle$SlideDrawable;->setOffset(F)V
|
||||
|
||||
.line 299
|
||||
iget-boolean v0, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mDrawerIndicatorEnabled:Z
|
||||
|
||||
if-eqz v0, :cond_18
|
||||
|
||||
.line 300
|
||||
sget-object v0, Landroid/support/v4/app/ActionBarDrawerToggle;->IMPL:Landroid/support/v4/app/ActionBarDrawerToggle$ActionBarDrawerToggleImpl;
|
||||
|
||||
iget-object v1, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mSetIndicatorInfo:Ljava/lang/Object;
|
||||
|
||||
iget-object v2, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mActivity:Landroid/app/Activity;
|
||||
|
||||
iget v3, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mCloseDrawerContentDescRes:I
|
||||
|
||||
invoke-interface {v0, v1, v2, v3}, Landroid/support/v4/app/ActionBarDrawerToggle$ActionBarDrawerToggleImpl;->setActionBarDescription(Ljava/lang/Object;Landroid/app/Activity;I)Ljava/lang/Object;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
iput-object v0, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mSetIndicatorInfo:Ljava/lang/Object;
|
||||
|
||||
.line 303
|
||||
:cond_18
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method public onDrawerOpened(Landroid/view/View;)V
|
||||
.registers 6
|
||||
.param p1, "drawerView" # Landroid/view/View;
|
||||
|
||||
.prologue
|
||||
.line 282
|
||||
iget-object v0, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mSlider:Landroid/support/v4/app/ActionBarDrawerToggle$SlideDrawable;
|
||||
|
||||
const/high16 v1, 0x3f800000
|
||||
|
||||
invoke-virtual {v0, v1}, Landroid/support/v4/app/ActionBarDrawerToggle$SlideDrawable;->setOffset(F)V
|
||||
|
||||
.line 283
|
||||
iget-boolean v0, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mDrawerIndicatorEnabled:Z
|
||||
|
||||
if-eqz v0, :cond_19
|
||||
|
||||
.line 284
|
||||
sget-object v0, Landroid/support/v4/app/ActionBarDrawerToggle;->IMPL:Landroid/support/v4/app/ActionBarDrawerToggle$ActionBarDrawerToggleImpl;
|
||||
|
||||
iget-object v1, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mSetIndicatorInfo:Ljava/lang/Object;
|
||||
|
||||
iget-object v2, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mActivity:Landroid/app/Activity;
|
||||
|
||||
iget v3, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mOpenDrawerContentDescRes:I
|
||||
|
||||
invoke-interface {v0, v1, v2, v3}, Landroid/support/v4/app/ActionBarDrawerToggle$ActionBarDrawerToggleImpl;->setActionBarDescription(Ljava/lang/Object;Landroid/app/Activity;I)Ljava/lang/Object;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
iput-object v0, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mSetIndicatorInfo:Ljava/lang/Object;
|
||||
|
||||
.line 287
|
||||
:cond_19
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method public onDrawerSlide(Landroid/view/View;F)V
|
||||
.registers 7
|
||||
.param p1, "drawerView" # Landroid/view/View;
|
||||
.param p2, "slideOffset" # F
|
||||
|
||||
.prologue
|
||||
const/high16 v3, 0x40000000
|
||||
|
||||
const/high16 v2, 0x3f000000
|
||||
|
||||
.line 264
|
||||
iget-object v1, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mSlider:Landroid/support/v4/app/ActionBarDrawerToggle$SlideDrawable;
|
||||
|
||||
invoke-virtual {v1}, Landroid/support/v4/app/ActionBarDrawerToggle$SlideDrawable;->getOffset()F
|
||||
|
||||
move-result v0
|
||||
|
||||
.line 265
|
||||
.local v0, "glyphOffset":F
|
||||
cmpl-float v1, p2, v2
|
||||
|
||||
if-lez v1, :cond_20
|
||||
|
||||
.line 266
|
||||
const/4 v1, 0x0
|
||||
|
||||
sub-float v2, p2, v2
|
||||
|
||||
invoke-static {v1, v2}, Ljava/lang/Math;->max(FF)F
|
||||
|
||||
move-result v1
|
||||
|
||||
mul-float/2addr v1, v3
|
||||
|
||||
invoke-static {v0, v1}, Ljava/lang/Math;->max(FF)F
|
||||
|
||||
move-result v0
|
||||
|
||||
.line 270
|
||||
:goto_1a
|
||||
iget-object v1, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mSlider:Landroid/support/v4/app/ActionBarDrawerToggle$SlideDrawable;
|
||||
|
||||
invoke-virtual {v1, v0}, Landroid/support/v4/app/ActionBarDrawerToggle$SlideDrawable;->setOffset(F)V
|
||||
|
||||
.line 271
|
||||
return-void
|
||||
|
||||
.line 268
|
||||
:cond_20
|
||||
mul-float v1, p2, v3
|
||||
|
||||
invoke-static {v0, v1}, Ljava/lang/Math;->min(FF)F
|
||||
|
||||
move-result v0
|
||||
|
||||
goto :goto_1a
|
||||
.end method
|
||||
|
||||
.method public onDrawerStateChanged(I)V
|
||||
.registers 2
|
||||
.param p1, "newState" # I
|
||||
|
||||
.prologue
|
||||
.line 314
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method public onOptionsItemSelected(Landroid/view/MenuItem;)Z
|
||||
.registers 5
|
||||
.param p1, "item" # Landroid/view/MenuItem;
|
||||
|
||||
.prologue
|
||||
const v2, 0x800003
|
||||
|
||||
.line 244
|
||||
if-eqz p1, :cond_1f
|
||||
|
||||
invoke-interface {p1}, Landroid/view/MenuItem;->getItemId()I
|
||||
|
||||
move-result v0
|
||||
|
||||
const v1, 0x102002c
|
||||
|
||||
if-ne v0, v1, :cond_1f
|
||||
|
||||
iget-boolean v0, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mDrawerIndicatorEnabled:Z
|
||||
|
||||
if-eqz v0, :cond_1f
|
||||
|
||||
.line 245
|
||||
iget-object v0, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mDrawerLayout:Landroid/support/v4/widget/DrawerLayout;
|
||||
|
||||
invoke-virtual {v0, v2}, Landroid/support/v4/widget/DrawerLayout;->isDrawerVisible(I)Z
|
||||
|
||||
move-result v0
|
||||
|
||||
if-eqz v0, :cond_21
|
||||
|
||||
.line 246
|
||||
iget-object v0, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mDrawerLayout:Landroid/support/v4/widget/DrawerLayout;
|
||||
|
||||
invoke-virtual {v0, v2}, Landroid/support/v4/widget/DrawerLayout;->closeDrawer(I)V
|
||||
|
||||
.line 251
|
||||
:cond_1f
|
||||
:goto_1f
|
||||
const/4 v0, 0x0
|
||||
|
||||
return v0
|
||||
|
||||
.line 248
|
||||
:cond_21
|
||||
iget-object v0, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mDrawerLayout:Landroid/support/v4/widget/DrawerLayout;
|
||||
|
||||
invoke-virtual {v0, v2}, Landroid/support/v4/widget/DrawerLayout;->openDrawer(I)V
|
||||
|
||||
goto :goto_1f
|
||||
.end method
|
||||
|
||||
.method public setDrawerIndicatorEnabled(Z)V
|
||||
.registers 8
|
||||
.param p1, "enable" # Z
|
||||
|
||||
.prologue
|
||||
.line 199
|
||||
iget-boolean v0, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mDrawerIndicatorEnabled:Z
|
||||
|
||||
if-eq p1, v0, :cond_23
|
||||
|
||||
.line 200
|
||||
if-eqz p1, :cond_27
|
||||
|
||||
.line 201
|
||||
sget-object v1, Landroid/support/v4/app/ActionBarDrawerToggle;->IMPL:Landroid/support/v4/app/ActionBarDrawerToggle$ActionBarDrawerToggleImpl;
|
||||
|
||||
iget-object v2, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mSetIndicatorInfo:Ljava/lang/Object;
|
||||
|
||||
iget-object v3, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mActivity:Landroid/app/Activity;
|
||||
|
||||
iget-object v4, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mSlider:Landroid/support/v4/app/ActionBarDrawerToggle$SlideDrawable;
|
||||
|
||||
iget-object v0, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mDrawerLayout:Landroid/support/v4/widget/DrawerLayout;
|
||||
|
||||
const v5, 0x800003
|
||||
|
||||
invoke-virtual {v0, v5}, Landroid/support/v4/widget/DrawerLayout;->isDrawerOpen(I)Z
|
||||
|
||||
move-result v0
|
||||
|
||||
if-eqz v0, :cond_24
|
||||
|
||||
iget v0, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mOpenDrawerContentDescRes:I
|
||||
|
||||
:goto_1b
|
||||
invoke-interface {v1, v2, v3, v4, v0}, Landroid/support/v4/app/ActionBarDrawerToggle$ActionBarDrawerToggleImpl;->setActionBarUpIndicator(Ljava/lang/Object;Landroid/app/Activity;Landroid/graphics/drawable/Drawable;I)Ljava/lang/Object;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
iput-object v0, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mSetIndicatorInfo:Ljava/lang/Object;
|
||||
|
||||
.line 208
|
||||
:goto_21
|
||||
iput-boolean p1, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mDrawerIndicatorEnabled:Z
|
||||
|
||||
.line 210
|
||||
:cond_23
|
||||
return-void
|
||||
|
||||
.line 201
|
||||
:cond_24
|
||||
iget v0, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mCloseDrawerContentDescRes:I
|
||||
|
||||
goto :goto_1b
|
||||
|
||||
.line 205
|
||||
:cond_27
|
||||
sget-object v0, Landroid/support/v4/app/ActionBarDrawerToggle;->IMPL:Landroid/support/v4/app/ActionBarDrawerToggle$ActionBarDrawerToggleImpl;
|
||||
|
||||
iget-object v1, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mSetIndicatorInfo:Ljava/lang/Object;
|
||||
|
||||
iget-object v2, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mActivity:Landroid/app/Activity;
|
||||
|
||||
iget-object v3, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mThemeImage:Landroid/graphics/drawable/Drawable;
|
||||
|
||||
const/4 v4, 0x0
|
||||
|
||||
invoke-interface {v0, v1, v2, v3, v4}, Landroid/support/v4/app/ActionBarDrawerToggle$ActionBarDrawerToggleImpl;->setActionBarUpIndicator(Ljava/lang/Object;Landroid/app/Activity;Landroid/graphics/drawable/Drawable;I)Ljava/lang/Object;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
iput-object v0, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mSetIndicatorInfo:Ljava/lang/Object;
|
||||
|
||||
goto :goto_21
|
||||
.end method
|
||||
|
||||
.method public syncState()V
|
||||
.registers 7
|
||||
|
||||
.prologue
|
||||
const v5, 0x800003
|
||||
|
||||
.line 175
|
||||
iget-object v0, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mDrawerLayout:Landroid/support/v4/widget/DrawerLayout;
|
||||
|
||||
invoke-virtual {v0, v5}, Landroid/support/v4/widget/DrawerLayout;->isDrawerOpen(I)Z
|
||||
|
||||
move-result v0
|
||||
|
||||
if-eqz v0, :cond_2f
|
||||
|
||||
.line 176
|
||||
iget-object v0, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mSlider:Landroid/support/v4/app/ActionBarDrawerToggle$SlideDrawable;
|
||||
|
||||
const/high16 v1, 0x3f800000
|
||||
|
||||
invoke-virtual {v0, v1}, Landroid/support/v4/app/ActionBarDrawerToggle$SlideDrawable;->setOffset(F)V
|
||||
|
||||
.line 181
|
||||
:goto_12
|
||||
iget-boolean v0, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mDrawerIndicatorEnabled:Z
|
||||
|
||||
if-eqz v0, :cond_2e
|
||||
|
||||
.line 182
|
||||
sget-object v1, Landroid/support/v4/app/ActionBarDrawerToggle;->IMPL:Landroid/support/v4/app/ActionBarDrawerToggle$ActionBarDrawerToggleImpl;
|
||||
|
||||
iget-object v2, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mSetIndicatorInfo:Ljava/lang/Object;
|
||||
|
||||
iget-object v3, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mActivity:Landroid/app/Activity;
|
||||
|
||||
iget-object v4, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mSlider:Landroid/support/v4/app/ActionBarDrawerToggle$SlideDrawable;
|
||||
|
||||
iget-object v0, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mDrawerLayout:Landroid/support/v4/widget/DrawerLayout;
|
||||
|
||||
invoke-virtual {v0, v5}, Landroid/support/v4/widget/DrawerLayout;->isDrawerOpen(I)Z
|
||||
|
||||
move-result v0
|
||||
|
||||
if-eqz v0, :cond_36
|
||||
|
||||
iget v0, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mOpenDrawerContentDescRes:I
|
||||
|
||||
:goto_28
|
||||
invoke-interface {v1, v2, v3, v4, v0}, Landroid/support/v4/app/ActionBarDrawerToggle$ActionBarDrawerToggleImpl;->setActionBarUpIndicator(Ljava/lang/Object;Landroid/app/Activity;Landroid/graphics/drawable/Drawable;I)Ljava/lang/Object;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
iput-object v0, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mSetIndicatorInfo:Ljava/lang/Object;
|
||||
|
||||
.line 186
|
||||
:cond_2e
|
||||
return-void
|
||||
|
||||
.line 178
|
||||
:cond_2f
|
||||
iget-object v0, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mSlider:Landroid/support/v4/app/ActionBarDrawerToggle$SlideDrawable;
|
||||
|
||||
const/4 v1, 0x0
|
||||
|
||||
invoke-virtual {v0, v1}, Landroid/support/v4/app/ActionBarDrawerToggle$SlideDrawable;->setOffset(F)V
|
||||
|
||||
goto :goto_12
|
||||
|
||||
.line 182
|
||||
:cond_36
|
||||
iget v0, p0, Landroid/support/v4/app/ActionBarDrawerToggle;->mCloseDrawerContentDescRes:I
|
||||
|
||||
goto :goto_28
|
||||
.end method
|
||||
4235
samples/Smali/DoodleMobileAnaylise.smali
Normal file
4235
samples/Smali/DoodleMobileAnaylise.smali
Normal file
File diff suppressed because it is too large
Load Diff
700
samples/Smali/ModernAsyncTask.smali
Normal file
700
samples/Smali/ModernAsyncTask.smali
Normal file
@@ -0,0 +1,700 @@
|
||||
.class abstract Landroid/support/v4/content/ModernAsyncTask;
|
||||
.super Ljava/lang/Object;
|
||||
.source "ModernAsyncTask.java"
|
||||
|
||||
|
||||
# annotations
|
||||
.annotation system Ldalvik/annotation/MemberClasses;
|
||||
value = {
|
||||
Landroid/support/v4/content/ModernAsyncTask$4;,
|
||||
Landroid/support/v4/content/ModernAsyncTask$AsyncTaskResult;,
|
||||
Landroid/support/v4/content/ModernAsyncTask$WorkerRunnable;,
|
||||
Landroid/support/v4/content/ModernAsyncTask$InternalHandler;,
|
||||
Landroid/support/v4/content/ModernAsyncTask$Status;
|
||||
}
|
||||
.end annotation
|
||||
|
||||
.annotation system Ldalvik/annotation/Signature;
|
||||
value = {
|
||||
"<Params:",
|
||||
"Ljava/lang/Object;",
|
||||
"Progress:",
|
||||
"Ljava/lang/Object;",
|
||||
"Result:",
|
||||
"Ljava/lang/Object;",
|
||||
">",
|
||||
"Ljava/lang/Object;"
|
||||
}
|
||||
.end annotation
|
||||
|
||||
|
||||
# static fields
|
||||
.field private static final CORE_POOL_SIZE:I = 0x5
|
||||
|
||||
.field private static final KEEP_ALIVE:I = 0x1
|
||||
|
||||
.field private static final LOG_TAG:Ljava/lang/String; = "AsyncTask"
|
||||
|
||||
.field private static final MAXIMUM_POOL_SIZE:I = 0x80
|
||||
|
||||
.field private static final MESSAGE_POST_PROGRESS:I = 0x2
|
||||
|
||||
.field private static final MESSAGE_POST_RESULT:I = 0x1
|
||||
|
||||
.field public static final THREAD_POOL_EXECUTOR:Ljava/util/concurrent/Executor;
|
||||
|
||||
.field private static volatile sDefaultExecutor:Ljava/util/concurrent/Executor;
|
||||
|
||||
.field private static final sHandler:Landroid/support/v4/content/ModernAsyncTask$InternalHandler;
|
||||
|
||||
.field private static final sPoolWorkQueue:Ljava/util/concurrent/BlockingQueue;
|
||||
.annotation system Ldalvik/annotation/Signature;
|
||||
value = {
|
||||
"Ljava/util/concurrent/BlockingQueue",
|
||||
"<",
|
||||
"Ljava/lang/Runnable;",
|
||||
">;"
|
||||
}
|
||||
.end annotation
|
||||
.end field
|
||||
|
||||
.field private static final sThreadFactory:Ljava/util/concurrent/ThreadFactory;
|
||||
|
||||
|
||||
# instance fields
|
||||
.field private final mFuture:Ljava/util/concurrent/FutureTask;
|
||||
.annotation system Ldalvik/annotation/Signature;
|
||||
value = {
|
||||
"Ljava/util/concurrent/FutureTask",
|
||||
"<TResult;>;"
|
||||
}
|
||||
.end annotation
|
||||
.end field
|
||||
|
||||
.field private volatile mStatus:Landroid/support/v4/content/ModernAsyncTask$Status;
|
||||
|
||||
.field private final mTaskInvoked:Ljava/util/concurrent/atomic/AtomicBoolean;
|
||||
|
||||
.field private final mWorker:Landroid/support/v4/content/ModernAsyncTask$WorkerRunnable;
|
||||
.annotation system Ldalvik/annotation/Signature;
|
||||
value = {
|
||||
"Landroid/support/v4/content/ModernAsyncTask$WorkerRunnable",
|
||||
"<TParams;TResult;>;"
|
||||
}
|
||||
.end annotation
|
||||
.end field
|
||||
|
||||
|
||||
# direct methods
|
||||
.method static constructor <clinit>()V
|
||||
.registers 8
|
||||
|
||||
.prologue
|
||||
.line 54
|
||||
new-instance v0, Landroid/support/v4/content/ModernAsyncTask$1;
|
||||
|
||||
invoke-direct {v0}, Landroid/support/v4/content/ModernAsyncTask$1;-><init>()V
|
||||
|
||||
sput-object v0, Landroid/support/v4/content/ModernAsyncTask;->sThreadFactory:Ljava/util/concurrent/ThreadFactory;
|
||||
|
||||
.line 62
|
||||
new-instance v0, Ljava/util/concurrent/LinkedBlockingQueue;
|
||||
|
||||
const/16 v1, 0xa
|
||||
|
||||
invoke-direct {v0, v1}, Ljava/util/concurrent/LinkedBlockingQueue;-><init>(I)V
|
||||
|
||||
sput-object v0, Landroid/support/v4/content/ModernAsyncTask;->sPoolWorkQueue:Ljava/util/concurrent/BlockingQueue;
|
||||
|
||||
.line 68
|
||||
new-instance v0, Ljava/util/concurrent/ThreadPoolExecutor;
|
||||
|
||||
const/4 v1, 0x5
|
||||
|
||||
const/16 v2, 0x80
|
||||
|
||||
const-wide/16 v3, 0x1
|
||||
|
||||
sget-object v5, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit;
|
||||
|
||||
sget-object v6, Landroid/support/v4/content/ModernAsyncTask;->sPoolWorkQueue:Ljava/util/concurrent/BlockingQueue;
|
||||
|
||||
sget-object v7, Landroid/support/v4/content/ModernAsyncTask;->sThreadFactory:Ljava/util/concurrent/ThreadFactory;
|
||||
|
||||
invoke-direct/range {v0 .. v7}, Ljava/util/concurrent/ThreadPoolExecutor;-><init>(IIJLjava/util/concurrent/TimeUnit;Ljava/util/concurrent/BlockingQueue;Ljava/util/concurrent/ThreadFactory;)V
|
||||
|
||||
sput-object v0, Landroid/support/v4/content/ModernAsyncTask;->THREAD_POOL_EXECUTOR:Ljava/util/concurrent/Executor;
|
||||
|
||||
.line 75
|
||||
new-instance v0, Landroid/support/v4/content/ModernAsyncTask$InternalHandler;
|
||||
|
||||
const/4 v1, 0x0
|
||||
|
||||
invoke-direct {v0, v1}, Landroid/support/v4/content/ModernAsyncTask$InternalHandler;-><init>(Landroid/support/v4/content/ModernAsyncTask$1;)V
|
||||
|
||||
sput-object v0, Landroid/support/v4/content/ModernAsyncTask;->sHandler:Landroid/support/v4/content/ModernAsyncTask$InternalHandler;
|
||||
|
||||
.line 77
|
||||
sget-object v0, Landroid/support/v4/content/ModernAsyncTask;->THREAD_POOL_EXECUTOR:Ljava/util/concurrent/Executor;
|
||||
|
||||
sput-object v0, Landroid/support/v4/content/ModernAsyncTask;->sDefaultExecutor:Ljava/util/concurrent/Executor;
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method public constructor <init>()V
|
||||
.registers 3
|
||||
|
||||
.prologue
|
||||
.line 117
|
||||
.local p0, "this":Landroid/support/v4/content/ModernAsyncTask;, "Landroid/support/v4/content/ModernAsyncTask<TParams;TProgress;TResult;>;"
|
||||
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
||||
|
||||
.line 81
|
||||
sget-object v0, Landroid/support/v4/content/ModernAsyncTask$Status;->PENDING:Landroid/support/v4/content/ModernAsyncTask$Status;
|
||||
|
||||
iput-object v0, p0, Landroid/support/v4/content/ModernAsyncTask;->mStatus:Landroid/support/v4/content/ModernAsyncTask$Status;
|
||||
|
||||
.line 83
|
||||
new-instance v0, Ljava/util/concurrent/atomic/AtomicBoolean;
|
||||
|
||||
invoke-direct {v0}, Ljava/util/concurrent/atomic/AtomicBoolean;-><init>()V
|
||||
|
||||
iput-object v0, p0, Landroid/support/v4/content/ModernAsyncTask;->mTaskInvoked:Ljava/util/concurrent/atomic/AtomicBoolean;
|
||||
|
||||
.line 118
|
||||
new-instance v0, Landroid/support/v4/content/ModernAsyncTask$2;
|
||||
|
||||
invoke-direct {v0, p0}, Landroid/support/v4/content/ModernAsyncTask$2;-><init>(Landroid/support/v4/content/ModernAsyncTask;)V
|
||||
|
||||
iput-object v0, p0, Landroid/support/v4/content/ModernAsyncTask;->mWorker:Landroid/support/v4/content/ModernAsyncTask$WorkerRunnable;
|
||||
|
||||
.line 127
|
||||
new-instance v0, Landroid/support/v4/content/ModernAsyncTask$3;
|
||||
|
||||
iget-object v1, p0, Landroid/support/v4/content/ModernAsyncTask;->mWorker:Landroid/support/v4/content/ModernAsyncTask$WorkerRunnable;
|
||||
|
||||
invoke-direct {v0, p0, v1}, Landroid/support/v4/content/ModernAsyncTask$3;-><init>(Landroid/support/v4/content/ModernAsyncTask;Ljava/util/concurrent/Callable;)V
|
||||
|
||||
iput-object v0, p0, Landroid/support/v4/content/ModernAsyncTask;->mFuture:Ljava/util/concurrent/FutureTask;
|
||||
|
||||
.line 147
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method static synthetic access$200(Landroid/support/v4/content/ModernAsyncTask;)Ljava/util/concurrent/atomic/AtomicBoolean;
|
||||
.registers 2
|
||||
.param p0, "x0" # Landroid/support/v4/content/ModernAsyncTask;
|
||||
|
||||
.prologue
|
||||
.line 47
|
||||
iget-object v0, p0, Landroid/support/v4/content/ModernAsyncTask;->mTaskInvoked:Ljava/util/concurrent/atomic/AtomicBoolean;
|
||||
|
||||
return-object v0
|
||||
.end method
|
||||
|
||||
.method static synthetic access$300(Landroid/support/v4/content/ModernAsyncTask;Ljava/lang/Object;)Ljava/lang/Object;
|
||||
.registers 3
|
||||
.param p0, "x0" # Landroid/support/v4/content/ModernAsyncTask;
|
||||
.param p1, "x1" # Ljava/lang/Object;
|
||||
|
||||
.prologue
|
||||
.line 47
|
||||
invoke-direct {p0, p1}, Landroid/support/v4/content/ModernAsyncTask;->postResult(Ljava/lang/Object;)Ljava/lang/Object;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
return-object v0
|
||||
.end method
|
||||
|
||||
.method static synthetic access$400(Landroid/support/v4/content/ModernAsyncTask;Ljava/lang/Object;)V
|
||||
.registers 2
|
||||
.param p0, "x0" # Landroid/support/v4/content/ModernAsyncTask;
|
||||
.param p1, "x1" # Ljava/lang/Object;
|
||||
|
||||
.prologue
|
||||
.line 47
|
||||
invoke-direct {p0, p1}, Landroid/support/v4/content/ModernAsyncTask;->postResultIfNotInvoked(Ljava/lang/Object;)V
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method static synthetic access$500(Landroid/support/v4/content/ModernAsyncTask;Ljava/lang/Object;)V
|
||||
.registers 2
|
||||
.param p0, "x0" # Landroid/support/v4/content/ModernAsyncTask;
|
||||
.param p1, "x1" # Ljava/lang/Object;
|
||||
|
||||
.prologue
|
||||
.line 47
|
||||
invoke-direct {p0, p1}, Landroid/support/v4/content/ModernAsyncTask;->finish(Ljava/lang/Object;)V
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method public static execute(Ljava/lang/Runnable;)V
|
||||
.registers 2
|
||||
.param p0, "runnable" # Ljava/lang/Runnable;
|
||||
|
||||
.prologue
|
||||
.line 433
|
||||
sget-object v0, Landroid/support/v4/content/ModernAsyncTask;->sDefaultExecutor:Ljava/util/concurrent/Executor;
|
||||
|
||||
invoke-interface {v0, p0}, Ljava/util/concurrent/Executor;->execute(Ljava/lang/Runnable;)V
|
||||
|
||||
.line 434
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method private finish(Ljava/lang/Object;)V
|
||||
.registers 3
|
||||
.annotation system Ldalvik/annotation/Signature;
|
||||
value = {
|
||||
"(TResult;)V"
|
||||
}
|
||||
.end annotation
|
||||
|
||||
.prologue
|
||||
.line 458
|
||||
.local p0, "this":Landroid/support/v4/content/ModernAsyncTask;, "Landroid/support/v4/content/ModernAsyncTask<TParams;TProgress;TResult;>;"
|
||||
.local p1, "result":Ljava/lang/Object;, "TResult;"
|
||||
invoke-virtual {p0}, Landroid/support/v4/content/ModernAsyncTask;->isCancelled()Z
|
||||
|
||||
move-result v0
|
||||
|
||||
if-eqz v0, :cond_e
|
||||
|
||||
.line 459
|
||||
invoke-virtual {p0, p1}, Landroid/support/v4/content/ModernAsyncTask;->onCancelled(Ljava/lang/Object;)V
|
||||
|
||||
.line 463
|
||||
:goto_9
|
||||
sget-object v0, Landroid/support/v4/content/ModernAsyncTask$Status;->FINISHED:Landroid/support/v4/content/ModernAsyncTask$Status;
|
||||
|
||||
iput-object v0, p0, Landroid/support/v4/content/ModernAsyncTask;->mStatus:Landroid/support/v4/content/ModernAsyncTask$Status;
|
||||
|
||||
.line 464
|
||||
return-void
|
||||
|
||||
.line 461
|
||||
:cond_e
|
||||
invoke-virtual {p0, p1}, Landroid/support/v4/content/ModernAsyncTask;->onPostExecute(Ljava/lang/Object;)V
|
||||
|
||||
goto :goto_9
|
||||
.end method
|
||||
|
||||
.method public static init()V
|
||||
.registers 1
|
||||
|
||||
.prologue
|
||||
.line 106
|
||||
sget-object v0, Landroid/support/v4/content/ModernAsyncTask;->sHandler:Landroid/support/v4/content/ModernAsyncTask$InternalHandler;
|
||||
|
||||
invoke-virtual {v0}, Landroid/support/v4/content/ModernAsyncTask$InternalHandler;->getLooper()Landroid/os/Looper;
|
||||
|
||||
.line 107
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method private postResult(Ljava/lang/Object;)Ljava/lang/Object;
|
||||
.registers 8
|
||||
.annotation system Ldalvik/annotation/Signature;
|
||||
value = {
|
||||
"(TResult;)TResult;"
|
||||
}
|
||||
.end annotation
|
||||
|
||||
.prologue
|
||||
.local p0, "this":Landroid/support/v4/content/ModernAsyncTask;, "Landroid/support/v4/content/ModernAsyncTask<TParams;TProgress;TResult;>;"
|
||||
.local p1, "result":Ljava/lang/Object;, "TResult;"
|
||||
const/4 v5, 0x1
|
||||
|
||||
.line 157
|
||||
sget-object v1, Landroid/support/v4/content/ModernAsyncTask;->sHandler:Landroid/support/v4/content/ModernAsyncTask$InternalHandler;
|
||||
|
||||
new-instance v2, Landroid/support/v4/content/ModernAsyncTask$AsyncTaskResult;
|
||||
|
||||
new-array v3, v5, [Ljava/lang/Object;
|
||||
|
||||
const/4 v4, 0x0
|
||||
|
||||
aput-object p1, v3, v4
|
||||
|
||||
invoke-direct {v2, p0, v3}, Landroid/support/v4/content/ModernAsyncTask$AsyncTaskResult;-><init>(Landroid/support/v4/content/ModernAsyncTask;[Ljava/lang/Object;)V
|
||||
|
||||
invoke-virtual {v1, v5, v2}, Landroid/support/v4/content/ModernAsyncTask$InternalHandler;->obtainMessage(ILjava/lang/Object;)Landroid/os/Message;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
.line 159
|
||||
.local v0, "message":Landroid/os/Message;
|
||||
invoke-virtual {v0}, Landroid/os/Message;->sendToTarget()V
|
||||
|
||||
.line 160
|
||||
return-object p1
|
||||
.end method
|
||||
|
||||
.method private postResultIfNotInvoked(Ljava/lang/Object;)V
|
||||
.registers 4
|
||||
.annotation system Ldalvik/annotation/Signature;
|
||||
value = {
|
||||
"(TResult;)V"
|
||||
}
|
||||
.end annotation
|
||||
|
||||
.prologue
|
||||
.line 150
|
||||
.local p0, "this":Landroid/support/v4/content/ModernAsyncTask;, "Landroid/support/v4/content/ModernAsyncTask<TParams;TProgress;TResult;>;"
|
||||
.local p1, "result":Ljava/lang/Object;, "TResult;"
|
||||
iget-object v1, p0, Landroid/support/v4/content/ModernAsyncTask;->mTaskInvoked:Ljava/util/concurrent/atomic/AtomicBoolean;
|
||||
|
||||
invoke-virtual {v1}, Ljava/util/concurrent/atomic/AtomicBoolean;->get()Z
|
||||
|
||||
move-result v0
|
||||
|
||||
.line 151
|
||||
.local v0, "wasTaskInvoked":Z
|
||||
if-nez v0, :cond_b
|
||||
|
||||
.line 152
|
||||
invoke-direct {p0, p1}, Landroid/support/v4/content/ModernAsyncTask;->postResult(Ljava/lang/Object;)Ljava/lang/Object;
|
||||
|
||||
.line 154
|
||||
:cond_b
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method public static setDefaultExecutor(Ljava/util/concurrent/Executor;)V
|
||||
.registers 1
|
||||
.param p0, "exec" # Ljava/util/concurrent/Executor;
|
||||
|
||||
.prologue
|
||||
.line 111
|
||||
sput-object p0, Landroid/support/v4/content/ModernAsyncTask;->sDefaultExecutor:Ljava/util/concurrent/Executor;
|
||||
|
||||
.line 112
|
||||
return-void
|
||||
.end method
|
||||
|
||||
|
||||
# virtual methods
|
||||
.method public final cancel(Z)Z
|
||||
.registers 3
|
||||
.param p1, "mayInterruptIfRunning" # Z
|
||||
|
||||
.prologue
|
||||
.line 306
|
||||
.local p0, "this":Landroid/support/v4/content/ModernAsyncTask;, "Landroid/support/v4/content/ModernAsyncTask<TParams;TProgress;TResult;>;"
|
||||
iget-object v0, p0, Landroid/support/v4/content/ModernAsyncTask;->mFuture:Ljava/util/concurrent/FutureTask;
|
||||
|
||||
invoke-virtual {v0, p1}, Ljava/util/concurrent/FutureTask;->cancel(Z)Z
|
||||
|
||||
move-result v0
|
||||
|
||||
return v0
|
||||
.end method
|
||||
|
||||
.method protected varargs abstract doInBackground([Ljava/lang/Object;)Ljava/lang/Object;
|
||||
.annotation system Ldalvik/annotation/Signature;
|
||||
value = {
|
||||
"([TParams;)TResult;"
|
||||
}
|
||||
.end annotation
|
||||
.end method
|
||||
|
||||
.method public final varargs execute([Ljava/lang/Object;)Landroid/support/v4/content/ModernAsyncTask;
|
||||
.registers 3
|
||||
.annotation system Ldalvik/annotation/Signature;
|
||||
value = {
|
||||
"([TParams;)",
|
||||
"Landroid/support/v4/content/ModernAsyncTask",
|
||||
"<TParams;TProgress;TResult;>;"
|
||||
}
|
||||
.end annotation
|
||||
|
||||
.prologue
|
||||
.line 371
|
||||
.local p0, "this":Landroid/support/v4/content/ModernAsyncTask;, "Landroid/support/v4/content/ModernAsyncTask<TParams;TProgress;TResult;>;"
|
||||
.local p1, "params":[Ljava/lang/Object;, "[TParams;"
|
||||
sget-object v0, Landroid/support/v4/content/ModernAsyncTask;->sDefaultExecutor:Ljava/util/concurrent/Executor;
|
||||
|
||||
invoke-virtual {p0, v0, p1}, Landroid/support/v4/content/ModernAsyncTask;->executeOnExecutor(Ljava/util/concurrent/Executor;[Ljava/lang/Object;)Landroid/support/v4/content/ModernAsyncTask;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
return-object v0
|
||||
.end method
|
||||
|
||||
.method public final varargs executeOnExecutor(Ljava/util/concurrent/Executor;[Ljava/lang/Object;)Landroid/support/v4/content/ModernAsyncTask;
|
||||
.registers 5
|
||||
.param p1, "exec" # Ljava/util/concurrent/Executor;
|
||||
.annotation system Ldalvik/annotation/Signature;
|
||||
value = {
|
||||
"(",
|
||||
"Ljava/util/concurrent/Executor;",
|
||||
"[TParams;)",
|
||||
"Landroid/support/v4/content/ModernAsyncTask",
|
||||
"<TParams;TProgress;TResult;>;"
|
||||
}
|
||||
.end annotation
|
||||
|
||||
.prologue
|
||||
.line 406
|
||||
.local p0, "this":Landroid/support/v4/content/ModernAsyncTask;, "Landroid/support/v4/content/ModernAsyncTask<TParams;TProgress;TResult;>;"
|
||||
.local p2, "params":[Ljava/lang/Object;, "[TParams;"
|
||||
iget-object v0, p0, Landroid/support/v4/content/ModernAsyncTask;->mStatus:Landroid/support/v4/content/ModernAsyncTask$Status;
|
||||
|
||||
sget-object v1, Landroid/support/v4/content/ModernAsyncTask$Status;->PENDING:Landroid/support/v4/content/ModernAsyncTask$Status;
|
||||
|
||||
if-eq v0, v1, :cond_13
|
||||
|
||||
.line 407
|
||||
sget-object v0, Landroid/support/v4/content/ModernAsyncTask$4;->$SwitchMap$android$support$v4$content$ModernAsyncTask$Status:[I
|
||||
|
||||
iget-object v1, p0, Landroid/support/v4/content/ModernAsyncTask;->mStatus:Landroid/support/v4/content/ModernAsyncTask$Status;
|
||||
|
||||
invoke-virtual {v1}, Landroid/support/v4/content/ModernAsyncTask$Status;->ordinal()I
|
||||
|
||||
move-result v1
|
||||
|
||||
aget v0, v0, v1
|
||||
|
||||
packed-switch v0, :pswitch_data_34
|
||||
|
||||
.line 418
|
||||
:cond_13
|
||||
sget-object v0, Landroid/support/v4/content/ModernAsyncTask$Status;->RUNNING:Landroid/support/v4/content/ModernAsyncTask$Status;
|
||||
|
||||
iput-object v0, p0, Landroid/support/v4/content/ModernAsyncTask;->mStatus:Landroid/support/v4/content/ModernAsyncTask$Status;
|
||||
|
||||
.line 420
|
||||
invoke-virtual {p0}, Landroid/support/v4/content/ModernAsyncTask;->onPreExecute()V
|
||||
|
||||
.line 422
|
||||
iget-object v0, p0, Landroid/support/v4/content/ModernAsyncTask;->mWorker:Landroid/support/v4/content/ModernAsyncTask$WorkerRunnable;
|
||||
|
||||
iput-object p2, v0, Landroid/support/v4/content/ModernAsyncTask$WorkerRunnable;->mParams:[Ljava/lang/Object;
|
||||
|
||||
.line 423
|
||||
iget-object v0, p0, Landroid/support/v4/content/ModernAsyncTask;->mFuture:Ljava/util/concurrent/FutureTask;
|
||||
|
||||
invoke-interface {p1, v0}, Ljava/util/concurrent/Executor;->execute(Ljava/lang/Runnable;)V
|
||||
|
||||
.line 425
|
||||
return-object p0
|
||||
|
||||
.line 409
|
||||
:pswitch_24
|
||||
new-instance v0, Ljava/lang/IllegalStateException;
|
||||
|
||||
const-string v1, "Cannot execute task: the task is already running."
|
||||
|
||||
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
||||
|
||||
throw v0
|
||||
|
||||
.line 412
|
||||
:pswitch_2c
|
||||
new-instance v0, Ljava/lang/IllegalStateException;
|
||||
|
||||
const-string v1, "Cannot execute task: the task has already been executed (a task can be executed only once)"
|
||||
|
||||
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
||||
|
||||
throw v0
|
||||
|
||||
.line 407
|
||||
:pswitch_data_34
|
||||
.packed-switch 0x1
|
||||
:pswitch_24
|
||||
:pswitch_2c
|
||||
.end packed-switch
|
||||
.end method
|
||||
|
||||
.method public final get()Ljava/lang/Object;
|
||||
.registers 2
|
||||
.annotation system Ldalvik/annotation/Signature;
|
||||
value = {
|
||||
"()TResult;"
|
||||
}
|
||||
.end annotation
|
||||
|
||||
.annotation system Ldalvik/annotation/Throws;
|
||||
value = {
|
||||
Ljava/lang/InterruptedException;,
|
||||
Ljava/util/concurrent/ExecutionException;
|
||||
}
|
||||
.end annotation
|
||||
|
||||
.prologue
|
||||
.line 321
|
||||
.local p0, "this":Landroid/support/v4/content/ModernAsyncTask;, "Landroid/support/v4/content/ModernAsyncTask<TParams;TProgress;TResult;>;"
|
||||
iget-object v0, p0, Landroid/support/v4/content/ModernAsyncTask;->mFuture:Ljava/util/concurrent/FutureTask;
|
||||
|
||||
invoke-virtual {v0}, Ljava/util/concurrent/FutureTask;->get()Ljava/lang/Object;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
return-object v0
|
||||
.end method
|
||||
|
||||
.method public final get(JLjava/util/concurrent/TimeUnit;)Ljava/lang/Object;
|
||||
.registers 5
|
||||
.param p1, "timeout" # J
|
||||
.param p3, "unit" # Ljava/util/concurrent/TimeUnit;
|
||||
.annotation system Ldalvik/annotation/Signature;
|
||||
value = {
|
||||
"(J",
|
||||
"Ljava/util/concurrent/TimeUnit;",
|
||||
")TResult;"
|
||||
}
|
||||
.end annotation
|
||||
|
||||
.annotation system Ldalvik/annotation/Throws;
|
||||
value = {
|
||||
Ljava/lang/InterruptedException;,
|
||||
Ljava/util/concurrent/ExecutionException;,
|
||||
Ljava/util/concurrent/TimeoutException;
|
||||
}
|
||||
.end annotation
|
||||
|
||||
.prologue
|
||||
.line 341
|
||||
.local p0, "this":Landroid/support/v4/content/ModernAsyncTask;, "Landroid/support/v4/content/ModernAsyncTask<TParams;TProgress;TResult;>;"
|
||||
iget-object v0, p0, Landroid/support/v4/content/ModernAsyncTask;->mFuture:Ljava/util/concurrent/FutureTask;
|
||||
|
||||
invoke-virtual {v0, p1, p2, p3}, Ljava/util/concurrent/FutureTask;->get(JLjava/util/concurrent/TimeUnit;)Ljava/lang/Object;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
return-object v0
|
||||
.end method
|
||||
|
||||
.method public final getStatus()Landroid/support/v4/content/ModernAsyncTask$Status;
|
||||
.registers 2
|
||||
|
||||
.prologue
|
||||
.line 169
|
||||
.local p0, "this":Landroid/support/v4/content/ModernAsyncTask;, "Landroid/support/v4/content/ModernAsyncTask<TParams;TProgress;TResult;>;"
|
||||
iget-object v0, p0, Landroid/support/v4/content/ModernAsyncTask;->mStatus:Landroid/support/v4/content/ModernAsyncTask$Status;
|
||||
|
||||
return-object v0
|
||||
.end method
|
||||
|
||||
.method public final isCancelled()Z
|
||||
.registers 2
|
||||
|
||||
.prologue
|
||||
.line 273
|
||||
.local p0, "this":Landroid/support/v4/content/ModernAsyncTask;, "Landroid/support/v4/content/ModernAsyncTask<TParams;TProgress;TResult;>;"
|
||||
iget-object v0, p0, Landroid/support/v4/content/ModernAsyncTask;->mFuture:Ljava/util/concurrent/FutureTask;
|
||||
|
||||
invoke-virtual {v0}, Ljava/util/concurrent/FutureTask;->isCancelled()Z
|
||||
|
||||
move-result v0
|
||||
|
||||
return v0
|
||||
.end method
|
||||
|
||||
.method protected onCancelled()V
|
||||
.registers 1
|
||||
|
||||
.prologue
|
||||
.line 260
|
||||
.local p0, "this":Landroid/support/v4/content/ModernAsyncTask;, "Landroid/support/v4/content/ModernAsyncTask<TParams;TProgress;TResult;>;"
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method protected onCancelled(Ljava/lang/Object;)V
|
||||
.registers 2
|
||||
.annotation system Ldalvik/annotation/Signature;
|
||||
value = {
|
||||
"(TResult;)V"
|
||||
}
|
||||
.end annotation
|
||||
|
||||
.prologue
|
||||
.line 244
|
||||
.local p0, "this":Landroid/support/v4/content/ModernAsyncTask;, "Landroid/support/v4/content/ModernAsyncTask<TParams;TProgress;TResult;>;"
|
||||
.local p1, "result":Ljava/lang/Object;, "TResult;"
|
||||
invoke-virtual {p0}, Landroid/support/v4/content/ModernAsyncTask;->onCancelled()V
|
||||
|
||||
.line 245
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method protected onPostExecute(Ljava/lang/Object;)V
|
||||
.registers 2
|
||||
.annotation system Ldalvik/annotation/Signature;
|
||||
value = {
|
||||
"(TResult;)V"
|
||||
}
|
||||
.end annotation
|
||||
|
||||
.prologue
|
||||
.line 213
|
||||
.local p0, "this":Landroid/support/v4/content/ModernAsyncTask;, "Landroid/support/v4/content/ModernAsyncTask<TParams;TProgress;TResult;>;"
|
||||
.local p1, "result":Ljava/lang/Object;, "TResult;"
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method protected onPreExecute()V
|
||||
.registers 1
|
||||
|
||||
.prologue
|
||||
.line 197
|
||||
.local p0, "this":Landroid/support/v4/content/ModernAsyncTask;, "Landroid/support/v4/content/ModernAsyncTask<TParams;TProgress;TResult;>;"
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method protected varargs onProgressUpdate([Ljava/lang/Object;)V
|
||||
.registers 2
|
||||
.annotation system Ldalvik/annotation/Signature;
|
||||
value = {
|
||||
"([TProgress;)V"
|
||||
}
|
||||
.end annotation
|
||||
|
||||
.prologue
|
||||
.line 226
|
||||
.local p0, "this":Landroid/support/v4/content/ModernAsyncTask;, "Landroid/support/v4/content/ModernAsyncTask<TParams;TProgress;TResult;>;"
|
||||
.local p1, "values":[Ljava/lang/Object;, "[TProgress;"
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method protected final varargs publishProgress([Ljava/lang/Object;)V
|
||||
.registers 5
|
||||
.annotation system Ldalvik/annotation/Signature;
|
||||
value = {
|
||||
"([TProgress;)V"
|
||||
}
|
||||
.end annotation
|
||||
|
||||
.prologue
|
||||
.line 451
|
||||
.local p0, "this":Landroid/support/v4/content/ModernAsyncTask;, "Landroid/support/v4/content/ModernAsyncTask<TParams;TProgress;TResult;>;"
|
||||
.local p1, "values":[Ljava/lang/Object;, "[TProgress;"
|
||||
invoke-virtual {p0}, Landroid/support/v4/content/ModernAsyncTask;->isCancelled()Z
|
||||
|
||||
move-result v0
|
||||
|
||||
if-nez v0, :cond_15
|
||||
|
||||
.line 452
|
||||
sget-object v0, Landroid/support/v4/content/ModernAsyncTask;->sHandler:Landroid/support/v4/content/ModernAsyncTask$InternalHandler;
|
||||
|
||||
const/4 v1, 0x2
|
||||
|
||||
new-instance v2, Landroid/support/v4/content/ModernAsyncTask$AsyncTaskResult;
|
||||
|
||||
invoke-direct {v2, p0, p1}, Landroid/support/v4/content/ModernAsyncTask$AsyncTaskResult;-><init>(Landroid/support/v4/content/ModernAsyncTask;[Ljava/lang/Object;)V
|
||||
|
||||
invoke-virtual {v0, v1, v2}, Landroid/support/v4/content/ModernAsyncTask$InternalHandler;->obtainMessage(ILjava/lang/Object;)Landroid/os/Message;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
invoke-virtual {v0}, Landroid/os/Message;->sendToTarget()V
|
||||
|
||||
.line 455
|
||||
:cond_15
|
||||
return-void
|
||||
.end method
|
||||
781
samples/Smali/PenguinSprite.smali
Normal file
781
samples/Smali/PenguinSprite.smali
Normal file
@@ -0,0 +1,781 @@
|
||||
.class public Lcom/tdq/game/shootbubble/sprite/PenguinSprite;
|
||||
.super Lcom/tdq/game/shootbubble/sprite/Sprite;
|
||||
.source "PenguinSprite.java"
|
||||
|
||||
|
||||
# static fields
|
||||
.field public static final LOST_SEQUENCE:[[I
|
||||
|
||||
.field public static final STATE_FIRE:I = 0x2
|
||||
|
||||
.field public static final STATE_GAME_LOST:I = 0x5
|
||||
|
||||
.field public static final STATE_GAME_WON:I = 0x4
|
||||
|
||||
.field public static final STATE_TURN_LEFT:I = 0x0
|
||||
|
||||
.field public static final STATE_TURN_RIGHT:I = 0x1
|
||||
|
||||
.field public static final STATE_VOID:I = 0x3
|
||||
|
||||
.field public static final WON_SEQUENCE:[[I
|
||||
|
||||
|
||||
# instance fields
|
||||
.field private count:I
|
||||
|
||||
.field private currentPenguin:I
|
||||
|
||||
.field private finalState:I
|
||||
|
||||
.field private nextPosition:I
|
||||
|
||||
.field private rand:Ljava/util/Random;
|
||||
|
||||
.field private spritesImage:Lcom/tdq/game/shootbubble/sprite/BmpWrap;
|
||||
|
||||
|
||||
# direct methods
|
||||
.method static constructor <clinit>()V
|
||||
.locals 8
|
||||
|
||||
.prologue
|
||||
const/4 v7, 0x4
|
||||
|
||||
const/4 v6, 0x3
|
||||
|
||||
const/4 v5, 0x1
|
||||
|
||||
const/4 v4, 0x0
|
||||
|
||||
const/4 v3, 0x2
|
||||
|
||||
.line 67
|
||||
const/16 v0, 0x8
|
||||
|
||||
new-array v0, v0, [[I
|
||||
|
||||
new-array v1, v3, [I
|
||||
|
||||
fill-array-data v1, :array_0
|
||||
|
||||
aput-object v1, v0, v4
|
||||
|
||||
new-array v1, v3, [I
|
||||
|
||||
fill-array-data v1, :array_1
|
||||
|
||||
aput-object v1, v0, v5
|
||||
|
||||
new-array v1, v3, [I
|
||||
|
||||
fill-array-data v1, :array_2
|
||||
|
||||
aput-object v1, v0, v3
|
||||
|
||||
new-array v1, v3, [I
|
||||
|
||||
fill-array-data v1, :array_3
|
||||
|
||||
aput-object v1, v0, v6
|
||||
|
||||
new-array v1, v3, [I
|
||||
|
||||
fill-array-data v1, :array_4
|
||||
|
||||
aput-object v1, v0, v7
|
||||
|
||||
const/4 v1, 0x5
|
||||
|
||||
new-array v2, v3, [I
|
||||
|
||||
fill-array-data v2, :array_5
|
||||
|
||||
aput-object v2, v0, v1
|
||||
|
||||
const/4 v1, 0x6
|
||||
|
||||
new-array v2, v3, [I
|
||||
|
||||
fill-array-data v2, :array_6
|
||||
|
||||
aput-object v2, v0, v1
|
||||
|
||||
const/4 v1, 0x7
|
||||
|
||||
new-array v2, v3, [I
|
||||
|
||||
fill-array-data v2, :array_7
|
||||
|
||||
aput-object v2, v0, v1
|
||||
|
||||
sput-object v0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->LOST_SEQUENCE:[[I
|
||||
|
||||
.line 69
|
||||
const/16 v0, 0x8
|
||||
|
||||
new-array v0, v0, [[I
|
||||
|
||||
new-array v1, v3, [I
|
||||
|
||||
fill-array-data v1, :array_8
|
||||
|
||||
aput-object v1, v0, v4
|
||||
|
||||
new-array v1, v3, [I
|
||||
|
||||
fill-array-data v1, :array_9
|
||||
|
||||
aput-object v1, v0, v5
|
||||
|
||||
new-array v1, v3, [I
|
||||
|
||||
fill-array-data v1, :array_a
|
||||
|
||||
aput-object v1, v0, v3
|
||||
|
||||
new-array v1, v3, [I
|
||||
|
||||
fill-array-data v1, :array_b
|
||||
|
||||
aput-object v1, v0, v6
|
||||
|
||||
new-array v1, v3, [I
|
||||
|
||||
fill-array-data v1, :array_c
|
||||
|
||||
aput-object v1, v0, v7
|
||||
|
||||
const/4 v1, 0x5
|
||||
|
||||
new-array v2, v3, [I
|
||||
|
||||
fill-array-data v2, :array_d
|
||||
|
||||
aput-object v2, v0, v1
|
||||
|
||||
const/4 v1, 0x6
|
||||
|
||||
new-array v2, v3, [I
|
||||
|
||||
fill-array-data v2, :array_e
|
||||
|
||||
aput-object v2, v0, v1
|
||||
|
||||
const/4 v1, 0x7
|
||||
|
||||
new-array v2, v3, [I
|
||||
|
||||
fill-array-data v2, :array_f
|
||||
|
||||
aput-object v2, v0, v1
|
||||
|
||||
sput-object v0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->WON_SEQUENCE:[[I
|
||||
|
||||
return-void
|
||||
|
||||
.line 67
|
||||
:array_0
|
||||
.array-data 4
|
||||
0x1
|
||||
0x0
|
||||
.end array-data
|
||||
|
||||
:array_1
|
||||
.array-data 4
|
||||
0x2
|
||||
0x8
|
||||
.end array-data
|
||||
|
||||
:array_2
|
||||
.array-data 4
|
||||
0x3
|
||||
0x9
|
||||
.end array-data
|
||||
|
||||
:array_3
|
||||
.array-data 4
|
||||
0x4
|
||||
0xa
|
||||
.end array-data
|
||||
|
||||
:array_4
|
||||
.array-data 4
|
||||
0x5
|
||||
0xb
|
||||
.end array-data
|
||||
|
||||
:array_5
|
||||
.array-data 4
|
||||
0x6
|
||||
0xc
|
||||
.end array-data
|
||||
|
||||
:array_6
|
||||
.array-data 4
|
||||
0x7
|
||||
0xd
|
||||
.end array-data
|
||||
|
||||
:array_7
|
||||
.array-data 4
|
||||
0x5
|
||||
0xe
|
||||
.end array-data
|
||||
|
||||
.line 69
|
||||
:array_8
|
||||
.array-data 4
|
||||
0x1
|
||||
0x0
|
||||
.end array-data
|
||||
|
||||
:array_9
|
||||
.array-data 4
|
||||
0x2
|
||||
0x7
|
||||
.end array-data
|
||||
|
||||
:array_a
|
||||
.array-data 4
|
||||
0x3
|
||||
0x6
|
||||
.end array-data
|
||||
|
||||
:array_b
|
||||
.array-data 4
|
||||
0x4
|
||||
0xf
|
||||
.end array-data
|
||||
|
||||
:array_c
|
||||
.array-data 4
|
||||
0x5
|
||||
0x10
|
||||
.end array-data
|
||||
|
||||
:array_d
|
||||
.array-data 4
|
||||
0x6
|
||||
0x11
|
||||
.end array-data
|
||||
|
||||
:array_e
|
||||
.array-data 4
|
||||
0x7
|
||||
0x12
|
||||
.end array-data
|
||||
|
||||
:array_f
|
||||
.array-data 4
|
||||
0x4
|
||||
0x13
|
||||
.end array-data
|
||||
.end method
|
||||
|
||||
.method public constructor <init>(Lcom/tdq/game/shootbubble/sprite/BmpWrap;Ljava/util/Random;)V
|
||||
.locals 6
|
||||
.param p1, "sprites" # Lcom/tdq/game/shootbubble/sprite/BmpWrap;
|
||||
.param p2, "rand" # Ljava/util/Random;
|
||||
|
||||
.prologue
|
||||
const/4 v5, 0x0
|
||||
|
||||
.line 85
|
||||
new-instance v0, Landroid/graphics/Rect;
|
||||
|
||||
const/16 v1, 0x169
|
||||
|
||||
const/16 v2, 0x1b4
|
||||
|
||||
const/16 v3, 0x1a0
|
||||
|
||||
const/16 v4, 0x1df
|
||||
|
||||
invoke-direct {v0, v1, v2, v3, v4}, Landroid/graphics/Rect;-><init>(IIII)V
|
||||
|
||||
invoke-direct {p0, v0}, Lcom/tdq/game/shootbubble/sprite/Sprite;-><init>(Landroid/graphics/Rect;)V
|
||||
|
||||
.line 87
|
||||
iput-object p1, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->spritesImage:Lcom/tdq/game/shootbubble/sprite/BmpWrap;
|
||||
|
||||
.line 88
|
||||
iput-object p2, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->rand:Ljava/util/Random;
|
||||
|
||||
.line 90
|
||||
iput v5, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->currentPenguin:I
|
||||
|
||||
.line 92
|
||||
const/4 v0, 0x3
|
||||
|
||||
iput v0, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->finalState:I
|
||||
|
||||
.line 93
|
||||
iput v5, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->nextPosition:I
|
||||
|
||||
.line 94
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method public constructor <init>(Lcom/tdq/game/shootbubble/sprite/BmpWrap;Ljava/util/Random;IIII)V
|
||||
.locals 5
|
||||
.param p1, "sprites" # Lcom/tdq/game/shootbubble/sprite/BmpWrap;
|
||||
.param p2, "rand" # Ljava/util/Random;
|
||||
.param p3, "currentPenguin" # I
|
||||
.param p4, "count" # I
|
||||
.param p5, "finalState" # I
|
||||
.param p6, "nextPosition" # I
|
||||
|
||||
.prologue
|
||||
.line 100
|
||||
new-instance v0, Landroid/graphics/Rect;
|
||||
|
||||
const/16 v1, 0x169
|
||||
|
||||
const/16 v2, 0x1b4
|
||||
|
||||
const/16 v3, 0x1a0
|
||||
|
||||
const/16 v4, 0x1df
|
||||
|
||||
invoke-direct {v0, v1, v2, v3, v4}, Landroid/graphics/Rect;-><init>(IIII)V
|
||||
|
||||
invoke-direct {p0, v0}, Lcom/tdq/game/shootbubble/sprite/Sprite;-><init>(Landroid/graphics/Rect;)V
|
||||
|
||||
.line 102
|
||||
iput-object p1, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->spritesImage:Lcom/tdq/game/shootbubble/sprite/BmpWrap;
|
||||
|
||||
.line 103
|
||||
iput-object p2, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->rand:Ljava/util/Random;
|
||||
|
||||
.line 104
|
||||
iput p3, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->currentPenguin:I
|
||||
|
||||
.line 105
|
||||
iput p4, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->count:I
|
||||
|
||||
.line 106
|
||||
iput p5, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->finalState:I
|
||||
|
||||
.line 107
|
||||
iput p6, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->nextPosition:I
|
||||
|
||||
.line 108
|
||||
return-void
|
||||
.end method
|
||||
|
||||
|
||||
# virtual methods
|
||||
.method public getTypeId()I
|
||||
.locals 1
|
||||
|
||||
.prologue
|
||||
.line 124
|
||||
sget v0, Lcom/tdq/game/shootbubble/sprite/Sprite;->TYPE_PENGUIN:I
|
||||
|
||||
return v0
|
||||
.end method
|
||||
|
||||
.method public paint(Landroid/graphics/Canvas;DII)V
|
||||
.locals 9
|
||||
.param p1, "c" # Landroid/graphics/Canvas;
|
||||
.param p2, "scale" # D
|
||||
.param p4, "dx" # I
|
||||
.param p5, "dy" # I
|
||||
|
||||
.prologue
|
||||
.line 183
|
||||
invoke-virtual {p0}, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->getSpriteArea()Landroid/graphics/Rect;
|
||||
|
||||
move-result-object v3
|
||||
|
||||
.line 184
|
||||
.local v3, "r":Landroid/graphics/Rect;
|
||||
iget-object v0, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->spritesImage:Lcom/tdq/game/shootbubble/sprite/BmpWrap;
|
||||
|
||||
const/16 v1, 0x168
|
||||
|
||||
iget v2, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->currentPenguin:I
|
||||
|
||||
rem-int/lit8 v2, v2, 0x4
|
||||
|
||||
mul-int/lit8 v2, v2, 0x39
|
||||
|
||||
sub-int/2addr v1, v2
|
||||
|
||||
const/16 v2, 0x1b3
|
||||
|
||||
iget v4, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->currentPenguin:I
|
||||
|
||||
div-int/lit8 v4, v4, 0x4
|
||||
|
||||
mul-int/lit8 v4, v4, 0x2d
|
||||
|
||||
sub-int/2addr v2, v4
|
||||
|
||||
move-object v4, p1
|
||||
|
||||
move-wide v5, p2
|
||||
|
||||
move v7, p4
|
||||
|
||||
move v8, p5
|
||||
|
||||
invoke-static/range {v0 .. v8}, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->drawImageClipped(Lcom/tdq/game/shootbubble/sprite/BmpWrap;IILandroid/graphics/Rect;Landroid/graphics/Canvas;DII)V
|
||||
|
||||
.line 188
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method public saveState(Landroid/os/Bundle;Ljava/util/Vector;)V
|
||||
.locals 5
|
||||
.param p1, "map" # Landroid/os/Bundle;
|
||||
.param p2, "saved_sprites" # Ljava/util/Vector;
|
||||
|
||||
.prologue
|
||||
const/4 v4, 0x1
|
||||
|
||||
const/4 v3, 0x0
|
||||
|
||||
.line 111
|
||||
invoke-virtual {p0}, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->getSavedId()I
|
||||
|
||||
move-result v0
|
||||
|
||||
const/4 v1, -0x1
|
||||
|
||||
if-eq v0, v1, :cond_0
|
||||
|
||||
.line 120
|
||||
:goto_0
|
||||
return-void
|
||||
|
||||
.line 114
|
||||
:cond_0
|
||||
invoke-super {p0, p1, p2}, Lcom/tdq/game/shootbubble/sprite/Sprite;->saveState(Landroid/os/Bundle;Ljava/util/Vector;)V
|
||||
|
||||
.line 115
|
||||
const-string v0, "%d-currentPenguin"
|
||||
|
||||
new-array v1, v4, [Ljava/lang/Object;
|
||||
|
||||
invoke-virtual {p0}, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->getSavedId()I
|
||||
|
||||
move-result v2
|
||||
|
||||
invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
||||
|
||||
move-result-object v2
|
||||
|
||||
aput-object v2, v1, v3
|
||||
|
||||
invoke-static {v0, v1}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
iget v1, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->currentPenguin:I
|
||||
|
||||
invoke-virtual {p1, v0, v1}, Landroid/os/Bundle;->putInt(Ljava/lang/String;I)V
|
||||
|
||||
.line 117
|
||||
const-string v0, "%d-count"
|
||||
|
||||
new-array v1, v4, [Ljava/lang/Object;
|
||||
|
||||
invoke-virtual {p0}, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->getSavedId()I
|
||||
|
||||
move-result v2
|
||||
|
||||
invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
||||
|
||||
move-result-object v2
|
||||
|
||||
aput-object v2, v1, v3
|
||||
|
||||
invoke-static {v0, v1}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
iget v1, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->count:I
|
||||
|
||||
invoke-virtual {p1, v0, v1}, Landroid/os/Bundle;->putInt(Ljava/lang/String;I)V
|
||||
|
||||
.line 118
|
||||
const-string v0, "%d-finalState"
|
||||
|
||||
new-array v1, v4, [Ljava/lang/Object;
|
||||
|
||||
invoke-virtual {p0}, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->getSavedId()I
|
||||
|
||||
move-result v2
|
||||
|
||||
invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
||||
|
||||
move-result-object v2
|
||||
|
||||
aput-object v2, v1, v3
|
||||
|
||||
invoke-static {v0, v1}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
iget v1, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->finalState:I
|
||||
|
||||
invoke-virtual {p1, v0, v1}, Landroid/os/Bundle;->putInt(Ljava/lang/String;I)V
|
||||
|
||||
.line 119
|
||||
const-string v0, "%d-nextPosition"
|
||||
|
||||
new-array v1, v4, [Ljava/lang/Object;
|
||||
|
||||
invoke-virtual {p0}, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->getSavedId()I
|
||||
|
||||
move-result v2
|
||||
|
||||
invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
||||
|
||||
move-result-object v2
|
||||
|
||||
aput-object v2, v1, v3
|
||||
|
||||
invoke-static {v0, v1}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
iget v1, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->nextPosition:I
|
||||
|
||||
invoke-virtual {p1, v0, v1}, Landroid/os/Bundle;->putInt(Ljava/lang/String;I)V
|
||||
|
||||
goto :goto_0
|
||||
.end method
|
||||
|
||||
.method public updateState(I)V
|
||||
.locals 6
|
||||
.param p1, "state" # I
|
||||
|
||||
.prologue
|
||||
const/4 v5, 0x7
|
||||
|
||||
const/4 v1, 0x3
|
||||
|
||||
const/4 v4, 0x4
|
||||
|
||||
const/4 v3, 0x1
|
||||
|
||||
const/4 v2, 0x0
|
||||
|
||||
.line 129
|
||||
iget v0, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->finalState:I
|
||||
|
||||
if-eq v0, v1, :cond_2
|
||||
|
||||
.line 130
|
||||
iget v0, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->count:I
|
||||
|
||||
add-int/lit8 v0, v0, 0x1
|
||||
|
||||
iput v0, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->count:I
|
||||
|
||||
.line 132
|
||||
iget v0, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->count:I
|
||||
|
||||
rem-int/lit8 v0, v0, 0x6
|
||||
|
||||
if-nez v0, :cond_0
|
||||
|
||||
.line 133
|
||||
iget v0, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->finalState:I
|
||||
|
||||
const/4 v1, 0x5
|
||||
|
||||
if-ne v0, v1, :cond_1
|
||||
|
||||
.line 134
|
||||
sget-object v0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->LOST_SEQUENCE:[[I
|
||||
|
||||
iget v1, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->nextPosition:I
|
||||
|
||||
aget-object v0, v0, v1
|
||||
|
||||
aget v0, v0, v3
|
||||
|
||||
iput v0, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->currentPenguin:I
|
||||
|
||||
.line 135
|
||||
sget-object v0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->LOST_SEQUENCE:[[I
|
||||
|
||||
iget v1, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->nextPosition:I
|
||||
|
||||
aget-object v0, v0, v1
|
||||
|
||||
aget v0, v0, v2
|
||||
|
||||
iput v0, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->nextPosition:I
|
||||
|
||||
.line 179
|
||||
:cond_0
|
||||
:goto_0
|
||||
return-void
|
||||
|
||||
.line 136
|
||||
:cond_1
|
||||
iget v0, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->finalState:I
|
||||
|
||||
if-ne v0, v4, :cond_0
|
||||
|
||||
.line 137
|
||||
sget-object v0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->WON_SEQUENCE:[[I
|
||||
|
||||
iget v1, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->nextPosition:I
|
||||
|
||||
aget-object v0, v0, v1
|
||||
|
||||
aget v0, v0, v3
|
||||
|
||||
iput v0, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->currentPenguin:I
|
||||
|
||||
.line 138
|
||||
sget-object v0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->WON_SEQUENCE:[[I
|
||||
|
||||
iget v1, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->nextPosition:I
|
||||
|
||||
aget-object v0, v0, v1
|
||||
|
||||
aget v0, v0, v2
|
||||
|
||||
iput v0, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->nextPosition:I
|
||||
|
||||
goto :goto_0
|
||||
|
||||
.line 142
|
||||
:cond_2
|
||||
iget v0, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->count:I
|
||||
|
||||
add-int/lit8 v0, v0, 0x1
|
||||
|
||||
iput v0, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->count:I
|
||||
|
||||
.line 144
|
||||
packed-switch p1, :pswitch_data_0
|
||||
|
||||
.line 170
|
||||
:cond_3
|
||||
:goto_1
|
||||
iget v0, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->count:I
|
||||
|
||||
const/16 v1, 0x64
|
||||
|
||||
if-le v0, v1, :cond_5
|
||||
|
||||
.line 171
|
||||
iput v5, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->currentPenguin:I
|
||||
|
||||
goto :goto_0
|
||||
|
||||
.line 146
|
||||
:pswitch_0
|
||||
iput v2, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->count:I
|
||||
|
||||
.line 147
|
||||
iput v1, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->currentPenguin:I
|
||||
|
||||
goto :goto_1
|
||||
|
||||
.line 150
|
||||
:pswitch_1
|
||||
iput v2, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->count:I
|
||||
|
||||
.line 151
|
||||
const/4 v0, 0x2
|
||||
|
||||
iput v0, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->currentPenguin:I
|
||||
|
||||
goto :goto_1
|
||||
|
||||
.line 154
|
||||
:pswitch_2
|
||||
iput v2, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->count:I
|
||||
|
||||
.line 155
|
||||
iput v3, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->currentPenguin:I
|
||||
|
||||
goto :goto_1
|
||||
|
||||
.line 158
|
||||
:pswitch_3
|
||||
iget v0, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->currentPenguin:I
|
||||
|
||||
if-lt v0, v4, :cond_4
|
||||
|
||||
iget v0, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->currentPenguin:I
|
||||
|
||||
if-le v0, v5, :cond_3
|
||||
|
||||
.line 159
|
||||
:cond_4
|
||||
iput v2, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->currentPenguin:I
|
||||
|
||||
goto :goto_1
|
||||
|
||||
.line 164
|
||||
:pswitch_4
|
||||
iput v2, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->count:I
|
||||
|
||||
.line 165
|
||||
iput p1, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->finalState:I
|
||||
|
||||
.line 166
|
||||
iput v2, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->currentPenguin:I
|
||||
|
||||
goto :goto_0
|
||||
|
||||
.line 172
|
||||
:cond_5
|
||||
iget v0, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->count:I
|
||||
|
||||
rem-int/lit8 v0, v0, 0xf
|
||||
|
||||
if-nez v0, :cond_0
|
||||
|
||||
iget v0, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->count:I
|
||||
|
||||
const/16 v1, 0x19
|
||||
|
||||
if-le v0, v1, :cond_0
|
||||
|
||||
.line 173
|
||||
iget-object v0, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->rand:Ljava/util/Random;
|
||||
|
||||
invoke-virtual {v0}, Ljava/util/Random;->nextInt()I
|
||||
|
||||
move-result v0
|
||||
|
||||
rem-int/lit8 v0, v0, 0x3
|
||||
|
||||
add-int/lit8 v0, v0, 0x4
|
||||
|
||||
iput v0, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->currentPenguin:I
|
||||
|
||||
.line 174
|
||||
iget v0, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->currentPenguin:I
|
||||
|
||||
if-ge v0, v4, :cond_0
|
||||
|
||||
.line 175
|
||||
iput v2, p0, Lcom/tdq/game/shootbubble/sprite/PenguinSprite;->currentPenguin:I
|
||||
|
||||
goto :goto_0
|
||||
|
||||
.line 144
|
||||
nop
|
||||
|
||||
:pswitch_data_0
|
||||
.packed-switch 0x0
|
||||
:pswitch_0
|
||||
:pswitch_1
|
||||
:pswitch_2
|
||||
:pswitch_3
|
||||
:pswitch_4
|
||||
:pswitch_4
|
||||
.end packed-switch
|
||||
.end method
|
||||
1179
samples/Smali/Subject.smali
Normal file
1179
samples/Smali/Subject.smali
Normal file
File diff suppressed because it is too large
Load Diff
4382
samples/Smali/ViewDragHelper.smali
Normal file
4382
samples/Smali/ViewDragHelper.smali
Normal file
File diff suppressed because it is too large
Load Diff
1863
samples/Smali/WbxmlSerializer.smali
Normal file
1863
samples/Smali/WbxmlSerializer.smali
Normal file
File diff suppressed because it is too large
Load Diff
5
samples/Thrift/linguist.thrift
Normal file
5
samples/Thrift/linguist.thrift
Normal file
@@ -0,0 +1,5 @@
|
||||
struct PullRequest {
|
||||
1: string title
|
||||
}
|
||||
|
||||
|
||||
28
samples/Unity3D Asset/GapTile.mat
Normal file
28
samples/Unity3D Asset/GapTile.mat
Normal file
@@ -0,0 +1,28 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 3
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name: GapTile
|
||||
m_Shader: {fileID: 10750, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_ShaderKeywords: []
|
||||
m_CustomRenderQueue: -1
|
||||
m_SavedProperties:
|
||||
serializedVersion: 2
|
||||
m_TexEnvs:
|
||||
data:
|
||||
first:
|
||||
name: _MainTex
|
||||
second:
|
||||
m_Texture: {fileID: 2800000, guid: e503f0c932121ce4881ab1605349488b, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Floats: {}
|
||||
m_Colors:
|
||||
data:
|
||||
first:
|
||||
name: _Color
|
||||
second: {r: 1, g: 1, b: 1, a: 1}
|
||||
157
samples/Unity3D Asset/Hover.anim
Normal file
157
samples/Unity3D Asset/Hover.anim
Normal file
@@ -0,0 +1,157 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!74 &7400000
|
||||
AnimationClip:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name: Hover
|
||||
serializedVersion: 4
|
||||
m_AnimationType: 1
|
||||
m_Compressed: 0
|
||||
m_UseHighQualityCurve: 1
|
||||
m_RotationCurves: []
|
||||
m_CompressedRotationCurves: []
|
||||
m_PositionCurves: []
|
||||
m_ScaleCurves:
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- time: 0
|
||||
value: {x: .25, y: .25, z: .25}
|
||||
inSlope: {x: 1.15384614, y: 1.15384614, z: 1.15384614}
|
||||
outSlope: {x: 1.15384614, y: 1.15384614, z: 1.15384614}
|
||||
tangentMode: 823140368
|
||||
- time: .649999976
|
||||
value: {x: 1, y: 1, z: 1}
|
||||
inSlope: {x: 1.15384614, y: 1.15384614, z: 1.15384614}
|
||||
outSlope: {x: 1.15384614, y: 1.15384614, z: 1.15384614}
|
||||
tangentMode: 0
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
path: Radius
|
||||
m_FloatCurves:
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- time: 0
|
||||
value: 1
|
||||
inSlope: -1.53846157
|
||||
outSlope: -1.53846157
|
||||
tangentMode: 10
|
||||
- time: .649999976
|
||||
value: 0
|
||||
inSlope: -1.53846157
|
||||
outSlope: -1.53846157
|
||||
tangentMode: 10
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
attribute: m_Color.a
|
||||
path: Radius
|
||||
classID: 212
|
||||
script: {fileID: 0}
|
||||
m_PPtrCurves: []
|
||||
m_SampleRate: 60
|
||||
m_WrapMode: 0
|
||||
m_Bounds:
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
m_Extent: {x: 0, y: 0, z: 0}
|
||||
m_ClipBindingConstant:
|
||||
genericBindings: []
|
||||
pptrCurveMapping: []
|
||||
m_AnimationClipSettings:
|
||||
serializedVersion: 2
|
||||
m_StartTime: 0
|
||||
m_StopTime: .649999976
|
||||
m_OrientationOffsetY: 0
|
||||
m_Level: 0
|
||||
m_CycleOffset: 0
|
||||
m_LoopTime: 0
|
||||
m_LoopBlend: 0
|
||||
m_LoopBlendOrientation: 0
|
||||
m_LoopBlendPositionY: 0
|
||||
m_LoopBlendPositionXZ: 0
|
||||
m_KeepOriginalOrientation: 0
|
||||
m_KeepOriginalPositionY: 1
|
||||
m_KeepOriginalPositionXZ: 0
|
||||
m_HeightFromFeet: 0
|
||||
m_Mirror: 0
|
||||
m_EditorCurves:
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- time: 0
|
||||
value: .25
|
||||
inSlope: 1.15384614
|
||||
outSlope: 1.15384614
|
||||
tangentMode: 10
|
||||
- time: .649999976
|
||||
value: 1
|
||||
inSlope: 1.15384614
|
||||
outSlope: 1.15384614
|
||||
tangentMode: 10
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
attribute: m_LocalScale.x
|
||||
path: Radius
|
||||
classID: 4
|
||||
script: {fileID: 0}
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- time: 0
|
||||
value: .25
|
||||
inSlope: 1.15384614
|
||||
outSlope: 1.15384614
|
||||
tangentMode: 10
|
||||
- time: .649999976
|
||||
value: 1
|
||||
inSlope: 1.15384614
|
||||
outSlope: 1.15384614
|
||||
tangentMode: 10
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
attribute: m_LocalScale.y
|
||||
path: Radius
|
||||
classID: 4
|
||||
script: {fileID: 0}
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- time: 0
|
||||
value: .25
|
||||
inSlope: 1.15384614
|
||||
outSlope: 1.15384614
|
||||
tangentMode: 10
|
||||
- time: .649999976
|
||||
value: 1
|
||||
inSlope: 1.15384614
|
||||
outSlope: 1.15384614
|
||||
tangentMode: 10
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
attribute: m_LocalScale.z
|
||||
path: Radius
|
||||
classID: 4
|
||||
script: {fileID: 0}
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- time: 0
|
||||
value: 1
|
||||
inSlope: -1.53846157
|
||||
outSlope: -1.53846157
|
||||
tangentMode: 10
|
||||
- time: .649999976
|
||||
value: 0
|
||||
inSlope: -1.53846157
|
||||
outSlope: -1.53846157
|
||||
tangentMode: 10
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
attribute: m_Color.a
|
||||
path: Radius
|
||||
classID: 212
|
||||
script: {fileID: 0}
|
||||
m_EulerEditorCurves: []
|
||||
m_Events: []
|
||||
5
samples/Unity3D Asset/Tiles.meta
Normal file
5
samples/Unity3D Asset/Tiles.meta
Normal file
@@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9e5c401e9d1d5415fbf2854b29c004c4
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
||||
8
samples/Unity3D Asset/TimeManager.asset
Normal file
8
samples/Unity3D Asset/TimeManager.asset
Normal file
@@ -0,0 +1,8 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!5 &1
|
||||
TimeManager:
|
||||
m_ObjectHideFlags: 0
|
||||
Fixed Timestep: .0199999996
|
||||
Maximum Allowed Timestep: .333333343
|
||||
m_TimeScale: 1
|
||||
157
samples/Unity3D Asset/canvas_Fullscreen_Fader.prefab
Normal file
157
samples/Unity3D Asset/canvas_Fullscreen_Fader.prefab
Normal file
@@ -0,0 +1,157 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &100000
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
serializedVersion: 4
|
||||
m_Component:
|
||||
- 224: {fileID: 22400000}
|
||||
- 222: {fileID: 22200000}
|
||||
- 114: {fileID: 11400004}
|
||||
- 114: {fileID: 11400002}
|
||||
- 114: {fileID: 11400000}
|
||||
m_Layer: 5
|
||||
m_Name: Fader_Tint
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!1 &100002
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
serializedVersion: 4
|
||||
m_Component:
|
||||
- 224: {fileID: 22400002}
|
||||
- 223: {fileID: 22300000}
|
||||
m_Layer: 5
|
||||
m_Name: canvas_Fullscreen_Fader
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 100000}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 0e5786b8fa0564f23a168e1c45671759, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
fadeOut: 1
|
||||
alwaysUseClearAsStartColor: 0
|
||||
_fadeOnStart: 1
|
||||
_startFaded: 0
|
||||
_fadeOnStartDelay: 1
|
||||
_fadeTime: .800000012
|
||||
--- !u!114 &11400002
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 100000}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: c6d2a81ac2fb947e8a9aa86b4133fafd, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_toDeactivate: []
|
||||
--- !u!114 &11400004
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 100000}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 0}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: .996078432, g: .949019611, b: .862745106, a: 1}
|
||||
m_Sprite: {fileID: 0}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
--- !u!222 &22200000
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 100000}
|
||||
--- !u!223 &22300000
|
||||
Canvas:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 100002}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_RenderMode: 0
|
||||
m_Camera: {fileID: 0}
|
||||
m_PlaneDistance: 100
|
||||
m_PixelPerfect: 1
|
||||
m_ReceivesEvents: 1
|
||||
m_OverrideSorting: 0
|
||||
m_OverridePixelPerfect: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 1
|
||||
--- !u!224 &22400000
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 100000}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 22400002}
|
||||
m_RootOrder: 0
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: .5, y: .5}
|
||||
--- !u!224 &22400002
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 100002}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 0, y: 0, z: 0}
|
||||
m_Children:
|
||||
- {fileID: 22400000}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0, y: 0}
|
||||
--- !u!1001 &100100000
|
||||
Prefab:
|
||||
m_ObjectHideFlags: 1
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications: []
|
||||
m_RemovedComponents: []
|
||||
m_ParentPrefab: {fileID: 0}
|
||||
m_RootGameObject: {fileID: 100002}
|
||||
m_IsPrefabParent: 1
|
||||
m_IsExploded: 1
|
||||
12
samples/XML/Example.mdpolicy
Normal file
12
samples/XML/Example.mdpolicy
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<PolicySet name="Example.mdpolicy">
|
||||
<TextStylePolicy inheritsSet="VisualStudio" inheritsScope="text/plain" scope="text/x-csharp">
|
||||
<FileWidth>120</FileWidth>
|
||||
<TabsToSpaces>False</TabsToSpaces>
|
||||
<NoTabsAfterNonTabs>True</NoTabsAfterNonTabs>
|
||||
</TextStylePolicy>
|
||||
<DotNetNamingPolicy>
|
||||
<DirectoryNamespaceAssociation>None</DirectoryNamespaceAssociation>
|
||||
<ResourceNamePolicy>FileFormatDefault</ResourceNamePolicy>
|
||||
</DotNetNamingPolicy>
|
||||
</PolicySet>
|
||||
13
samples/XML/intellij.iml
Normal file
13
samples/XML/intellij.iml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="backend node_modules" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
4
samples/XML/point-3.1.gml
Normal file
4
samples/XML/point-3.1.gml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0"?>
|
||||
<gml:Point xmlns:gml="http://www.opengis.net/gml" srsName="urn:ogc:def:crs:EPSG::4326" gml:id="uuid.12b3c8bb-bc8a-4f83-9085-1a5f3280b8ba">
|
||||
<gml:pos>52.56 13.29</gml:pos>
|
||||
</gml:Point>
|
||||
4
samples/XML/point-3.2.gml
Normal file
4
samples/XML/point-3.2.gml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0"?>
|
||||
<gml:Point xmlns:gml="http://www.opengis.net/gml/3.2" srsName="urn:ogc:def:crs:EPSG::4326" gml:id="uuid.12b3c8bb-bc8a-4f83-9085-1a5f3280b8ba">
|
||||
<gml:pos>52.56 13.29</gml:pos>
|
||||
</gml:Point>
|
||||
@@ -188,14 +188,16 @@ def load_grammars(tmp_dir, source, all_scopes)
|
||||
scope = grammar['scopeName']
|
||||
|
||||
if all_scopes.key?(scope)
|
||||
$stderr.puts "WARN: Duplicated scope #{scope}\n" +
|
||||
" Current package: #{p.url}\n" +
|
||||
" Previous package: #{all_scopes[scope]}"
|
||||
unless all_scopes[scope] == p.url
|
||||
$stderr.puts "WARN: Duplicated scope #{scope}\n" +
|
||||
" Current package: #{p.url}\n" +
|
||||
" Previous package: #{all_scopes[scope]}"
|
||||
end
|
||||
next
|
||||
end
|
||||
all_scopes[scope] = p.url
|
||||
grammar
|
||||
end
|
||||
end.compact
|
||||
end
|
||||
|
||||
def install_grammars(grammars, path)
|
||||
|
||||
175
test/fixtures/Shell/_bashrc
vendored
Normal file
175
test/fixtures/Shell/_bashrc
vendored
Normal file
@@ -0,0 +1,175 @@
|
||||
# vim: set ft=sh:
|
||||
|
||||
# encoding
|
||||
export LC_CTYPE='en_US.UTF-8'
|
||||
# terminal color
|
||||
export TERM=xterm-256color
|
||||
# prompt setup
|
||||
current_branch() {
|
||||
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'
|
||||
}
|
||||
parse_branch() {
|
||||
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
|
||||
}
|
||||
PS1='${debian_chroot:+($debian_chroot)}\[\e[00;32m\]\u@\h:\[\e[01;34m\]\W\[\033[01;35m\]$(parse_branch)\[\e[01;35m\]\[\e[0m\] $ '
|
||||
|
||||
google () {
|
||||
search=""
|
||||
echo "Googling: $@"
|
||||
for term in $@; do
|
||||
search="$search%20$term"
|
||||
done
|
||||
xdg-open "http://www.google.com/search?q=$search"
|
||||
}
|
||||
|
||||
# alias
|
||||
alias emacs='emacs -nw'
|
||||
alias eshell='emacs --execute "(term \"`which zsh`\")"'
|
||||
- () {
|
||||
cd -
|
||||
}
|
||||
alias ..='cd ..'
|
||||
alias ...='cd ../..'
|
||||
alias _=sudo
|
||||
alias afind='ack-grep -il'
|
||||
alias c=clear
|
||||
alias cd..='cd ..'
|
||||
alias cd...='cd ../..'
|
||||
alias cd....='cd ../../..'
|
||||
alias cd.....='cd ../../../..'
|
||||
alias d='dirs -v | head -10'
|
||||
alias emacs='emacs -nw'
|
||||
alias g=git
|
||||
alias ga='git add'
|
||||
alias gap='git add --patch'
|
||||
alias gb='git branch'
|
||||
alias gba='git branch -a'
|
||||
alias gbr='git branch --remote'
|
||||
alias gc='git commit -v'
|
||||
alias 'gc!'='git commit -v --amend'
|
||||
alias gca='git commit -v -a'
|
||||
alias 'gca!'='git commit -v -a --amend'
|
||||
alias gcl='git config --list'
|
||||
alias gclean='git reset --hard && git clean -dfx'
|
||||
alias gcln='git clone'
|
||||
alias gcm='git checkout master'
|
||||
alias gcmsg='git commit -m'
|
||||
alias gco='git checkout'
|
||||
alias gcount='git shortlog -sn'
|
||||
alias gcp='git cherry-pick'
|
||||
alias gcs='git commit -S'
|
||||
alias gd='git diff'
|
||||
alias gdc='git diff --cached'
|
||||
alias gdt='git difftool'
|
||||
alias gg='git gui citool'
|
||||
alias gga='git gui citool --amend'
|
||||
alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)'
|
||||
alias ggpull='git pull origin $(current_branch)'
|
||||
alias ggpur='git pull --rebase origin $(current_branch)'
|
||||
alias ggpush='git push origin $(current_branch)'
|
||||
alias gmpush='git push wkentaro $(current_branch)'
|
||||
alias gignore='git update-index --assume-unchanged'
|
||||
alias gignored='git ls-files -v | grep "^[[:lower:]]"'
|
||||
alias git=hub
|
||||
alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
|
||||
alias gk='gitk --all --branches'
|
||||
alias gl='git pull'
|
||||
alias glg='git log --stat --max-count=10'
|
||||
alias glgg='git log --graph --max-count=10'
|
||||
alias glgga='git log --graph --decorate --all'
|
||||
alias glo='git log --oneline --decorate --color'
|
||||
alias globurl='noglob urlglobber '
|
||||
alias glog='git log --oneline --decorate --color --graph'
|
||||
alias glp=_git_log_prettily
|
||||
alias gm='git merge'
|
||||
alias gmt='git mergetool --no-prompt'
|
||||
alias gp='git push'
|
||||
alias gpoat='git push origin --all && git push origin --tags'
|
||||
alias gr='git remote'
|
||||
alias grba='git rebase --abort'
|
||||
alias grbc='git rebase --continue'
|
||||
alias grbi='git rebase -i'
|
||||
alias grh='git reset HEAD'
|
||||
alias grhh='git reset HEAD --hard'
|
||||
alias grmv='git remote rename'
|
||||
alias grrm='git remote remove'
|
||||
alias grset='git remote set-url'
|
||||
alias grt='cd $(git rev-parse --show-toplevel || echo ".")'
|
||||
alias grup='git remote update'
|
||||
alias grv='git remote -v'
|
||||
alias gsd='git svn dcommit'
|
||||
alias gsps='git show --pretty=short --show-signature'
|
||||
alias gsr='git svn rebase'
|
||||
alias gss='git status -s'
|
||||
alias gst='git status'
|
||||
alias gsta='git stash'
|
||||
alias gstd='git stash drop'
|
||||
alias gstp='git stash pop'
|
||||
alias gsts='git stash show --text'
|
||||
alias gts='git tag -s'
|
||||
alias gunignore='git update-index --no-assume-unchanged'
|
||||
alias gunwip='git log -n 1 | grep -q -c "\-\-wip\-\-" && git reset HEAD~1'
|
||||
alias gup='git pull --rebase'
|
||||
alias gvt='git verify-tag'
|
||||
alias gwc='git whatchanged -p --abbrev-commit --pretty=medium'
|
||||
alias gwip='git add -A; git ls-files --deleted -z | xargs -r0 git rm; git commit -m "--wip--"'
|
||||
alias h=history
|
||||
alias history='fc -l 1'
|
||||
alias ipy=ipython
|
||||
alias sl='ls'
|
||||
alias l='ls -lah'
|
||||
alias la='ls -lAh'
|
||||
alias ll='ls -lh'
|
||||
alias lsa='ls -lah'
|
||||
alias md='mkdir -p'
|
||||
alias py=python
|
||||
alias please=sudo
|
||||
alias po=popd
|
||||
alias pu=pushd
|
||||
alias pyfind='find . -name "*.py"'
|
||||
alias pygrep='grep --include="*.py"'
|
||||
alias rd=rmdir
|
||||
alias v=vim
|
||||
alias vi=vim
|
||||
alias which-command=whence
|
||||
# hub
|
||||
if which hub >/dev/null 2>&1; then
|
||||
eval "$(hub alias -s)"
|
||||
fi
|
||||
# open
|
||||
if which open >/dev/null 2>&1; then
|
||||
alias o='open'
|
||||
alias o.='open .'
|
||||
elif which gnome-open >/dev/null 2>&1; then
|
||||
alias open='gnome-open'
|
||||
alias o='gnome-open'
|
||||
alias o.='gnome-open .'
|
||||
fi
|
||||
# ls
|
||||
if which dircolors >/dev/null 2>&1; then
|
||||
eval `dircolors $HOME/.colorrc`
|
||||
alias ls='ls --color=auto'
|
||||
fi
|
||||
[[ -s $HOME/.tmuxinator/scripts/tmuxinator ]] && source $HOME/.tmuxinator/scripts/tmuxinator
|
||||
|
||||
cd () {
|
||||
if [[ "x$*" = "x..." ]]
|
||||
then
|
||||
cd ../..
|
||||
elif [[ "x$*" = "x...." ]]
|
||||
then
|
||||
cd ../../..
|
||||
elif [[ "x$*" = "x....." ]]
|
||||
then
|
||||
cd ../../../..
|
||||
elif [[ "x$*" = "x......" ]]
|
||||
then
|
||||
cd ../../../../..
|
||||
elif [ -d ~/.autoenv ]
|
||||
then
|
||||
source ~/.autoenv/activate.sh
|
||||
autoenv_cd "$@"
|
||||
else
|
||||
builtin cd "$@"
|
||||
fi
|
||||
}
|
||||
@@ -217,6 +217,15 @@ class TestBlob < Minitest::Test
|
||||
assert sample_blob("Java/ProtocolBuffer.java").generated?
|
||||
assert sample_blob("Python/protocol_buffer_pb2.py").generated?
|
||||
assert sample_blob("Go/api.pb.go").generated?
|
||||
assert sample_blob("Go/embedded.go").generated?
|
||||
|
||||
# Apache Thrift generated code
|
||||
assert sample_blob("Python/gen-py-linguist-thrift.py").generated?
|
||||
assert sample_blob("Go/gen-go-linguist-thrift.go").generated?
|
||||
assert sample_blob("Java/gen-java-linguist-thrift.java").generated?
|
||||
assert sample_blob("JavaScript/gen-js-linguist-thrift.js").generated?
|
||||
assert sample_blob("Ruby/gen-rb-linguist-thrift.rb").generated?
|
||||
assert sample_blob("Objective-C/gen-cocoa-linguist-thrift.m").generated?
|
||||
|
||||
# Generated JNI
|
||||
assert sample_blob("C/jni_layer.h").generated?
|
||||
@@ -243,6 +252,9 @@ class TestBlob < Minitest::Test
|
||||
# Cython-generated C/C++
|
||||
assert sample_blob("C/sgd_fast.c").generated?
|
||||
assert sample_blob("C++/wrapper_inner.cpp").generated?
|
||||
|
||||
# Unity3D-generated metadata
|
||||
assert sample_blob("Unity3D Asset/Tiles.meta").generated?
|
||||
end
|
||||
|
||||
def test_vendored
|
||||
@@ -267,6 +279,9 @@ class TestBlob < Minitest::Test
|
||||
# Rails vendor/
|
||||
assert sample_blob("vendor/plugins/will_paginate/lib/will_paginate.rb").vendored?
|
||||
|
||||
# Vendor/
|
||||
assert sample_blob("Vendor/my_great_file.h").vendored?
|
||||
|
||||
# 'thirdparty' directory
|
||||
assert sample_blob("thirdparty/lib/main.c").vendored?
|
||||
|
||||
@@ -411,6 +426,9 @@ class TestBlob < Minitest::Test
|
||||
# Normalize
|
||||
assert sample_blob("some/asset/path/normalize.css").vendored?
|
||||
|
||||
# Carthage
|
||||
assert sample_blob('Carthage/blah').vendored?
|
||||
|
||||
# Cocoapods
|
||||
assert sample_blob('Pods/blah').vendored?
|
||||
|
||||
@@ -462,9 +480,15 @@ class TestBlob < Minitest::Test
|
||||
# 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?
|
||||
|
||||
# Fabric.io
|
||||
assert sample_blob("Fabric.framework/Fabric.h").vendored?
|
||||
|
||||
# Crashlytics
|
||||
assert sample_blob("Crashlytics.framework/Crashlytics.h").vendored?
|
||||
end
|
||||
|
||||
def test_documentation
|
||||
|
||||
@@ -48,8 +48,7 @@ class TestHeuristcs < Minitest::Test
|
||||
def test_pl_prolog_perl_by_heuristics
|
||||
assert_heuristics({
|
||||
"Prolog" => all_fixtures("Prolog/*.pl"),
|
||||
"Perl" => all_fixtures("Perl/*.pl"),
|
||||
"Perl" => ["Perl/perl-test.t"],
|
||||
"Perl" => all_fixtures("Perl/*.pl") + ["Perl/perl-test.t"],
|
||||
"Perl6" => all_fixtures("Perl6/*.pl")
|
||||
})
|
||||
end
|
||||
|
||||
2
vendor/grammars/AutoHotkey
vendored
2
vendor/grammars/AutoHotkey
vendored
Submodule vendor/grammars/AutoHotkey updated: 9b42c86e75...8a9bb55597
2
vendor/grammars/Docker.tmbundle
vendored
2
vendor/grammars/Docker.tmbundle
vendored
Submodule vendor/grammars/Docker.tmbundle updated: 8f28cd8714...8ff6e62c89
2
vendor/grammars/Elm.tmLanguage
vendored
2
vendor/grammars/Elm.tmLanguage
vendored
Submodule vendor/grammars/Elm.tmLanguage updated: f52478b0b6...8137f5a48c
2
vendor/grammars/Handlebars
vendored
2
vendor/grammars/Handlebars
vendored
Submodule vendor/grammars/Handlebars updated: 35d821569d...60532f35cf
2
vendor/grammars/IDL-Syntax
vendored
2
vendor/grammars/IDL-Syntax
vendored
Submodule vendor/grammars/IDL-Syntax updated: 3baeaeafac...ee1bded38b
2
vendor/grammars/InnoSetup
vendored
2
vendor/grammars/InnoSetup
vendored
Submodule vendor/grammars/InnoSetup updated: 875ba96c32...417c64d7b3
2
vendor/grammars/NimLime
vendored
2
vendor/grammars/NimLime
vendored
Submodule vendor/grammars/NimLime updated: e31e1f5329...4acce8b67b
1
vendor/grammars/SMT.tmbundle
vendored
Submodule
1
vendor/grammars/SMT.tmbundle
vendored
Submodule
Submodule vendor/grammars/SMT.tmbundle added at 5b8231f516
2
vendor/grammars/Sublime-Coq
vendored
2
vendor/grammars/Sublime-Coq
vendored
Submodule vendor/grammars/Sublime-Coq updated: 964eb8f914...0909903a9a
2
vendor/grammars/Sublime-Red
vendored
2
vendor/grammars/Sublime-Red
vendored
Submodule vendor/grammars/Sublime-Red updated: 085e0f43b3...def7baed85
2
vendor/grammars/Sublime-SQF-Language
vendored
2
vendor/grammars/Sublime-SQF-Language
vendored
Submodule vendor/grammars/Sublime-SQF-Language updated: 0313fbe6fb...6d0f3f6cee
2
vendor/grammars/SublimePapyrus
vendored
2
vendor/grammars/SublimePapyrus
vendored
Submodule vendor/grammars/SublimePapyrus updated: 9ae03977b6...db14899948
2
vendor/grammars/ada.tmbundle
vendored
2
vendor/grammars/ada.tmbundle
vendored
Submodule vendor/grammars/ada.tmbundle updated: c45eed4d5f...59bfc50221
2
vendor/grammars/api-blueprint-sublime-plugin
vendored
2
vendor/grammars/api-blueprint-sublime-plugin
vendored
Submodule vendor/grammars/api-blueprint-sublime-plugin updated: 4713b0e824...e5289f429b
2
vendor/grammars/asciidoc.tmbundle
vendored
2
vendor/grammars/asciidoc.tmbundle
vendored
Submodule vendor/grammars/asciidoc.tmbundle updated: 28063ea46c...2d3f7a4f58
1
vendor/grammars/atom-fsharp
vendored
Submodule
1
vendor/grammars/atom-fsharp
vendored
Submodule
Submodule vendor/grammars/atom-fsharp added at 55785b6af0
2
vendor/grammars/ats.sublime
vendored
2
vendor/grammars/ats.sublime
vendored
Submodule vendor/grammars/ats.sublime updated: 2565468fd4...d6317b2309
2
vendor/grammars/bro-sublime
vendored
2
vendor/grammars/bro-sublime
vendored
Submodule vendor/grammars/bro-sublime updated: 7a8983d93e...8219f5ee09
2
vendor/grammars/carto-atom
vendored
2
vendor/grammars/carto-atom
vendored
Submodule vendor/grammars/carto-atom updated: c00fb6c461...9895909323
2
vendor/grammars/ceylon-sublimetext
vendored
2
vendor/grammars/ceylon-sublimetext
vendored
Submodule vendor/grammars/ceylon-sublimetext updated: 070298013e...67ae76cfb1
2
vendor/grammars/chapel-tmbundle
vendored
2
vendor/grammars/chapel-tmbundle
vendored
Submodule vendor/grammars/chapel-tmbundle updated: d52e9b1417...03c5d25641
2
vendor/grammars/css.tmbundle
vendored
2
vendor/grammars/css.tmbundle
vendored
Submodule vendor/grammars/css.tmbundle updated: 2ce91736ca...94f7111c29
2
vendor/grammars/d.tmbundle
vendored
2
vendor/grammars/d.tmbundle
vendored
Submodule vendor/grammars/d.tmbundle updated: a6931961da...f7953e41fd
2
vendor/grammars/dart-sublime-bundle
vendored
2
vendor/grammars/dart-sublime-bundle
vendored
Submodule vendor/grammars/dart-sublime-bundle updated: 2914099c31...67f23dfef2
2
vendor/grammars/factor
vendored
2
vendor/grammars/factor
vendored
Submodule vendor/grammars/factor updated: 1d1ef9079c...0124e630f0
1
vendor/grammars/fsharpbinding
vendored
1
vendor/grammars/fsharpbinding
vendored
Submodule vendor/grammars/fsharpbinding deleted from e64619da3c
2
vendor/grammars/gap-tmbundle
vendored
2
vendor/grammars/gap-tmbundle
vendored
Submodule vendor/grammars/gap-tmbundle updated: 291a0469dd...ce4ff698eb
2
vendor/grammars/grace-tmbundle
vendored
2
vendor/grammars/grace-tmbundle
vendored
Submodule vendor/grammars/grace-tmbundle updated: 2fba162ce7...9e8bb893f0
2
vendor/grammars/graphviz.tmbundle
vendored
2
vendor/grammars/graphviz.tmbundle
vendored
Submodule vendor/grammars/graphviz.tmbundle updated: 2760230b50...d1d489f893
2
vendor/grammars/haxe-sublime-bundle
vendored
2
vendor/grammars/haxe-sublime-bundle
vendored
Submodule vendor/grammars/haxe-sublime-bundle updated: de60e51dc1...810b34b259
2
vendor/grammars/html.tmbundle
vendored
2
vendor/grammars/html.tmbundle
vendored
Submodule vendor/grammars/html.tmbundle updated: d1231e3da1...e87e8de648
2
vendor/grammars/idl.tmbundle
vendored
2
vendor/grammars/idl.tmbundle
vendored
Submodule vendor/grammars/idl.tmbundle updated: 95f17ac40b...91baae9134
2
vendor/grammars/jade-tmbundle
vendored
2
vendor/grammars/jade-tmbundle
vendored
Submodule vendor/grammars/jade-tmbundle updated: 4197de8b70...9ad91309a4
1
vendor/grammars/javadoc.tmbundle
vendored
1
vendor/grammars/javadoc.tmbundle
vendored
Submodule vendor/grammars/javadoc.tmbundle deleted from 5276d7a93f
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user