Compare commits

..

243 Commits

Author SHA1 Message Date
Adam Roben
470419d732 Merge pull request #1962 from github/bump-4.2.6
Bump to v4.2.6
2015-01-07 10:57:29 -05:00
Adam Roben
5b05653881 Bump to v4.2.6 2015-01-07 10:30:51 -05:00
Adam Roben
899dc07883 Merge pull request #1938 from floscher/carto-grammar
Add grammar for CartoCSS
2015-01-07 09:31:34 -05:00
Florian M. Schäfer
83dfd408e9 Update carto-grammar to current version (2ec5a89) 2015-01-07 15:27:40 +01:00
Florian M. Schäfer
417171cfe1 Don't pass JSON-files through csonc 2015-01-07 15:27:40 +01:00
Florian Schäfer
e8e82a1ca3 Add grammar for CartoCSS 2015-01-07 15:27:40 +01:00
Florian Schäfer
6843aa7cc8 Enable file extension .json for grammar files 2015-01-07 15:27:40 +01:00
Adam Roben
952acc983d Merge pull request #1958 from floscher/fix-convert-script
Fixes script/convert-grammars: require thread-gem and solve problem with visibility of variable p
2015-01-07 08:58:34 -05:00
Adam Roben
650f267be7 Merge pull request #1959 from floscher/licence
Allow British-English spelled LICENCE-files
2015-01-07 08:56:20 -05:00
Florian M. Schäfer
3ace4c57f7 Allow British-English LICENCE-files 2015-01-06 22:51:08 +01:00
Florian M. Schäfer
ab1b603c78 Require thread-gem and solve problem with visibility of variable p in convert-grammars
* The `thread`-gem is required for the script, because otherwise Ruby throws an error that `Queue` in line 259 is an uninitialized constant
* The variable `p` was previously in the same method with the status message saying `OK ‹path› ‹converted scopes›`. But `p` is now defined in load_grammars() and thus not visible when showing the OK-message in install_grammars(). This was solved by adding a path-parameter to install_grammars().
2015-01-06 22:06:55 +01:00
Adam Roben
8430f694e5 Merge pull request #1954 from github/test-grammar-licenses
Test that all grammar submodules have an appropriate license
2015-01-06 13:59:52 -05:00
Adam Roben
71f0cafc78 Update all submodules
This was done via `git submodule update --remote`.

Since Scalate.tmbundle now has a license we can remove it from the
whitelist.

* vendor/grammars/NimLime 9cef4b6...a7067c6 (1):
  > Added 'nim' to tmpl sublimetext highlighting

* vendor/grammars/Scalate.tmbundle 4f85314...0307535 (1):
  > Merge pull request #3 from aroben/patch-1

* vendor/grammars/fsharpbinding d097476...99d2e9a (2):
  > Merge pull request #917 from 7sharp9/CleanMacProjects
  > Merge pull request #916 from 7sharp9/ToolTipsLessBlocky

* vendor/grammars/language-clojure d649d9f...bae6eee (2):
  > Prepare 0.10.0 release
  > Rename scoped-properties/ to settings/

* vendor/grammars/language-coffee-script c6e8d33...d86c896 (2):
  > Prepare 0.39.0 release
  > Rename scoped-properties/ to settings/

* vendor/grammars/language-gfm 7b62290...6af44a0 (2):
  > Remove unneeded newline
  > Merge pull request #65 from braver/line-break

* vendor/grammars/language-javascript 6690feb...5157519 (2):
  > Prepare 0.53.0 release
  > Rename scoped-properties/ to settings/

* vendor/grammars/language-python f518e49...46072e3 (2):
  > Prepare 0.29.0 release
  > Rename scoped-properties/ to settings/

* vendor/grammars/language-shellscript cbec163...9839719 (2):
  > Prepare 0.12.0 release
  > Rename scoped-properties/ to settings/

* vendor/grammars/language-yaml eddd079...ce8b441 (2):
  > Prepare 0.22.0 release
  > Rename scoped-properties/ to settings/
2015-01-06 13:46:04 -05:00
Adam Roben
4614287a55 Test that all grammar submodules have an appropriate license
We require all grammars to have a license that permits redistribution. A
few existing grammars have been grandfathered in without a license (and
we're working to remedy that), but no new grammars should be added
without a license.
2015-01-06 13:44:11 -05:00
Adam Roben
f477f811df Extract TestGrammars#submodule_paths method 2015-01-06 13:43:50 -05:00
Adam Roben
95bb5a1ae4 Switch to the master branch of tenbits/sublime-mask
The master branch contains a license while the release branch does not.
Other than that they're nearly identical.
2015-01-06 13:43:37 -05:00
Adam Roben
70699037ae Merge pull request #1909 from github/scopes-test
Test that grammars.yml lists the right scopes for each submodule
2015-01-06 13:41:44 -05:00
Adam Roben
7edddec920 Make convert-grammars a little quieter
No need to say "Done" at the end. We're obviously done; the script is
exiting.
2015-01-06 13:39:18 -05:00
Adam Roben
8f3779c94c Update grammars.yml to match submodules
I should have done this in 2c2c4740a8.
2015-01-06 13:36:51 -05:00
Adam Roben
917bc48348 Use File.directory? to test for local directories
Some of our submodules end in ".tmLanguage", which we used to think
meant it was a file rather than a directory.
2015-01-06 13:31:26 -05:00
Adam Roben
581dc36c47 Ruby 1.9 compatibility for convert-grammars 2015-01-06 13:28:26 -05:00
Adam Roben
a4286ba950 Show stderr output when running convert-grammars
This will let us see why it's failing.
2015-01-06 13:28:26 -05:00
Adam Roben
5fa85f268f Ruby 1.9 compatibility 2015-01-06 13:28:26 -05:00
Adam Roben
ada6f6882a Test that grammars.yml lists the right scopes for each submodule
convert-grammars now supports a few flags that we can use to make it
dump out the YAML just for the local grammar submodules. We can then
compare this to the YAML that's actually in grammars.yml to check that
they're the same. If they aren't, grammars.yml needs to be updated.
This will help catch mistakes like using the wrong scope name.
2015-01-06 13:28:25 -05:00
Adam Roben
78a0030d46 download-grammars -> convert-grammars
Downloading is only a small part of what this script does. The main
thing it does is convert grammars to JSON.
2015-01-06 13:28:25 -05:00
Adam Roben
e2d6aecd81 Merge pull request #1956 from github/new-sass-grammar
Switch Sass grammar to nathos/sass-textmate-bundle
2015-01-06 13:26:09 -05:00
Patrik Affentranger
a2e99e8ddb Switch Sass grammar to nathos/sass-textmate-bundle
This provides better highlighting in many cases than the previous
grammar. See https://github.com/github/linguist/pull/1852.
2015-01-06 13:18:30 -05:00
Adam Roben
b499a074cf Merge pull request #1931 from github/travis-container
Opt in to container-based Travis CI builds
2015-01-06 13:02:53 -05:00
Adam Roben
188e579df7 Use a single git fetch invocation in CI 2015-01-06 12:56:08 -05:00
Adam Roben
d82e4801ff Use --with-icu-dir everywhere but Ruby 2.0
--with-icu-dir is broken on Ruby 2.0 due to
https://bugs.ruby-lang.org/issues/8074. Specifying
--with-icu-include/--with-icu-lib is broken on Ruby 2.1 and newer due to
https://github.com/bundler/bundler/pull/3338. So now we use
--with-icu-dir everywhere but Ruby 2.0.
2015-01-06 12:44:39 -05:00
Adam Roben
d258d146b8 Move before_install steps to a separate script 2015-01-06 12:44:14 -05:00
Adam Roben
ae6b0f0d40 Merge pull request #1953 from github/update-grammars
Update all grammar submodules
2015-01-06 10:18:52 -05:00
Adam Roben
2c2c4740a8 Update all grammar submodules
This was performed via `git submodule update --remote`.

* vendor/grammars/Agda.tmbundle 784f435...68a218c (1):
  > Merge pull request #1 from aroben/patch-1

* vendor/grammars/IDL-Syntax 9473b7f...3baeaea (1):
  > Merge pull request #3 from aroben/patch-1

* vendor/grammars/NimLime 7a2fb4e...9cef4b6 (4):
  > Updated command names
  > Updated generated documentation
  > renamed more from nimrod to nim
  > Renamed several files

* vendor/grammars/SCSS.tmbundle d6188e5...4147502 (1):
  > Merge pull request #181 from redgluten/master

* vendor/grammars/Sublime-VimL 6ab7e19...366fdc6 (1):
  > Merge pull request #2 from yous/fix-single-quoted-string

* vendor/grammars/factor 2dc5590...2453a78 (38):
  > json.writer: make sure we make hex values two digits zero padded.
  > json.writer: support escaping unicode > 0x10000.  Thanks @jonenst!
  > mason.git: fix status check.
  > compiler.cfg.*: new unit test vocabs
  > compiler.cfg.*: more docs
  > compiler.cfg.*: refactoring away the compute-global-sets word
  > compiler.cfg.*: docs and more tests
  > compiler.cfg.stacks.local: refactoring making stack-changes and height-changes take and return stuff instead of using variables and the make building
  > compiler.cfg.parallel-copy: docs
  > compiler.cfg.stacks.height: these words are unused
  > compiler.cfg.*: more compiler docs
  > compiler.cfg.stacks.finalize: initial docs
  > io.launcher: fix stack effects.
  > io.launcher: fix docs for with-process-reader and with-process-writer.
  > io.launcher: add versions of with-process that preserve process and status.
  > mason.git: fix use.
  > mason.git: fix for rename.
  > io.launcher: cleanup public interface, make some things private or internal.
  > gopher: set 1 minute timeout by default.
  > brainfuck: cleanup tests.
  > json.writer: don't escape spaces, thats weird.
  > unix: some using cleanups.
  > python: rename startup/shutdown hooks.
  > math.extras: adding the Möbius function.
  > alien.c-types: move definitions of stdint.h from unix.types.
  > gopher: use contents now that it works.
  > io.ports: Make buffered-port not have a length because of Linux virtual files and TCP sockets. Related to issues #1256 and #1259.
  > tools.deploy.backend: add word for deleting cached staging images.
  > command-line: save the executable in a variable so that people don't use (command-line) directly if possible.
  > bootstrap: fix this use of (command-line).
  > tools.deploy.shaker: set the rest of the args to preserve current behavior.
  > vm: store full command-line including executable first argument.
  > gopher: fix bug where empty lines weren't printed properly in menus.
  > gopher: simplify.
  > gopher: change gopher-text to use split1.
  > io.encodings.detect: simplify prolog-tag.
  > gopher: add way to get result without converting to objects.
  > tools.disassembler: allow disassemble of compose and curry.

* vendor/grammars/fsharpbinding af755c8...d097476 (24):
  > Merge pull request #909 from cbowdon/issue877-vim-73-support
  > Merge pull request #913 from 7sharp9/Move_GetColourizations_toBg
  > Merge pull request #912 from 7sharp9/TryFind_opt
  > Merge pull request #911 from 7sharp9/FoldingParser
  > Merge pull request #908 from 7sharp9/TooltipOverhaul_AutoParamFix
  > Merge pull request #907 from 7sharp9/Movegetdefinestomodule
  > Merge pull request #906 from 7sharp9/tooltipfixforclosures
  > Merge pull request #905 from 7sharp9/ResolverProvider_singletimeout
  > Merge pull request #904 from fsharp/revert-903-ResolverProvider_singletimeout
  > Merge pull request #903 from 7sharp9/ResolverProvider_singletimeout
  > Merge pull request #902 from 7sharp9/ParameterCompletion_gatherTimeout
  > Merge pull request #901 from 7sharp9/Changed_invalidate_project
  > Merge pull request #900 from 7sharp9/Syntaxmode_removeextraoperation
  > Merge pull request #899 from 7sharp9/tooltips_ensureTimout
  > Merge pull request #898 from 7sharp9/pathextension_useAddRange
  > Merge pull request #897 from 7sharp9/resolverprovider_ensuretimout
  > Merge pull request #896 from 7sharp9/completion_ensuretimout
  > Merge pull request #895 from cbowdon/894-Vim-fix-for-no-completions-stacktrace
  > Merge pull request #890 from wangzq/gotodecl
  > Merge pull request #893 from 7sharp9/fixfortooltipvaltypes
  > Merge pull request #892 from 7sharp9/fixforprojecttypechecking
  > Added correct indentation
  > Merge pull request #891 from 7sharp9/ImproveImplementInterface
  > Merge pull request #888 from VincentDondain/master

* vendor/grammars/haxe-sublime-bundle 58cad47...e2613bb (4):
  > fixed goto definition / find type
  > clean
  > adaptations for toplevel completion
  > first test

* vendor/grammars/language-gfm c6df027...7b62290 (7):
  > Prepare 0.59.0 release
  > scoped-properties -> settings
  > Prepare 0.58.0 release
  > Merge pull request #67 from davidcelis/master
  > Prepare 0.57.0 release
  > Prepare 0.56.0 release
  > Merge pull request #64 from atom/mb-new-cpp-scope-name

* vendor/grammars/language-javascript 15dc5d1...6690feb (5):
  > Prepare 0.52.0 release
  > Merge pull request #82 from Hurtak/feature/snippets-for
  > Merge pull request #80 from Hurtak/feature/snippets-querySelector
  > Merge pull request #79 from Hurtak/feature/snippets-switch-indentation-fix
  > Merge pull request #81 from Hurtak/feature/snippets-iife

* vendor/grammars/language-python 476a353...f518e49 (5):
  > Prepare 0.28.0 release
  > Use trailing scope name
  > Merge pull request #48 from msabramo/patch-1
  > Prepare 0.27.0 release
  > Add pattern for nonlocal keyword

* vendor/grammars/language-sass 064a8b5...33efa33 (2):
  > Prepare 0.29.0 release
  > Allow + and - in selector argument

* vendor/grammars/language-shellscript e2d62af...cbec163 (2):
  > Prepare 0.11.0 release
  > Merge pull request #4 from hd-deman/patch-1

* vendor/grammars/latex.tmbundle 682c4b7...52b2251 (42):
  > Replaced `python` with `python2.7` in shebangs
  > Make the preferences compatible with Python 3
  > Handle manual spacing in “Reformat” (Table)
  > Fix: Reformatting of table containing empty cells
  > Use more descriptive variable names in `format`
  > Add documentation to `reformat`
  > Fix doctest in `refresh_viewer`
  > Add tests for `reformat`
  > Ignore “exit discard” status in `cramtests`
  > Remove print statements from `reformat` function
  > Fix: Close log window option ignored
  > Automatically scroll to bottom in “HTML Output”
  > Handle “\” signs in the notification window
  > Fix missing logname in default error message
  > Extend list of auxiliary files
  > Remove unused code from `latex_watch`
  > Display default message in notification window
  > Sort error messages by line number
  > Do not store duplicate error messages anymore
  > Close notification window on cleanup
  > Improve reopening of closed notification windows
  > Improve rewrap code in `texparser`
  > Improve readability of verbose log output
  > Only parse log file if there were changes
  > Remove unnecessary function call in “LaTeX Watch”
  > Properly close file in `guess_tex_engine`
  > Handle log messages containing double quotes
  > Left justify severity in notification window
  > Handle manual closing of notification window
  > Add additional information to notification window
  > Remove unused code from `texparser`
  > Close notification when typesetting succeeds
  > Add support for notifications to “LaTeX Watch”
  > Update bundle preference values instantly
  > Make “Reformat” (Table) compatible with Ruby 2
  > Ignore escaped ampersand `\&` in “Format” (Table)
  > Remove warnings reported by `RuboCop`
  > Format code for “Reformat” (Table)
  > Move code for “Reformat” into separate script
  > Save “Reformat” command with TextMate 2
  > Remove unused import
  > Use explicit import in “Itemize Lines In Selection”

* vendor/grammars/mercury-tmlanguage b5a4fd6...eaef0b0 (8):
  > Add require_* and some, all keywords
  > Highlight %f format specifiers, `` as op
  > Correct implementation of '''', """" and 0'<char>
  > README.md: Mention GitHub grammar compatability
  > README.md: add resources and demonstration
  > reformatted whitespace; added foreign mods; missing keywords
  > Highlight variables, determ decls, more pragmas
  > no highlighting of variables, function names, type names, inst's, etc.

* vendor/grammars/sublime-mask 2f59519...632ff3c (4):
  > v0.8.7
  > v0.8.7
  > + expression in component nodes
  < v0.8.6

* vendor/grammars/swift.tmbundle 81a0164...3c7eac5 (9):
  > Use constant scope for booleans
  > Use storage scope instead of keyword
  > Correct typo in include
  > Revamp string literal matching
  > Improve punctuation scopes
  > Allow for functions without a body
  > Add simple folding markers for swift
  > Improved matching of capture specifiers
  > Add Support for UInt, Int[8|16|32|64] & Float80
2015-01-06 10:09:53 -05:00
Adam Roben
4428e62b99 Merge pull request #1950 from github/upstream-c-bundle
Switch back to textmate/c.tmbundle
2015-01-05 15:24:42 -05:00
Adam Roben
575ad0d8a2 Switch back to textmate/c.tmbundle
We were using a fork to get the fix for
https://github.com/textmate/c.tmbundle/pull/24 before it was merged
upstream. Now it's been merged so we can go back to the upstream
repository.
2015-01-05 15:07:28 -05:00
Arfon Smith
ec01672f6c Merge pull request #1866 from github/cpp-c-improvements
Better C++ regex
2015-01-03 11:23:20 -06:00
Arfon Smith
be6b1bb3ee Merge branch 'master' into cpp-c-improvements 2015-01-03 11:12:55 -06:00
Arfon Smith
6f4557a103 Updating Objective-C matchers and adding a sample C++ file 2015-01-03 11:10:24 -06:00
Arfon Smith
55132f2955 Merge pull request #1945 from thotypous/bluespec
Add Bluespec SystemVerilog grammar
2015-01-02 21:14:52 -06:00
Paulo Matias
ebdd2d4a23 Add Bluespec SystemVerilog Sublime Text grammar 2015-01-03 00:55:19 -02:00
Arfon Smith
4c63827517 Merge pull request #1942 from pchaigno/xml.dist
Add .xml.dist as a XML file extension
2015-01-02 17:07:32 -06:00
Paul Chaignon
8e6609c192 .xml.dist as an XML file extension 2015-01-02 22:29:44 +01:00
Adam Roben
1f1ffcbfa6 Merge pull request #1930 from github/minitest
Switch to Minitest::Test instead of Test::Unit::TestCase
2015-01-02 16:27:43 -05:00
Adam Roben
065dd713c1 Assert that generated files are detected correctly 2015-01-02 16:15:55 -05:00
Arfon Smith
71132d48ff Merge pull request #1922 from Mailaender/patch-2
Added support for Mono .dll.config XML files
2015-01-02 11:10:46 -06:00
Matthias Mailänder
d77e0c62c1 add a DllMap example file
www.mono-project.com/docs/advanced/pinvoke/dllmap/#example
2015-01-02 17:28:37 +01:00
Matthias Mailänder
e853c36039 Update languages.yml
add support for Mono .dll.config XML files
2015-01-02 17:28:36 +01:00
Brandon Keepers
2be3220824 Merge pull request #1940 from github/fix-multiple-extensions
Fix for extensions with multiple segments
2015-01-02 10:59:30 -05:00
Lars Brinkhoff
6ae39e50ae Fix #1731 to allow samples with multiple file extension segments. 2015-01-02 10:41:22 -05:00
Arfon Smith
c783acc973 Merge pull request #1937 from github/hack-highlighting
Update languages.yml for Hack syntax-highlighting
2015-01-02 07:38:24 -06:00
Arfon Smith
e5210b5137 Update languages.yml 2015-01-02 06:53:58 -06:00
Arfon Smith
41f0950c04 Merge pull request #1933 from floscher/patch-1
Added CartoCSS to languages.yml
2015-01-01 13:46:22 -06:00
Florian Schäfer
9f439cd7fb Added support for CartoCSS
Code sample was taken from https://github.com/gravitystorm
/openstreetmap-carto/blob/ae990905790a26ae8af107441ce9e85b60ea1266
/amenity-points.mss
2015-01-01 17:15:22 +01:00
Arfon Smith
c911c5c045 Merge pull request #1932 from deadfoxygrandpa/elm
Update Elm support by adding its own syntax highlighting
2015-01-01 09:16:29 -06:00
Alex Neslusan
27a7873e08 Add color to Elm language definition 2015-01-01 20:41:05 +08:00
Alex Neslusan
5fe233384e Update Elm support 2015-01-01 20:24:13 +08:00
Adam Roben
d42ad45423 Turn on the bundler cache
This should allow us to skip installing gems in most builds, shaving off
~40 seconds.
2014-12-31 15:42:34 -05:00
Adam Roben
84235478ef Download and install libicu-dev without using sudo
We tell apt-get to download it to vendor/apt and then install it into a
vendor/icu directory.

We should be able to just specify --with-icu-dir, but apparently Ruby
2.0 (but not 1.9 or 2.1 or 2.2) has a bug that requires us to use
--with-icu-include/--with-icu-lib instead. Otherwise it can't find the
ICU libraries.
2014-12-31 15:42:34 -05:00
Adam Roben
509b35a19f Opt in to container-based Travis CI builds
This should speed up our builds by providing lower latency, better
caching, and more resources on the build machine. See
http://docs.travis-ci.com/user/workers/container-based-infrastructure/.
2014-12-31 15:42:34 -05:00
Adam Roben
65296e86a3 Switch to Minitest::Test instead of Test::Unit::TestCase
This gives us a consistent test framework across all Ruby versions which
should help avoid errors that are only found when CI runs the tests on
different Rubies. (And this fixes an immediate bug where there's no
`skip` method in the version of test-unit we're currently using only on
Ruby 2.2.)
2014-12-31 15:26:26 -05:00
Adam Roben
c9b7bb73b9 Use test/helper.rb in test_file_blob.rb 2014-12-31 15:19:56 -05:00
Adam Roben
795f42cbaa Merge pull request #1832 from pchaigno/optimize-generated
Optimization of generated?
2014-12-31 15:19:43 -05:00
Arfon Smith
d540ec0cb8 Merge pull request #1928 from github/contributing-update
Update including explicit steps to resolve conflicts.
2014-12-31 11:38:48 -06:00
Arfon Smith
202cba1a14 Update CONTRIBUTING.md 2014-12-31 11:38:03 -06:00
Arfon Smith
20d5b81085 Merge pull request #1929 from github/1304-local
Take 2: Add support for .sls YAML files (SaltStack states)
2014-12-31 09:45:14 -06:00
Arfon Smith
d8b806592d Removing trailing slash 2014-12-31 08:27:40 -06:00
Arfon Smith
84f9b83fc2 Fixing up grammars 2014-12-31 08:25:56 -06:00
Arfon Smith
7cb5106656 Adding atom-salt gitsubmodule 2014-12-31 07:48:48 -06:00
Arfon Smith
6f21df7624 Merge branch 'master' into 1304-local
Conflicts:
	grammars.yml
2014-12-30 22:15:55 -06:00
Arfon Smith
4c7dc565e7 Update including explicit steps to resolve conflicts. 2014-12-30 20:52:48 -06:00
Adam Roben
3c60fba430 Merge pull request #1926 from github/sas-grammar
Added support for SAS syntax.
2014-12-30 07:26:32 -05:00
Roy Pardee
224eef9ffa Added support for SAS syntax. 2014-12-30 06:34:37 -05:00
Paul Chaignon
42beadcf34 Use an exception for tests on Generated.generated? 2014-12-28 17:00:13 +01:00
Brandon Keepers
80ed2d6d30 Merge pull request #1920 from pchaigno/webidl-grammar
Grammar for WebIDL
2014-12-27 14:55:47 -05:00
Paul Chaignon
c2bf6fe7f5 Grammar for WebIDL 2014-12-27 16:54:41 +01:00
Adam Roben
6f014f8638 Merge pull request #1896 from github/grammar-submodules
Move all grammars that use Git repos to submodules
2014-12-22 17:17:40 -05:00
Adam Roben
66ca5aca89 Init submodules in CI 2014-12-22 17:07:37 -05:00
Adam Roben
33afa30c30 Don't use question marks in struct fields
Apparently it doesn't work in Ruby 1.9.
2014-12-22 17:06:49 -05:00
Adam Roben
1634d787ec Use fast-submodule-update in CI
Hopefully this will speed up CI builds.
2014-12-22 16:58:59 -05:00
Adam Roben
df7b529e23 Set tracking branches for submodules that aren't tracking master
This will let us use `git submodule update --remote` to update the
submodules to the latest commit from the relevant branch.
2014-12-22 16:41:22 -05:00
Adam Roben
56d90bedd0 Sort grammars.yml 2014-12-22 16:36:35 -05:00
Brandon Keepers
8369d253f8 Move grammar sources to vendor/grammars 2014-12-22 16:28:58 -05:00
Adam Roben
516d3e226c Suggest adding/removing submodules from the repo 2014-12-22 15:50:33 -05:00
Adam Roben
47b785a8fd Initialize submodules before updating them
Initialization cannot happen in parallel because every submodule has to
get written to .git/config.
2014-12-19 16:05:17 -05:00
Adam Roben
6a2bf3fd2f Update submodules in parallel to speed up bootstrap
This runs 8 `git submodule update` processes in parallel, speeding up
bootstrap from 2 minutes to 30 seconds for me. (Obviously this is
dependent on bandwidth.)
2014-12-19 16:05:17 -05:00
Adam Roben
ff678642e6 Suggest running script/bootstrap before building gems
This ensures all our submodules are up to date as well.
2014-12-19 16:05:17 -05:00
Adam Roben
e3eb1b90c5 Test that grammars.yml agrees with the list of submodules
If any submodules are missing from grammars.yml, or are listed in
grammars.yml but missing from the repo, the test will fail.

Eventually it would be good to test that the scopes for each submodule
are accurate, but that will take some more work.
2014-12-19 16:05:17 -05:00
Adam Roben
49125f077c Update grammars.yml
This is just the result of running script/download-grammars.
2014-12-19 15:39:02 -05:00
Adam Roben
324031cb68 Sort grammars.yml 2014-12-19 15:39:02 -05:00
Adam Roben
f2ab426d38 Move all grammars that use Git repos to submodules
This makes it so we don't have to redownload all the grammars every time
we build the grammars gem. It will also let us verify that grammars.yml
is accurate in the future by checking it against the submodules on disk.

script/bootstrap now updates the submodules.
2014-12-19 15:39:02 -05:00
Brandon Keepers
587ab35d65 Merge pull request #1904 from github/remove-cached-gems
Remove cached gems
2014-12-19 11:27:10 -05:00
Brandon Keepers
16a6dda3dd Remove cached gems 2014-12-19 10:52:29 -05:00
Arfon Smith
15191b068d Merge pull request #1890 from github/cut-release-v4.2.4
Updating Linguist version for v4.2.4
2014-12-18 14:31:21 -08:00
Arfon Smith
ee9cc24e52 Longer timeout 2014-12-18 14:28:33 -08:00
Arfon Smith
0584fbf42b 4.2.5 2014-12-18 14:17:36 -08:00
Adam Roben
f5f9ccee7f Merge pull request #1895 from github/bootstrap-script
Add script/bootstrap
2014-12-18 12:20:26 -05:00
Adam Roben
0d183e2e89 Ignore vendor/gems
This is where script/bootstrap places the bundle.
2014-12-18 12:14:45 -05:00
Adam Roben
b9eacfefc8 Add script/bootstrap
This just runs Bundler with the right options. Maybe it will do more in
the future, like update submodules.
2014-12-18 12:13:32 -05:00
Arfon Smith
0239127db4 4.2.5b1 2014-12-18 08:02:24 -08:00
Arfon Smith
281d1ea91c Merge branch 'master' into cut-release-v4.2.4 2014-12-17 15:37:46 -08:00
Arfon Smith
df92ecaa55 Merge pull request #1891 from github/fix-grammars
Fix some bugs in grammars.yml
2014-12-17 15:35:30 -08:00
Adam Roben
60d40c8ad8 Update grammars.yml
I just ran script/download-grammars and these are the changes it made.
The most notable one is that we had the wrong scope listed for Markdown.
2014-12-17 16:39:03 -05:00
Adam Roben
f428c561c9 Remove the WebIDL grammar
This grammar uses the same scope name (source.idl) as our existing IDL
grammar. The wrong scope name was listed in grammars.yml which masked
this problem. https://github.com/andik/IDL-Syntax/pull/2 tracks getting
the grammar to use a different scope name; in the meantime we just won't
highlight these files.
2014-12-17 16:39:03 -05:00
Adam Roben
8fbb7a1d93 Sort grammars.yml 2014-12-17 16:39:03 -05:00
Adam Roben
e98223b2b3 Use raw links as little as possible
It's much cleaner and more robust to specify the repo URL instead of a
URL to an individual file. If the file gets moved we'll still be able to
find it if we're using the repo URL.

Where we do need raw links, we now use github.com/owner/repo/raw/*
because it looks a bit nicer and sorts better with non-raw links.
2014-12-17 16:39:03 -05:00
Adam Roben
410fe2843d Add some tests for grammars.yml
It must be sorted, because it will get re-sorted when
script/download-grammars is next run and that would clutter up diffs.
And it must not contain any duplicate scopes.
2014-12-17 16:39:02 -05:00
Arfon Smith
dc8d69e0f4 Updating Linguist version for v4.2.4 2014-12-17 10:31:51 -08:00
Arfon Smith
a056765e38 Merge pull request #1886 from Dadido3/patch-1
Add PureBasic
2014-12-17 10:28:46 -08:00
Adam Roben
4e7da98bfa Merge pull request #1875 from arctic5/patch-1
change ace mode of game maker language to c++
2014-12-17 08:59:21 -05:00
David Vogel
0a56f5282d Create Example_Sine.pb 2014-12-17 12:00:16 +01:00
Arfon Smith
04b9ca2fd4 Merge pull request #1797 from github/cs-smalltalk
Cs smalltalk
2014-12-17 04:47:37 -06:00
Arfon Smith
ddbe3df6de Merge pull request #1876 from Mailaender/patch-2
Added support for StyleCop XML configuration files
2014-12-16 21:29:55 -06:00
Arfon Smith
ab5c88a7f3 Merge pull request #1881 from hawkw/master
Add support for Jasmin JVM assembly
2014-12-16 21:29:19 -06:00
Arfon Smith
4046a0efe9 Merge pull request #1877 from sebgod/change-mercury-grammar
Added a more suitable grammar for Mercury
2014-12-16 21:27:10 -06:00
Arfon Smith
5aefc7cdff Merge pull request #1885 from github/gjtorikian-patch-1
Use atom/language-atom for the YAML grammar
2014-12-16 21:25:02 -06:00
David Vogel
70eb779ce5 Reduced PureBasic to .pb and .pbi 2014-12-16 22:19:56 +01:00
David Vogel
39f5d28348 Added PureBasic example 2014-12-16 21:12:13 +01:00
David Vogel
e70407f16b Added PureBasic 2014-12-16 20:34:32 +01:00
Garen Torikian
c25475296d Use atom/language-atom for the YAML grammar 2014-12-16 08:17:07 -08:00
Vicent Marti
e97b7454e9 grammars: Temporarily use vmg's fork for C.tmbundle 2014-12-16 17:02:09 +01:00
Hawk Weisman
735caa03b1 Fix empty sample file. 2014-12-15 22:47:11 -05:00
Hawk Weisman
f577aece08 Add Objective-J samples 2014-12-15 22:40:02 -05:00
Hawk Weisman
b7f1bfdb92 Put Jasmin entry in the right place. 2014-12-15 22:37:17 -05:00
Hawk Weisman
b5301e280b Add some samples of Jasmin assembly 2014-12-15 21:35:14 -05:00
Hawk Weisman
741816db52 Add Jasmin to languages.yml 2014-12-15 21:29:26 -05:00
Hawk Weisman
546a6e2a68 Add Jasmin textmate language 2014-12-15 21:27:06 -05:00
Sebastian Godelet
1be5e8c63e Added a more suitable grammar for Mercury 2014-12-15 10:31:50 +08:00
Matthias Mailänder
917a25317a sort alphabetically 2014-12-14 15:27:39 +01:00
Matthias Mailänder
949167e6ad add support for StyleCop XML configuration files 2014-12-14 13:04:31 +01:00
arctic
a359905a06 change ace mode of game maker language to c++ 2014-12-13 23:41:31 -08:00
Arfon Smith
4ce606306d Merge pull request #1871 from github/fish
Fish
2014-12-12 11:24:40 -06:00
Arfon Smith
707fcd29ea Merge branch 'master' into fish
Conflicts:
	grammars.yml
	lib/linguist/languages.yml
2014-12-12 11:22:24 -06:00
Arfon Smith
970cbe35b8 :blank: -> \t 2014-12-12 08:23:17 -06:00
Arfon Smith
fa9e8aa5c0 Merge branch 'master' into cpp-c-improvements 2014-12-12 08:21:32 -06:00
Brandon Keepers
a5e6d37049 Merge pull request #1859 from pchaigno/rc-interpreter
rc as a Shell interpreter for Plan 9
2014-12-11 22:49:27 -05:00
Arfon Smith
dacac135fb Merge pull request #1868 from github/no-language
No language
2014-12-11 21:23:02 -06:00
Arfon Smith
0ddf0d5d0d Merge branch 'master' into no-language
Conflicts:
	lib/linguist/heuristics.rb
2014-12-11 21:17:38 -06:00
Arfon Smith
90a5251fa7 Merge branch 'master' into cpp-c-improvements 2014-12-11 21:11:32 -06:00
Arfon Smith
a97c69e06f BitBake ace_mode 2014-12-11 21:10:57 -06:00
Arfon Smith
a323eb43ed Better C++ regex 2014-12-11 21:06:35 -06:00
Arfon Smith
79243b77fd Merge pull request #1129 from pchaigno/bitbake
Support of the BitBake language
2014-12-11 20:58:06 -06:00
Arfon Smith
5ab2720ddc Merge pull request #1865 from github/webidl
Webidl
2014-12-11 20:56:05 -06:00
Arfon Smith
c72a49b77f Whitespace 2014-12-11 20:52:44 -06:00
Arfon Smith
a0d92b80df Merge branch 'master' into webidl
Conflicts:
	grammars.yml
2014-12-11 20:52:17 -06:00
Arfon Smith
1a32a6252b Merge pull request #1861 from github/aroben-patch-1
Suggest reproducing highlighting errors in text editors
2014-12-11 20:45:33 -06:00
Arfon Smith
6df7cbaf6e Merge pull request #1864 from github/robrix-patch-1
Use atom/language-gfm’s Markdown grammar.
2014-12-11 20:44:37 -06:00
Rob Rix
0a90cd3a0a Remove the accidental “m”. 2014-12-11 16:38:10 -05:00
Rob Rix
c529939481 Use atom/language-gfm’s Markdown grammar.
We render [GitHub Flavoured Markdown](https://help.github.com/articles/github-flavored-markdown/) on the site. We can use Atom’s grammar to ensure that syntax highlighting uses the same dialect.
2014-12-11 16:29:36 -05:00
Paul Chaignon
db70630eaa Renamed text in Text 2014-12-11 12:51:09 -05:00
Adam Roben
24862d9759 Merge pull request #1863 from github/popular-integrity
Test that all popular languages exist
2014-12-11 12:31:08 -05:00
Adam Roben
cb5f2685cd Test that all popular languages exist
popular.yml listed "Bash" but should have been listing "Shell" instead.
There is no "Bash" language. Now CI will fail if this happens again.
2014-12-11 11:47:52 -05:00
Brandon Keepers
baa298873a Merge pull request #1854 from github/more-shebang-fixes
More shebang fixes
2014-12-11 10:40:11 -05:00
Adam Roben
a8f57d37bf Merge pull request #1860 from github/atom-sass-grammar
Use atom/language-sass's Sass grammar
2014-12-11 09:52:14 -05:00
Adam Roben
d97ee52f4e Suggest reproducing highlighting errors in text editors
This will make for more useful upstream bug reports.
2014-12-11 09:39:24 -05:00
Adam Roben
1cfdb6decd Use atom/language-sass's Sass grammar
This works better than the old Ruby Sass.tmbundle we were pulling from
svn.textmate.org.

atom/language-sass also contains an SCSS grammar, but I didn't switch to
using that grammar because it isn't obviously better than our current
one and I'm not an SCSS expert.
2014-12-11 09:35:33 -05:00
Paul Chaignon
f93272f0bd Move text files from fixtures to samples when possible 2014-12-10 20:09:14 -05:00
Paul Chaignon
e783e953d9 Merge branch 'master' into data-fixture-folder 2014-12-10 19:15:41 -05:00
Paul Chaignon
39cac919c7 rc as a Shell interpreter for Plan 9 2014-12-10 19:12:28 -05:00
Arfon Smith
fec82173d9 Merge pull request #1856 from lutoma/xelix-c-samples
Add a bunch of C header samples for the Bayesian classifier
2014-12-10 15:29:18 -06:00
Lukas Martini
35efed73d4 Add a bunch of C header samples for the Bayesian classifier 2014-12-10 20:28:20 +01:00
Brandon Keepers
21b8e16afc Use #start_with? for clarity 2014-12-10 12:05:37 -05:00
Brandon Keepers
6efee51101 Add missing test cases 2014-12-10 11:00:46 -05:00
Brandon Keepers
1490425ecb document shebang code 2014-12-10 11:00:41 -05:00
Brandon Keepers
afac6a918d Handle empty shebang with whitespace 2014-12-10 11:00:32 -05:00
Brandon Keepers
bf0e488c06 Test case for case causing error 2014-12-10 10:58:14 -05:00
othree
37c2bee3ae Follow #1831, change WebIDL ace_mode to 'text' 2014-12-10 14:18:25 +08:00
othree
4debcabb88 Add syntax define for WebIDL 2014-12-10 12:03:59 +08:00
Garen Torikian
5a0c637ad0 Merge pull request #1831 from github/return-nil-on-no-ace-mode
Set "missing" ace modes to `text`
2014-12-09 10:53:47 -08:00
othree
d91215680a Add WebIDL support and two sample file 2014-12-10 01:28:23 +08:00
Garen Torikian
0cbcbd4614 Set Public Key ace_mode to text 2014-12-09 09:16:51 -08:00
Garen Torikian
19135f08c3 Merge branch 'master' into return-nil-on-no-ace-mode 2014-12-09 09:13:02 -08:00
Brandon Keepers
855cc52f0f Merge pull request #1844 from pchaigno/pgp
Public Key as a language with .asc and .pub extensions
2014-12-09 11:24:18 -05:00
Garen Torikian
4e5da23474 Add warn message indicating deprecation 2014-12-09 08:20:15 -08:00
Arfon Smith
3cca4ec0ac Merge pull request #1848 from larsbrinkhoff/again_with_the_fortran
Improve FORTRAN heuristic.
2014-12-08 16:02:58 -06:00
Lars Brinkhoff
e393f7feb4 Improve FORTRAN heuristic. 2014-12-08 13:53:19 +01:00
Arfon Smith
b76ac7bab0 Merge pull request #1845 from lostcolony/patch-1
Adding 'erlang.mk' to vendor.yml exclusion list.
2014-12-07 17:45:48 -06:00
lostcolony
a3c842ba18 Adding erlang.mk to exclusion list.
Adding 'erlang.mk' to list of erlang bundles; it's seeing some adoption in the Erlang community for building Erlang apps, and at 1k lines of code at present can dominate an initial check-in, project skeleton, or small library.

See https://github.com/ninenines/erlang.mk for further details.
2014-12-07 16:41:56 -05:00
Paul Chaignon
1640370c9d Add Public Key as a language with .asc and .pub extensions 2014-12-07 10:37:25 -05:00
Garen Torikian
b6427fa05a Set text's ace_mode to text 2014-12-07 14:48:36 +02:00
Garen Torikian
2a04d854cc Merge branch 'master' into return-nil-on-no-ace-mode 2014-12-07 14:45:27 +02:00
Jorge Bucaran
6d190d7d7c Add Fish. (Fix* ace_mode: none) 2014-12-07 16:24:16 +09:00
Jorge Bucaran
b8a2bd595a Add Fish. (Update) 2014-12-07 15:57:46 +09:00
Paul Chaignon
8b7d5546f7 Merge branch 'master' into newlisp 2014-12-06 20:04:18 -05:00
Arfon Smith
299a9c7bc9 Merge pull request #1835 from tenbits/master
MaskLang: Use proper tm scope
2014-12-06 17:14:06 -06:00
Arfon Smith
37f8d5b5e1 Merge pull request #1834 from karel-brinda/master
Python syntax highlighting for Snakemake files
2014-12-06 17:11:51 -06:00
Arfon Smith
2a6a59c047 Merge pull request #1842 from pchaigno/ts
Add .ts as a XML extension for Qt translation files
2014-12-06 17:06:09 -06:00
Paul Chaignon
583392d179 Heuristic for .ts (TypeScript, XML) 2014-12-06 16:31:14 -05:00
Paul Chaignon
1488796779 .ts as a XML extension for Qt translation files 2014-12-06 15:41:13 -05:00
Paul Chaignon
7458a2f9ff Heuristic for .bb (BitBake, BlitzBasic) 2014-12-06 15:26:30 -05:00
Garen Torikian
348dab4b9f Update test to account for using text 2014-12-06 11:59:31 +02:00
Paul Chaignon
5c824e0771 Ace mode and grammar to none for BitBake after merge with master 2014-12-05 21:20:55 -05:00
Paul Chaignon
b9c88a758c Merge branch 'master' into bitbake 2014-12-05 19:35:48 -05:00
Paul Chaignon
a51d637e58 Error messages for tests on Generated 2014-12-05 17:53:19 -05:00
Karel Brinda
d002dfa70c Snakemake => Snakefile (Snakemake ... program, Snakefile ... file) 2014-12-05 23:46:37 +01:00
Karel Brinda
d118017d27 Correction of alphabet sorting of filenames 2014-12-05 23:36:25 +01:00
Alex Kit
d10d328eb1 MaskLang: Use proper tm scope 2014-12-05 23:13:01 +01:00
Karel Brinda
e472d7b8b1 Python syntax highlighting for Snakemake files 2014-12-05 20:00:52 +01:00
Brandon Keepers
a54d6f3a8a Merge pull request #1779 from larsbrinkhoff/fr
Disambiguate .fr between Frege, Forth, and plain text files
2014-12-05 08:18:24 -08:00
Paul Chaignon
67ccb24b41 Require test helper in generated test 2014-12-05 10:29:19 -05:00
Paul Chaignon
42ff3f58d9 Tests for Generated.generated? optimization 2014-12-05 11:38:03 -05:00
Garen Torikian
ad778571a2 This reject is no longer necessary 2014-12-05 16:57:55 +02:00
Garen Torikian
bb12b86445 Set missing ace_mode values to text
This makes it much easier to deal with when iterating over all the
languages, since `text` is a valid, non-highlighting lexer.
2014-12-05 16:56:55 +02:00
Garen Torikian
ab61b06c34 Reject Ace modes that are lacking a mode 2014-12-05 16:25:14 +02:00
Lars Brinkhoff
de6b2f3307 Add 'text' language with samples, and heuristics for .fr. 2014-12-05 12:19:36 +01:00
Lars Brinkhoff
5fd56c75d5 Add Forth extension .fr; and a sample. 2014-12-05 11:52:00 +01:00
Paul Chaignon
6aa70a3e93 Reorganize the methods called in generated? to only load the data in last resort 2014-12-05 01:22:38 -05:00
Paul Chaignon
93186947c2 Move binaries and text files from samples folder to fixtures 2014-12-04 23:48:05 -05:00
Paul Chaignon
77444284e3 Data folder in fixtures for files with no language 2014-12-04 19:14:44 -05:00
Paul Chaignon
6950b028df Ace mode for SaltStack 2014-12-04 15:06:35 -05:00
Paul Chaignon
565767ef42 Merge branch 'master' into saltstack-states 2014-12-04 15:05:52 -05:00
Garen Torikian
a1f26d64d5 Merge pull request #1762 from github/add-missing-ace-modes-for-popular-languages
Add missing `ace_mode` values wherever necessary
2014-12-04 21:46:58 +02:00
Paul Chaignon
be30e1c658 Grammar for .sls SaltStack files 2014-12-04 14:42:24 -05:00
Garen Torikian
3aec4dd2ea Adjust to ignore generated 2014-12-04 21:27:07 +02:00
Paul Chaignon
ed34caa565 Merge branch 'master' into saltstack-states 2014-12-04 14:14:05 -05:00
Garen Torikian
81b8c57bae Add Loomscript exclusion 2014-12-04 21:10:28 +02:00
Garen Torikian
0780b7239a Merge branch 'master' into add-missing-ace-modes-for-popular-languages 2014-12-04 21:09:46 +02:00
Garen Torikian
1a3177409c Merge master 2014-12-03 20:15:55 +02:00
Garen Torikian
de4b538d82 Update comment at the top of the file 2014-12-03 20:14:20 +02:00
Garen Torikian
dce00d01d9 Add missing ace_mode values 2014-12-01 15:54:33 +02:00
Garen Torikian
768ec76ff0 Merge master 2014-12-01 15:52:37 +02:00
Arfon Smith
8c841903a5 Merge branch 'master' into cs-smalltalk
Conflicts:
	lib/linguist/languages.yml
	lib/linguist/samples.json
2014-11-30 15:35:16 -06:00
Jorge Bucaran
d4888098e5 Add source.fish scope reference. 2014-11-29 07:39:19 +09:00
Jorge Bucaran
a349daeaeb Add fish tmBundle source. 2014-11-29 07:38:00 +09:00
Garen Torikian
7a57a0b594 What is this, Lisp? 2014-11-28 12:35:42 -08:00
Garen Torikian
66eabd8bdc Prefer Yajl.load 2014-11-28 12:34:02 -08:00
Garen Torikian
be82b55408 Simplify rescue catching 2014-11-28 12:33:43 -08:00
Garen Torikian
526ca1761a This require is no longer used 2014-11-28 12:33:37 -08:00
Garen Torikian
8655d966ad Make corrections from a bade merge resolution 2014-11-28 11:50:46 -08:00
Garen Torikian
3fb4973aab Add missing ace_modes (introduced from master) 2014-11-28 11:48:39 -08:00
Garen Torikian
1d4149168d Add Rake task to fetch ace_modes, and skip test if there's no internet 2014-11-28 11:48:26 -08:00
Garen Torikian
26ab33754f Merge master 2014-11-28 11:04:53 -08:00
Paul Chaignon
6739a1471b Remove samples.json following merge with master 2014-11-25 15:46:51 -05:00
Paul Chaignon
230d91ecd8 Merge branch 'master' into saltstack-states 2014-11-25 15:41:25 -05:00
Garen Torikian
4603f3b2e7 Update languages.yml to always include ace_mode 2014-11-24 11:38:51 -08:00
Garen Torikian
9d6b8b4715 Add test for catching missing ace_mode values 2014-11-24 10:58:13 -08:00
Garen Torikian
897c2c5ab6 Add missing ace_mode values wherever necessary 2014-11-23 21:16:21 -08:00
Paul Chaignon
f3d654a965 Merge branch 'master' into bitbake 2014-09-25 10:38:47 -04:00
Paul Chaignon
2e6aae0256 Merge branch 'master' into saltstack-states 2014-09-25 10:26:57 -04:00
Damien Pollet
bde19a76cc Re-generate samples.json 2014-08-07 15:24:57 +02:00
Damien Pollet
49ebf4b303 C# samples to disambiguate from Smalltalk 2014-08-07 14:43:35 +02:00
Damien Pollet
0017310dd1 Declare .cs as Smalltalk changeset 2014-08-06 22:27:30 +02:00
Paul Chaignon
35355b157c Add support for .sls YAML files (SaltStack states) 2014-06-22 15:28:49 +02:00
Paul Chaignon
81d9c682da Support of the BitBake language 2014-05-05 11:29:00 +02:00
317 changed files with 7866 additions and 1373 deletions

2
.gitignore vendored
View File

@@ -4,3 +4,5 @@ benchmark/
lib/linguist/samples.json
/grammars
/node_modules
test/fixtures/ace_modes.json
/vendor/gems/

536
.gitmodules vendored Normal file
View File

@@ -0,0 +1,536 @@
[submodule "vendor/grammars/go-tmbundle"]
path = vendor/grammars/go-tmbundle
url = https://github.com/AlanQuatermain/go-tmbundle
[submodule "vendor/grammars/PHP-Twig.tmbundle"]
path = vendor/grammars/PHP-Twig.tmbundle
url = https://github.com/Anomareh/PHP-Twig.tmbundle
[submodule "vendor/grammars/sublime-cirru"]
path = vendor/grammars/sublime-cirru
url = https://github.com/Cirru/sublime-cirru
[submodule "vendor/grammars/Sublime-Logos"]
path = vendor/grammars/Sublime-Logos
url = https://github.com/Cykey/Sublime-Logos
[submodule "vendor/grammars/SublimeBrainfuck"]
path = vendor/grammars/SublimeBrainfuck
url = https://github.com/Drako/SublimeBrainfuck
[submodule "vendor/grammars/awk-sublime"]
path = vendor/grammars/awk-sublime
url = https://github.com/JohnNilsson/awk-sublime
[submodule "vendor/grammars/Sublime-SQF-Language"]
path = vendor/grammars/Sublime-SQF-Language
url = https://github.com/JonBons/Sublime-SQF-Language
[submodule "vendor/grammars/SCSS.tmbundle"]
path = vendor/grammars/SCSS.tmbundle
url = https://github.com/MarioRicalde/SCSS.tmbundle
[submodule "vendor/grammars/Sublime-REBOL"]
path = vendor/grammars/Sublime-REBOL
url = https://github.com/Oldes/Sublime-REBOL
[submodule "vendor/grammars/Sublime-Inform"]
path = vendor/grammars/Sublime-Inform
url = https://github.com/PogiNate/Sublime-Inform
[submodule "vendor/grammars/autoitv3-tmbundle"]
path = vendor/grammars/autoitv3-tmbundle
url = https://github.com/Red-Nova-Technologies/autoitv3-tmbundle
[submodule "vendor/grammars/Sublime-VimL"]
path = vendor/grammars/Sublime-VimL
url = https://github.com/SalGnt/Sublime-VimL
[submodule "vendor/grammars/boo-sublime"]
path = vendor/grammars/boo-sublime
url = https://github.com/Shammah/boo-sublime
[submodule "vendor/grammars/ColdFusion"]
path = vendor/grammars/ColdFusion
url = https://github.com/SublimeText/ColdFusion
[submodule "vendor/grammars/NSIS"]
path = vendor/grammars/NSIS
url = https://github.com/SublimeText/NSIS
[submodule "vendor/grammars/NimLime"]
path = vendor/grammars/NimLime
url = https://github.com/Varriount/NimLime
[submodule "vendor/grammars/gradle.tmbundle"]
path = vendor/grammars/gradle.tmbundle
url = https://github.com/alkemist/gradle.tmbundle
[submodule "vendor/grammars/Sublime-Loom"]
path = vendor/grammars/Sublime-Loom
url = https://github.com/ambethia/Sublime-Loom
[submodule "vendor/grammars/VBDotNetSyntax"]
path = vendor/grammars/VBDotNetSyntax
url = https://github.com/angryant0007/VBDotNetSyntax
[submodule "vendor/grammars/cool-tmbundle"]
path = vendor/grammars/cool-tmbundle
url = https://github.com/anunayk/cool-tmbundle
[submodule "vendor/grammars/Docker.tmbundle"]
path = vendor/grammars/Docker.tmbundle
url = https://github.com/asbjornenge/Docker.tmbundle
[submodule "vendor/grammars/jasmin-sublime"]
path = vendor/grammars/jasmin-sublime
url = https://github.com/atmarksharp/jasmin-sublime
[submodule "vendor/grammars/language-clojure"]
path = vendor/grammars/language-clojure
url = https://github.com/atom/language-clojure
[submodule "vendor/grammars/language-coffee-script"]
path = vendor/grammars/language-coffee-script
url = https://github.com/atom/language-coffee-script
[submodule "vendor/grammars/language-csharp"]
path = vendor/grammars/language-csharp
url = https://github.com/atom/language-csharp
[submodule "vendor/grammars/language-gfm"]
path = vendor/grammars/language-gfm
url = https://github.com/atom/language-gfm
[submodule "vendor/grammars/language-javascript"]
path = vendor/grammars/language-javascript
url = https://github.com/atom/language-javascript
[submodule "vendor/grammars/language-python"]
path = vendor/grammars/language-python
url = https://github.com/atom/language-python
[submodule "vendor/grammars/language-shellscript"]
path = vendor/grammars/language-shellscript
url = https://github.com/atom/language-shellscript
[submodule "vendor/grammars/language-yaml"]
path = vendor/grammars/language-yaml
url = https://github.com/atom/language-yaml
[submodule "vendor/grammars/sublime-sourcepawn"]
path = vendor/grammars/sublime-sourcepawn
url = https://github.com/austinwagner/sublime-sourcepawn
[submodule "vendor/grammars/Sublime-Lasso"]
path = vendor/grammars/Sublime-Lasso
url = https://github.com/bfad/Sublime-Lasso
[submodule "vendor/grammars/chapel-tmbundle"]
path = vendor/grammars/chapel-tmbundle
url = https://github.com/bholt/chapel-tmbundle
[submodule "vendor/grammars/sublime-nginx"]
path = vendor/grammars/sublime-nginx
url = https://github.com/brandonwamboldt/sublime-nginx
[submodule "vendor/grammars/bro-sublime"]
path = vendor/grammars/bro-sublime
url = https://github.com/bro/bro-sublime
[submodule "vendor/grammars/sublime_man_page_support"]
path = vendor/grammars/sublime_man_page_support
url = https://github.com/carsonoid/sublime_man_page_support
[submodule "vendor/grammars/sublime-MuPAD"]
path = vendor/grammars/sublime-MuPAD
url = https://github.com/ccreutzig/sublime-MuPAD
[submodule "vendor/grammars/nesC.tmbundle"]
path = vendor/grammars/nesC.tmbundle
url = https://github.com/cdwilson/nesC.tmbundle
[submodule "vendor/grammars/racket-tmbundle"]
path = vendor/grammars/racket-tmbundle
url = https://github.com/christophevg/racket-tmbundle
[submodule "vendor/grammars/haxe-sublime-bundle"]
path = vendor/grammars/haxe-sublime-bundle
url = https://github.com/clemos/haxe-sublime-bundle
[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.tmbundle"]
path = vendor/grammars/powershell.tmbundle
url = https://github.com/davidpeckham/powershell.tmbundle
[submodule "vendor/grammars/jade-tmbundle"]
path = vendor/grammars/jade-tmbundle
url = https://github.com/davidrios/jade-tmbundle
[submodule "vendor/grammars/elixir-tmbundle"]
path = vendor/grammars/elixir-tmbundle
url = https://github.com/elixir-lang/elixir-tmbundle
[submodule "vendor/grammars/sublime-glsl"]
path = vendor/grammars/sublime-glsl
url = https://github.com/euler0/sublime-glsl
[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
[submodule "vendor/grammars/dart-sublime-bundle"]
path = vendor/grammars/dart-sublime-bundle
url = https://github.com/guillermooo/dart-sublime-bundle
[submodule "vendor/grammars/sublimetext-cuda-cpp"]
path = vendor/grammars/sublimetext-cuda-cpp
url = https://github.com/harrism/sublimetext-cuda-cpp
[submodule "vendor/grammars/pike-textmate"]
path = vendor/grammars/pike-textmate
url = https://github.com/hww3/pike-textmate
[submodule "vendor/grammars/ceylon-sublimetext"]
path = vendor/grammars/ceylon-sublimetext
url = https://github.com/jeancharles-roger/ceylon-sublimetext
[submodule "vendor/grammars/Sublime-Text-2-OpenEdge-ABL"]
path = vendor/grammars/Sublime-Text-2-OpenEdge-ABL
url = https://github.com/jfairbank/Sublime-Text-2-OpenEdge-ABL
[submodule "vendor/grammars/sublime-rust"]
path = vendor/grammars/sublime-rust
url = https://github.com/jhasse/sublime-rust
[submodule "vendor/grammars/sublime-befunge"]
path = vendor/grammars/sublime-befunge
url = https://github.com/johanasplund/sublime-befunge
[submodule "vendor/grammars/RDoc.tmbundle"]
path = vendor/grammars/RDoc.tmbundle
url = https://github.com/joshaven/RDoc.tmbundle
[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
[submodule "vendor/grammars/sublime-idris"]
path = vendor/grammars/sublime-idris
url = https://github.com/laughedelic/sublime-idris
[submodule "vendor/grammars/sublime-better-typescript"]
path = vendor/grammars/sublime-better-typescript
url = https://github.com/lavrton/sublime-better-typescript
[submodule "vendor/grammars/moonscript-tmbundle"]
path = vendor/grammars/moonscript-tmbundle
url = https://github.com/leafo/moonscript-tmbundle
[submodule "vendor/grammars/Isabelle.tmbundle"]
path = vendor/grammars/Isabelle.tmbundle
url = https://github.com/lsf37/Isabelle.tmbundle
[submodule "vendor/grammars/x86-assembly-textmate-bundle"]
path = vendor/grammars/x86-assembly-textmate-bundle
url = https://github.com/lunixbochs/x86-assembly-textmate-bundle
[submodule "vendor/grammars/Alloy.tmbundle"]
path = vendor/grammars/Alloy.tmbundle
url = https://github.com/macekond/Alloy.tmbundle
[submodule "vendor/grammars/opa.tmbundle"]
path = vendor/grammars/opa.tmbundle
url = https://github.com/mads379/opa.tmbundle
[submodule "vendor/grammars/scala.tmbundle"]
path = vendor/grammars/scala.tmbundle
url = https://github.com/mads379/scala.tmbundle
[submodule "vendor/grammars/mako-tmbundle"]
path = vendor/grammars/mako-tmbundle
url = https://github.com/marconi/mako-tmbundle
[submodule "vendor/grammars/gnuplot-tmbundle"]
path = vendor/grammars/gnuplot-tmbundle
url = https://github.com/mattfoster/gnuplot-tmbundle
[submodule "vendor/grammars/idl.tmbundle"]
path = vendor/grammars/idl.tmbundle
url = https://github.com/mgalloy/idl.tmbundle
[submodule "vendor/grammars/protobuf-tmbundle"]
path = vendor/grammars/protobuf-tmbundle
url = https://github.com/michaeledgar/protobuf-tmbundle
[submodule "vendor/grammars/Sublime-Coq"]
path = vendor/grammars/Sublime-Coq
url = https://github.com/mkolosick/Sublime-Coq
[submodule "vendor/grammars/Agda.tmbundle"]
path = vendor/grammars/Agda.tmbundle
url = https://github.com/mokus0/Agda.tmbundle
[submodule "vendor/grammars/Julia.tmbundle"]
path = vendor/grammars/Julia.tmbundle
url = https://github.com/nanoant/Julia.tmbundle
[submodule "vendor/grammars/assembly.tmbundle"]
path = vendor/grammars/assembly.tmbundle
url = https://github.com/nanoant/assembly.tmbundle
[submodule "vendor/grammars/ooc.tmbundle"]
path = vendor/grammars/ooc.tmbundle
url = https://github.com/nilium/ooc.tmbundle
[submodule "vendor/grammars/LiveScript.tmbundle"]
path = vendor/grammars/LiveScript.tmbundle
url = https://github.com/paulmillr/LiveScript.tmbundle
[submodule "vendor/grammars/sublime-tea"]
path = vendor/grammars/sublime-tea
url = https://github.com/pferruggiaro/sublime-tea
[submodule "vendor/grammars/puppet-textmate-bundle"]
path = vendor/grammars/puppet-textmate-bundle
url = https://github.com/puppet-textmate-bundle/puppet-textmate-bundle
[submodule "vendor/grammars/abap.tmbundle"]
path = vendor/grammars/abap.tmbundle
url = https://github.com/pvl/abap.tmbundle
[submodule "vendor/grammars/mercury-tmlanguage"]
path = vendor/grammars/mercury-tmlanguage
url = https://github.com/sebgod/mercury-tmlanguage
[submodule "vendor/grammars/mathematica-tmbundle"]
path = vendor/grammars/mathematica-tmbundle
url = https://github.com/shadanan/mathematica-tmbundle
[submodule "vendor/grammars/sublime-robot-plugin"]
path = vendor/grammars/sublime-robot-plugin
url = https://github.com/shellderp/sublime-robot-plugin
[submodule "vendor/grammars/actionscript3-tmbundle"]
path = vendor/grammars/actionscript3-tmbundle
url = https://github.com/simongregory/actionscript3-tmbundle
[submodule "vendor/grammars/Sublime-QML"]
path = vendor/grammars/Sublime-QML
url = https://github.com/skozlovf/Sublime-QML
[submodule "vendor/grammars/Slash.tmbundle"]
path = vendor/grammars/Slash.tmbundle
url = https://github.com/slash-lang/Slash.tmbundle
[submodule "vendor/grammars/factor"]
path = vendor/grammars/factor
url = https://github.com/slavapestov/factor
[submodule "vendor/grammars/ruby-slim.tmbundle"]
path = vendor/grammars/ruby-slim.tmbundle
url = https://github.com/slim-template/ruby-slim.tmbundle
[submodule "vendor/grammars/SublimeXtend"]
path = vendor/grammars/SublimeXtend
url = https://github.com/staltz/SublimeXtend
[submodule "vendor/grammars/Stata.tmbundle"]
path = vendor/grammars/Stata.tmbundle
url = https://github.com/statatmbundle/Stata.tmbundle
[submodule "vendor/grammars/Vala-TMBundle"]
path = vendor/grammars/Vala-TMBundle
url = https://github.com/technosophos/Vala-TMBundle
[submodule "vendor/grammars/ant.tmbundle"]
path = vendor/grammars/ant.tmbundle
url = https://github.com/textmate/ant.tmbundle
[submodule "vendor/grammars/antlr.tmbundle"]
path = vendor/grammars/antlr.tmbundle
url = https://github.com/textmate/antlr.tmbundle
[submodule "vendor/grammars/apache.tmbundle"]
path = vendor/grammars/apache.tmbundle
url = https://github.com/textmate/apache.tmbundle
[submodule "vendor/grammars/applescript.tmbundle"]
path = vendor/grammars/applescript.tmbundle
url = https://github.com/textmate/applescript.tmbundle
[submodule "vendor/grammars/asp.tmbundle"]
path = vendor/grammars/asp.tmbundle
url = https://github.com/textmate/asp.tmbundle
[submodule "vendor/grammars/bison.tmbundle"]
path = vendor/grammars/bison.tmbundle
url = https://github.com/textmate/bison.tmbundle
[submodule "vendor/grammars/capnproto.tmbundle"]
path = vendor/grammars/capnproto.tmbundle
url = https://github.com/textmate/capnproto.tmbundle
[submodule "vendor/grammars/cmake.tmbundle"]
path = vendor/grammars/cmake.tmbundle
url = https://github.com/textmate/cmake.tmbundle
[submodule "vendor/grammars/cpp-qt.tmbundle"]
path = vendor/grammars/cpp-qt.tmbundle
url = https://github.com/textmate/cpp-qt.tmbundle
[submodule "vendor/grammars/css.tmbundle"]
path = vendor/grammars/css.tmbundle
url = https://github.com/textmate/css.tmbundle
[submodule "vendor/grammars/d.tmbundle"]
path = vendor/grammars/d.tmbundle
url = https://github.com/textmate/d.tmbundle
[submodule "vendor/grammars/diff.tmbundle"]
path = vendor/grammars/diff.tmbundle
url = https://github.com/textmate/diff.tmbundle
[submodule "vendor/grammars/dylan.tmbundle"]
path = vendor/grammars/dylan.tmbundle
url = https://github.com/textmate/dylan.tmbundle
[submodule "vendor/grammars/eiffel.tmbundle"]
path = vendor/grammars/eiffel.tmbundle
url = https://github.com/textmate/eiffel.tmbundle
[submodule "vendor/grammars/erlang.tmbundle"]
path = vendor/grammars/erlang.tmbundle
url = https://github.com/textmate/erlang.tmbundle
[submodule "vendor/grammars/fortran.tmbundle"]
path = vendor/grammars/fortran.tmbundle
url = https://github.com/textmate/fortran.tmbundle
[submodule "vendor/grammars/gettext.tmbundle"]
path = vendor/grammars/gettext.tmbundle
url = https://github.com/textmate/gettext.tmbundle
[submodule "vendor/grammars/graphviz.tmbundle"]
path = vendor/grammars/graphviz.tmbundle
url = https://github.com/textmate/graphviz.tmbundle
[submodule "vendor/grammars/groovy.tmbundle"]
path = vendor/grammars/groovy.tmbundle
url = https://github.com/textmate/groovy.tmbundle
[submodule "vendor/grammars/haskell.tmbundle"]
path = vendor/grammars/haskell.tmbundle
url = https://github.com/textmate/haskell.tmbundle
[submodule "vendor/grammars/html.tmbundle"]
path = vendor/grammars/html.tmbundle
url = https://github.com/textmate/html.tmbundle
[submodule "vendor/grammars/ini.tmbundle"]
path = vendor/grammars/ini.tmbundle
url = https://github.com/textmate/ini.tmbundle
[submodule "vendor/grammars/io.tmbundle"]
path = vendor/grammars/io.tmbundle
url = https://github.com/textmate/io.tmbundle
[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
[submodule "vendor/grammars/json.tmbundle"]
path = vendor/grammars/json.tmbundle
url = https://github.com/textmate/json.tmbundle
[submodule "vendor/grammars/latex.tmbundle"]
path = vendor/grammars/latex.tmbundle
url = https://github.com/textmate/latex.tmbundle
[submodule "vendor/grammars/less.tmbundle"]
path = vendor/grammars/less.tmbundle
url = https://github.com/textmate/less.tmbundle
[submodule "vendor/grammars/lilypond.tmbundle"]
path = vendor/grammars/lilypond.tmbundle
url = https://github.com/textmate/lilypond.tmbundle
[submodule "vendor/grammars/lisp.tmbundle"]
path = vendor/grammars/lisp.tmbundle
url = https://github.com/textmate/lisp.tmbundle
[submodule "vendor/grammars/logtalk.tmbundle"]
path = vendor/grammars/logtalk.tmbundle
url = https://github.com/textmate/logtalk.tmbundle
[submodule "vendor/grammars/lua.tmbundle"]
path = vendor/grammars/lua.tmbundle
url = https://github.com/textmate/lua.tmbundle
[submodule "vendor/grammars/make.tmbundle"]
path = vendor/grammars/make.tmbundle
url = https://github.com/textmate/make.tmbundle
[submodule "vendor/grammars/matlab.tmbundle"]
path = vendor/grammars/matlab.tmbundle
url = https://github.com/textmate/matlab.tmbundle
[submodule "vendor/grammars/maven.tmbundle"]
path = vendor/grammars/maven.tmbundle
url = https://github.com/textmate/maven.tmbundle
[submodule "vendor/grammars/nemerle.tmbundle"]
path = vendor/grammars/nemerle.tmbundle
url = https://github.com/textmate/nemerle.tmbundle
[submodule "vendor/grammars/ninja.tmbundle"]
path = vendor/grammars/ninja.tmbundle
url = https://github.com/textmate/ninja.tmbundle
[submodule "vendor/grammars/objective-c.tmbundle"]
path = vendor/grammars/objective-c.tmbundle
url = https://github.com/textmate/objective-c.tmbundle
[submodule "vendor/grammars/ocaml.tmbundle"]
path = vendor/grammars/ocaml.tmbundle
url = https://github.com/textmate/ocaml.tmbundle
[submodule "vendor/grammars/pascal.tmbundle"]
path = vendor/grammars/pascal.tmbundle
url = https://github.com/textmate/pascal.tmbundle
[submodule "vendor/grammars/perl.tmbundle"]
path = vendor/grammars/perl.tmbundle
url = https://github.com/textmate/perl.tmbundle
[submodule "vendor/grammars/php-smarty.tmbundle"]
path = vendor/grammars/php-smarty.tmbundle
url = https://github.com/textmate/php-smarty.tmbundle
[submodule "vendor/grammars/php.tmbundle"]
path = vendor/grammars/php.tmbundle
url = https://github.com/textmate/php.tmbundle
[submodule "vendor/grammars/postscript.tmbundle"]
path = vendor/grammars/postscript.tmbundle
url = https://github.com/textmate/postscript.tmbundle
[submodule "vendor/grammars/processing.tmbundle"]
path = vendor/grammars/processing.tmbundle
url = https://github.com/textmate/processing.tmbundle
[submodule "vendor/grammars/prolog.tmbundle"]
path = vendor/grammars/prolog.tmbundle
url = https://github.com/textmate/prolog.tmbundle
[submodule "vendor/grammars/python-django.tmbundle"]
path = vendor/grammars/python-django.tmbundle
url = https://github.com/textmate/python-django.tmbundle
[submodule "vendor/grammars/r.tmbundle"]
path = vendor/grammars/r.tmbundle
url = https://github.com/textmate/r.tmbundle
[submodule "vendor/grammars/restructuredtext.tmbundle"]
path = vendor/grammars/restructuredtext.tmbundle
url = https://github.com/textmate/restructuredtext.tmbundle
[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
[submodule "vendor/grammars/scilab.tmbundle"]
path = vendor/grammars/scilab.tmbundle
url = https://github.com/textmate/scilab.tmbundle
[submodule "vendor/grammars/sql.tmbundle"]
path = vendor/grammars/sql.tmbundle
url = https://github.com/textmate/sql.tmbundle
[submodule "vendor/grammars/standard-ml.tmbundle"]
path = vendor/grammars/standard-ml.tmbundle
url = https://github.com/textmate/standard-ml.tmbundle
[submodule "vendor/grammars/swift.tmbundle"]
path = vendor/grammars/swift.tmbundle
url = https://github.com/textmate/swift.tmbundle
[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
[submodule "vendor/grammars/toml.tmbundle"]
path = vendor/grammars/toml.tmbundle
url = https://github.com/textmate/toml.tmbundle
[submodule "vendor/grammars/verilog.tmbundle"]
path = vendor/grammars/verilog.tmbundle
url = https://github.com/textmate/verilog.tmbundle
[submodule "vendor/grammars/xml.tmbundle"]
path = vendor/grammars/xml.tmbundle
url = https://github.com/textmate/xml.tmbundle
[submodule "vendor/grammars/smalltalk-tmbundle"]
path = vendor/grammars/smalltalk-tmbundle
url = https://github.com/tomas-stefano/smalltalk-tmbundle
[submodule "vendor/grammars/ioke-outdated"]
path = vendor/grammars/ioke-outdated
url = https://github.com/vic/ioke-outdated
[submodule "vendor/grammars/kotlin-sublime-package"]
path = vendor/grammars/kotlin-sublime-package
url = https://github.com/vkostyukov/kotlin-sublime-package
[submodule "vendor/grammars/c.tmbundle"]
path = vendor/grammars/c.tmbundle
url = https://github.com/textmate/c.tmbundle
[submodule "vendor/grammars/zephir-sublime"]
path = vendor/grammars/zephir-sublime
url = https://github.com/vmg/zephir-sublime
[submodule "vendor/grammars/llvm.tmbundle"]
path = vendor/grammars/llvm.tmbundle
url = https://github.com/whitequark/llvm.tmbundle
[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
[submodule "vendor/grammars/ebundles"]
path = vendor/grammars/ebundles
url = https://github.com/ericzou/ebundles
[submodule "vendor/grammars/sublime-mask"]
path = vendor/grammars/sublime-mask
url = https://github.com/tenbits/sublime-mask
[submodule "vendor/grammars/sublime_cobol"]
path = vendor/grammars/sublime_cobol
url = https://bitbucket.org/bitlang/sublime_cobol
[submodule "vendor/grammars/ruby.tmbundle"]
path = vendor/grammars/ruby.tmbundle
url = https://github.com/aroben/ruby.tmbundle
branch = pl
[submodule "vendor/grammars/IDL-Syntax"]
path = vendor/grammars/IDL-Syntax
url = https://github.com/andik/IDL-Syntax
[submodule "vendor/grammars/sas.tmbundle"]
path = vendor/grammars/sas.tmbundle
url = https://github.com/rpardee/sas.tmbundle
[submodule "vendor/grammars/atom-salt"]
path = vendor/grammars/atom-salt
url = https://github.com/saltstack/atom-salt
[submodule "vendor/grammars/Scalate.tmbundle"]
path = vendor/grammars/Scalate.tmbundle
url = https://github.com/scalate/Scalate.tmbundle
[submodule "vendor/grammars/Elm.tmLanguage"]
path = vendor/grammars/Elm.tmLanguage
url = https://github.com/deadfoxygrandpa/Elm.tmLanguage
[submodule "vendor/grammars/sublime-bsv"]
path = vendor/grammars/sublime-bsv
url = https://github.com/thotypous/sublime-bsv
[submodule "vendor/grammars/sass-textmate-bundle"]
path = vendor/grammars/sass-textmate-bundle
url = https://github.com/nathos/sass-textmate-bundle
[submodule "vendor/grammars/carto-atom"]
path = vendor/grammars/carto-atom
url = https://github.com/yohanboniface/carto-atom

View File

@@ -1,9 +1,5 @@
before_install:
- git fetch origin master:master
- git fetch origin v2.0.0:v2.0.0
- git fetch origin test/attributes:test/attributes
- git fetch origin test/master:test/master
- sudo apt-get install libicu-dev -y
sudo: false
before_install: script/travis/before_install
rvm:
- 1.9.3
- 2.0.0
@@ -11,3 +7,6 @@ rvm:
- 2.2
notifications:
disabled: true
git:
submodules: false
cache: bundler

View File

@@ -10,7 +10,7 @@ This can usually be solved either by adding a new filename or file name extensio
### Syntax highlighting looks wrong
Assuming your code is being detected as the right language (see above), in most cases this is due to a bug in the language grammar rather than a bug in Linguist. [`grammars.yml`][grammars] lists all the grammars we use for syntax highlighting on github.com. Find the one corresponding to your code's programming language and submit a bug report upstream.
Assuming your code is being detected as the right language (see above), in most cases this is due to a bug in the language grammar rather than a bug in Linguist. [`grammars.yml`][grammars] lists all the grammars we use for syntax highlighting on github.com. Find the one corresponding to your code's programming language and submit a bug report upstream. If you can, try to reproduce the highlighting problem in the text editor that the grammar is designed for (TextMate, Sublime Text, or Atom) and include that information in your bug report.
You can also try to fix the bug yourself and submit a Pull Request. [This piece from TextMate's documentation](http://manual.macromates.com/en/language_grammars) offers a good introduction on how to work with TextMate-compatible grammars. You can test grammars using [Lightshow](https://lightshow.githubapp.com).
@@ -21,9 +21,19 @@ Once the bug has been fixed upstream, please let us know and we'll pick it up fo
Great! You'll need to:
0. Add an entry for your language to [`languages.yml`][languages].
0. Add a grammar for your language to [`grammars.yml`][grammars] by running `script/download-grammars --add URL`. Please only add grammars that have a license that permits redistribution.
0. Add a grammar for your language. Please only add grammars that have a license that permits redistribution.
0. Add your grammar as a submodule: `git submodule add https://github.com/JaneSmith/MyGrammar vendor/grammars/MyGrammar`.
0. Add your grammar to [`grammars.yml`][grammars] by running `script/convert-grammars --add vendor/grammars/MyGrammar`.
0. Add samples for your language to the [samples directory][samples].
In addition, if your new language defines an extension that's already listed in [`languages.yml`][languages] (such as `.foo`) then sometimes a few more steps will need to be taken:
0. Make sure that example `.foo` files are present in the [samples directory][samples] for each language that uses `.foo`.
0. Test the performance of the Bayesian classifier with a relatively large number (1000s) of sample `.foo` 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 `.foo` files then a [heuristic](https://github.com/github/linguist/blob/master/lib/linguist/heuristics.rb) may need to be written to help.
Remember, the goal here is to try and avoid false positives!
We try only to add languages once they have some usage on GitHub, so please note in-the-wild usage examples in your pull request. In most cases we prefer that languages already be in use in hundreds of repositories before supporting them in Linguist.
[grammars]: /grammars.yml

View File

@@ -1,5 +1,4 @@
source 'https://rubygems.org'
gemspec :name => "github-linguist"
gemspec :name => "github-linguist-grammars"
gem 'test-unit', require: false if RUBY_VERSION >= '2.2'
gem 'byebug' if RUBY_VERSION >= '2.0'

View File

@@ -141,7 +141,7 @@ But for development you are going to want to checkout out the source. To get it,
git clone https://github.com/github/linguist.git
cd linguist/
bundle install
script/bootstrap
To run the tests:
@@ -181,7 +181,7 @@ Here's our current build status, which is hopefully green: [![Build Status](http
If you are the current maintainer of this gem:
0. Create a branch for the release: `git checkout -b cut-release-vxx.xx.xx`
0. Make sure your local dependencies are up to date: `bundle install`
0. Make sure your local dependencies are up to date: `script/bootstrap`
0. Ensure that samples are updated: `bundle exec rake samples`
0. Ensure that tests are green: `bundle exec rake test`
0. Bump gem version in `lib/linguist/version.rb`. For example, [like this](https://github.com/github/linguist/commit/8d2ea90a5ba3b2fe6e1508b7155aa4632eea2985).

View File

@@ -3,13 +3,14 @@ require 'rake/clean'
require 'rake/testtask'
require 'yaml'
require 'yajl'
require 'open-uri'
task :default => :test
Rake::TestTask.new
# Extend test task to check for samples
task :test => :check_samples
# Extend test task to check for samples and fetch latest Ace modes
task :test => [:check_samples, :fetch_ace_modes]
desc "Check that we have samples.json generated"
task :check_samples do
@@ -18,6 +19,20 @@ task :check_samples do
end
end
desc "Fetch the latest Ace modes from its GitHub repository"
task :fetch_ace_modes do
ACE_FIXTURE_PATH = File.join('test', 'fixtures', 'ace_modes.json')
File.delete(ACE_FIXTURE_PATH) if File.exist?(ACE_FIXTURE_PATH)
begin
ace_github_modes = open("https://api.github.com/repos/ajaxorg/ace/contents/lib/ace/mode").read
File.write(ACE_FIXTURE_PATH, ace_github_modes)
rescue OpenURI::HTTPError, SocketError
# no internet? no problem.
end
end
task :samples do
require 'linguist/samples'
json = Yajl.dump(Linguist::Samples.data, :pretty => true)
@@ -33,7 +48,7 @@ end
task :build_grammars_gem do
rm_rf "grammars"
sh "script/download-grammars"
sh "script/convert-grammars"
sh "gem", "build", "github-linguist-grammars.gemspec"
end

View File

@@ -18,6 +18,7 @@ Gem::Specification.new do |s|
s.add_dependency 'mime-types', '>= 1.19'
s.add_dependency 'rugged', '~> 0.22.0b4'
s.add_development_dependency 'minitest', '>= 5.0'
s.add_development_dependency 'mocha'
s.add_development_dependency 'pry'
s.add_development_dependency 'rake'

View File

@@ -9,8 +9,6 @@ http://svn.textmate.org/trunk/Review/Bundles/Forth.tmbundle:
- source.forth
http://svn.textmate.org/trunk/Review/Bundles/Parrot.tmbundle:
- source.parrot.pir
http://svn.textmate.org/trunk/Review/Bundles/Ruby%20Sass.tmbundle:
- source.sass
http://svn.textmate.org/trunk/Review/Bundles/SecondLife%20LSL.tmbundle:
- source.lsl
http://svn.textmate.org/trunk/Review/Bundles/VHDL.tmbundle:
@@ -20,403 +18,438 @@ http://svn.textmate.org/trunk/Review/Bundles/XQuery.tmbundle:
https://bitbucket.org/Clams/sublimesystemverilog/get/default.tar.gz:
- source.systemverilog
- source.ucfconstraints
https://bitbucket.org/bitlang/sublime_cobol/raw/b0e9c44ac5f7a2fb553421aa986b35854cbfda4a/COBOL.tmLanguage:
- source.cobol
https://fan.googlecode.com/hg-history/Build%201.0.55/adm/tools/textmate/Fan.tmbundle/Syntaxes/Fan.tmLanguage:
- source.fan
https://github.com/AlanQuatermain/go-tmbundle:
- source.go
https://github.com/Anomareh/PHP-Twig.tmbundle:
- text.html.twig
https://github.com/Cirru/sublime-cirru/raw/master/Cirru.tmLanguage:
- source.cirru
https://github.com/Cykey/Sublime-Logos:
- source.logos
https://github.com/Drako/SublimeBrainfuck/raw/master/Brainfuck.tmLanguage:
- source.bf
https://github.com/JohnNilsson/awk-sublime/raw/master/AWK.tmLanguage:
- source.awk
https://github.com/JonBons/Sublime-SQF-Language:
- source.sqf
https://github.com/MarioRicalde/SCSS.tmbundle:
- source.scss
https://github.com/Oldes/Sublime-REBOL:
- source.rebol
https://github.com/PogiNate/Sublime-Inform:
- source.Inform7
https://github.com/Red-Nova-Technologies/autoitv3-tmbundle:
- source.autoit.3
https://github.com/SalGnt/Sublime-VimL:
- source.viml
https://github.com/Shammah/boo-sublime/raw/master/Boo.tmLanguage:
- source.boo
https://github.com/SublimeText/ColdFusion:
vendor/grammars/Agda.tmbundle:
- source.agda
vendor/grammars/Alloy.tmbundle:
- source.alloy
vendor/grammars/ColdFusion:
- source.cfscript
- source.cfscript.cfc
- text.cfml.basic
- text.html.cfm
https://github.com/SublimeText/NSIS:
- source.nsis
https://github.com/Varriount/NimLime:
- source.nimrod
- source.nimrod_filter
- source.nimrodcfg
https://github.com/alkemist/gradle.tmbundle:
- source.groovy.gradle
https://github.com/ambethia/Sublime-Loom:
- source.loomscript
https://github.com/angryant0007/VBDotNetSyntax:
- source.vbnet
https://github.com/anunayk/cool-tmbundle:
- source.cool
https://github.com/aroben/ada.tmbundle/raw/c45eed4d5f98fe3bcbbffbb9e436601ab5bbde4b/Syntaxes/Ada.plist:
- source.ada
https://github.com/aroben/ruby.tmbundle@4636a3023153c3034eb6ffc613899ba9cf33b41f:
- source.ruby
- text.html.erb
https://github.com/asbjornenge/Docker.tmbundle:
vendor/grammars/Docker.tmbundle:
- source.dockerfile
https://github.com/atom/language-clojure:
- source.clojure
https://github.com/atom/language-coffee-script:
- source.coffee
- source.litcoffee
https://github.com/atom/language-csharp:
- source.cs
- source.csx
- source.nant-build
https://github.com/atom/language-javascript:
- source.js
- source.js.regexp
https://github.com/atom/language-python:
- source.python
- source.regexp.python
- text.python.traceback
https://github.com/atom/language-shellscript:
- source.shell
- text.shell-session
https://github.com/austinwagner/sublime-sourcepawn:
- source.sp
https://github.com/bfad/Sublime-Lasso:
vendor/grammars/Elm.tmLanguage:
- source.elm
vendor/grammars/Handlebars:
- text.html.handlebars
vendor/grammars/IDL-Syntax:
- source.webidl
vendor/grammars/Isabelle.tmbundle:
- source.isabelle.root
- source.isabelle.theory
vendor/grammars/Julia.tmbundle:
- source.julia
vendor/grammars/LiveScript.tmbundle:
- source.livescript
vendor/grammars/NSIS:
- source.nsis
vendor/grammars/NimLime:
- source.nim
- source.nim_filter
- source.nimcfg
vendor/grammars/PHP-Twig.tmbundle:
- text.html.twig
vendor/grammars/RDoc.tmbundle:
- text.rdoc
vendor/grammars/SCSS.tmbundle:
- source.scss
vendor/grammars/Scalate.tmbundle:
- source.scaml
- text.html.ssp
vendor/grammars/Slash.tmbundle:
- text.html.slash
vendor/grammars/Stata.tmbundle:
- source.mata
- source.stata
vendor/grammars/Sublime-Coq:
- source.coq
vendor/grammars/Sublime-Inform:
- source.Inform7
vendor/grammars/Sublime-Lasso:
- file.lasso
https://github.com/bholt/chapel-tmbundle:
- source.chapel
https://github.com/brandonwamboldt/sublime-nginx:
- source.nginx
https://github.com/bro/bro-sublime:
vendor/grammars/Sublime-Logos:
- source.logos
vendor/grammars/Sublime-Loom:
- source.loomscript
vendor/grammars/Sublime-QML:
- source.qml
vendor/grammars/Sublime-REBOL:
- source.rebol
vendor/grammars/Sublime-SQF-Language:
- source.sqf
vendor/grammars/Sublime-Text-2-OpenEdge-ABL:
- source.abl
vendor/grammars/Sublime-VimL:
- source.viml
vendor/grammars/SublimeBrainfuck:
- source.bf
vendor/grammars/SublimeXtend:
- source.xtend
vendor/grammars/Textmate-Gosu-Bundle:
- source.gosu.2
vendor/grammars/VBDotNetSyntax:
- source.vbnet
vendor/grammars/Vala-TMBundle:
- source.vala
vendor/grammars/abap.tmbundle:
- source.abap
vendor/grammars/actionscript3-tmbundle:
- source.actionscript.3
- text.html.asdoc
- text.xml.flex-config
vendor/grammars/ada.tmbundle:
- source.ada
vendor/grammars/ant.tmbundle:
- text.xml.ant
vendor/grammars/antlr.tmbundle:
- source.antlr
vendor/grammars/apache.tmbundle:
- source.apache-config
- source.apache-config.mod_perl
vendor/grammars/applescript.tmbundle:
- source.applescript
vendor/grammars/asp.tmbundle:
- source.asp
- text.html.asp
vendor/grammars/assembly.tmbundle:
- objdump.x86asm
- source.x86asm
vendor/grammars/atom-salt:
- source.python.salt
- source.yaml.salt
vendor/grammars/autoitv3-tmbundle:
- source.autoit.3
vendor/grammars/awk-sublime:
- source.awk
vendor/grammars/bison.tmbundle:
- source.bison
vendor/grammars/boo-sublime:
- source.boo
vendor/grammars/bro-sublime:
- source.bro
https://github.com/carsonoid/sublime_man_page_support/raw/master/man-groff.tmLanguage:
- text.groff
https://github.com/ccreutzig/sublime-MuPAD:
- source.mupad
https://github.com/cdwilson/nesC.tmbundle:
- source.nesc
https://github.com/christophevg/racket-tmbundle:
- source.racket
https://github.com/clemos/haxe-sublime-bundle:
vendor/grammars/c.tmbundle:
- source.c
- source.c++
- source.c.platform
vendor/grammars/capnproto.tmbundle:
- source.capnp
vendor/grammars/carto-atom:
- source.css.mss
vendor/grammars/ceylon-sublimetext:
- module.ceylon
- source.ceylon
vendor/grammars/chapel-tmbundle:
- source.chapel
vendor/grammars/cmake.tmbundle:
- source.cache.cmake
- source.cmake
vendor/grammars/cool-tmbundle:
- source.cool
vendor/grammars/cpp-qt.tmbundle:
- source.c++.qt
- source.qmake
vendor/grammars/css.tmbundle:
- source.css
vendor/grammars/cucumber-tmbundle:
- source.ruby.rspec.cucumber.steps
- text.gherkin.feature
vendor/grammars/d.tmbundle:
- source.d
vendor/grammars/dart-sublime-bundle:
- source.dart
- source.pubspec
- text.dart-doccomments
vendor/grammars/diff.tmbundle:
- source.diff
vendor/grammars/dylan.tmbundle:
- source.dylan
- source.lid
- source.makegen
vendor/grammars/ebundles/Bundles/MSDOS batch file.tmbundle:
- source.dosbatch
vendor/grammars/eiffel.tmbundle:
- source.eiffel
vendor/grammars/elixir-tmbundle:
- source.elixir
- text.elixir
- text.html.elixir
vendor/grammars/erlang.tmbundle:
- source.erlang
- text.html.erlang.yaws
vendor/grammars/factor:
- source.factor
- text.html.factor
vendor/grammars/fancy-tmbundle:
- source.fancy
vendor/grammars/fish-tmbundle:
- source.fish
vendor/grammars/fortran.tmbundle:
- source.fortran
- source.fortran.modern
vendor/grammars/fsharpbinding:
- source.fsharp
vendor/grammars/gettext.tmbundle:
- source.po
vendor/grammars/gnuplot-tmbundle:
- source.gnuplot
vendor/grammars/go-tmbundle:
- source.go
vendor/grammars/gradle.tmbundle:
- source.groovy.gradle
vendor/grammars/graphviz.tmbundle:
- source.dot
vendor/grammars/groovy.tmbundle:
- source.groovy
vendor/grammars/haskell.tmbundle:
- source.haskell
- text.tex.latex.haskell
vendor/grammars/haxe-sublime-bundle:
- source.erazor
- source.haxe.2
- source.hss.1
- source.hxml
- source.nmml
https://github.com/cucumber/cucumber-tmbundle:
- source.ruby.rspec.cucumber.steps
- text.gherkin.feature
https://github.com/daaain/Handlebars/raw/master/Handlebars.tmLanguage:
- text.html.handlebars
https://github.com/davidpeckham/powershell.tmbundle:
- source.powershell
https://github.com/davidrios/jade-tmbundle:
- source.jade
- source.pyjade
https://github.com/elixir-lang/elixir-tmbundle:
- source.elixir
- text.elixir
- text.html.elixir
https://github.com/ericzou/ebundles/raw/master/Bundles/MSDOS%20batch%20file.tmbundle/Syntaxes/MSDOS%20batch%20file.tmLanguage:
- source.dosbatch
https://github.com/euler0/sublime-glsl/raw/master/GLSL.tmLanguage:
- source.glsl
https://github.com/fancy-lang/fancy-tmbundle:
- source.fancy
https://github.com/fsharp/fsharpbinding:
- source.fsharp
https://github.com/gingerbeardman/monkey.tmbundle:
- source.monkey
https://github.com/guillermooo/dart-sublime-bundle/raw/master/Dart.tmLanguage:
- source.dart
https://github.com/harrism/sublimetext-cuda-cpp/raw/master/cuda-c%2B%2B.tmLanguage:
- source.cuda-c++
https://github.com/hww3/pike-textmate:
- source.pike
https://github.com/jeancharles-roger/ceylon-sublimetext/raw/master/Ceylon.tmLanguage:
- source.ceylon
https://github.com/jfairbank/Sublime-Text-2-OpenEdge-ABL:
- source.abl
https://github.com/jhasse/sublime-rust:
- source.rust
https://github.com/johanasplund/sublime-befunge/raw/master/Befunge-93.tmLanguage:
- source.befunge
https://github.com/joshaven/RDoc.tmbundle:
- text.rdoc
https://github.com/jpcamara/Textmate-Gosu-Bundle/raw/master/Gosu.tmbundle/Syntaxes/Gosu.tmLanguage:
- source.gosu.2
https://github.com/kswedberg/jquery-tmbundle:
- source.js.jquery
https://github.com/laughedelic/sublime-idris/raw/master/Idris.tmLanguage:
- source.idris
https://github.com/lavrton/sublime-better-typescript:
- source.ts
https://github.com/leafo/moonscript-tmbundle:
- source.moonscript
https://github.com/lsf37/Isabelle.tmbundle:
- source.isabelle.theory
https://github.com/lunixbochs/x86-assembly-textmate-bundle:
- source.asm.x86
https://github.com/macekond/Alloy.tmbundle:
- source.alloy
https://github.com/mads379/opa.tmbundle:
- source.opa
https://github.com/mads379/scala.tmbundle:
- source.sbt
- source.scala
https://github.com/marconi/mako-tmbundle:
- text.html.mako
https://github.com/mattfoster/gnuplot-tmbundle:
- source.gnuplot
https://github.com/mgalloy/idl.tmbundle:
vendor/grammars/html.tmbundle:
- text.html.basic
vendor/grammars/idl.tmbundle:
- source.idl
- source.idl-dlm
- text.idl-idldoc
https://github.com/michaeledgar/protobuf-tmbundle:
- source.protobuf
https://github.com/mkolosick/Sublime-Coq/raw/master/Coq.tmLanguage:
- source.coq
https://github.com/mokus0/Agda.tmbundle:
- source.agda
https://github.com/nanoant/Julia.tmbundle:
- source.julia
https://github.com/nanoant/assembly.tmbundle/raw/master/Syntaxes/objdump%20C%2B%2B.tmLanguage:
- objdump.x86asm
https://github.com/nilium/ooc.tmbundle:
- source.ooc
https://github.com/paulmillr/LiveScript.tmbundle:
- source.livescript
https://github.com/pferruggiaro/sublime-tea:
- source.tea
https://github.com/puppet-textmate-bundle/puppet-textmate-bundle:
- source.puppet
https://github.com/pvl/abap.tmbundle:
- source.abap
https://github.com/scalate/Scalate.tmbundle:
- source.scaml
- text.html.ssp
https://github.com/shadanan/mathematica-tmbundle:
- source.mathematica
https://github.com/shellderp/sublime-robot-plugin:
- text.robot
https://github.com/simongregory/actionscript3-tmbundle:
- source.actionscript.3
- text.html.asdoc
- text.xml.flex-config
https://github.com/skozlovf/Sublime-QML:
- source.qml
https://github.com/slash-lang/Slash.tmbundle:
- text.html.slash
https://github.com/slavapestov/factor/raw/master/misc/Factor.tmbundle/Syntaxes/Factor.tmLanguage:
- source.factor
https://github.com/slim-template/ruby-slim.tmbundle:
- text.slim
https://github.com/staltz/SublimeXtend:
- source.xtend
https://github.com/statatmbundle/Stata.tmbundle:
- source.mata
- source.stata
https://github.com/technosophos/Vala-TMBundle:
- source.vala
https://github.com/textmate/ant.tmbundle:
- text.xml.ant
https://github.com/textmate/antlr.tmbundle:
- source.antlr
https://github.com/textmate/apache.tmbundle:
- source.apache-config
- source.apache-config.mod_perl
https://github.com/textmate/applescript.tmbundle:
- source.applescript
https://github.com/textmate/asp.tmbundle:
- source.asp
- text.html.asp
https://github.com/textmate/bison.tmbundle:
- source.bison
https://github.com/textmate/c.tmbundle:
- source.c
- source.c++
- source.c.platform
https://github.com/textmate/capnproto.tmbundle:
- source.capnp
https://github.com/textmate/cmake.tmbundle:
- source.cache.cmake
- source.cmake
https://github.com/textmate/cpp-qt.tmbundle:
- source.c++.qt
- source.qmake
https://github.com/textmate/css.tmbundle:
- source.css
https://github.com/textmate/d.tmbundle:
- source.d
https://github.com/textmate/diff.tmbundle:
- source.diff
https://github.com/textmate/dylan.tmbundle:
- source.dylan
- source.lid
- source.makegen
https://github.com/textmate/eiffel.tmbundle:
- source.eiffel
https://github.com/textmate/erlang.tmbundle:
- source.erlang
- text.html.erlang.yaws
https://github.com/textmate/fortran.tmbundle:
- source.fortran
- source.fortran.modern
https://github.com/textmate/gettext.tmbundle:
- source.po
https://github.com/textmate/graphviz.tmbundle:
- source.dot
https://github.com/textmate/groovy.tmbundle:
- source.groovy
https://github.com/textmate/haskell.tmbundle:
- source.haskell
- text.tex.latex.haskell
https://github.com/textmate/html.tmbundle:
- text.html.basic
https://github.com/textmate/ini.tmbundle:
vendor/grammars/ini.tmbundle:
- source.ini
https://github.com/textmate/io.tmbundle:
vendor/grammars/io.tmbundle:
- source.io
https://github.com/textmate/java.tmbundle:
vendor/grammars/ioke-outdated:
- source.ioke
vendor/grammars/jade-tmbundle:
- source.jade
- source.pyjade
vendor/grammars/jasmin-sublime:
- source.jasmin
vendor/grammars/java.tmbundle:
- source.java
- source.java-properties
- text.html.jsp
- text.junit-test-report
https://github.com/textmate/javadoc.tmbundle:
vendor/grammars/javadoc.tmbundle:
- text.html.javadoc
https://github.com/textmate/javascript-objective-j.tmbundle:
vendor/grammars/javascript-objective-j.tmbundle:
- source.js.objj
https://github.com/textmate/json.tmbundle:
vendor/grammars/jquery-tmbundle:
- source.js.jquery
vendor/grammars/json.tmbundle:
- source.json
https://github.com/textmate/latex.tmbundle:
vendor/grammars/kotlin-sublime-package:
- source.Kotlin
vendor/grammars/language-clojure:
- source.clojure
vendor/grammars/language-coffee-script:
- source.coffee
- source.litcoffee
vendor/grammars/language-csharp:
- source.cs
- source.csx
- source.nant-build
vendor/grammars/language-gfm:
- source.gfm
vendor/grammars/language-javascript:
- source.js
- source.js.regexp
vendor/grammars/language-python:
- source.python
- source.regexp.python
- text.python.console
- text.python.traceback
vendor/grammars/language-shellscript:
- source.shell
- text.shell-session
vendor/grammars/language-yaml:
- source.yaml
vendor/grammars/latex.tmbundle:
- text.bibtex
- text.log.latex
- text.tex
- text.tex.latex
- text.tex.latex.beamer
- text.tex.latex.memoir
https://github.com/textmate/less.tmbundle:
vendor/grammars/less.tmbundle:
- source.css.less
https://github.com/textmate/lilypond.tmbundle:
vendor/grammars/lilypond.tmbundle:
- source.lilypond
https://github.com/textmate/lisp.tmbundle:
vendor/grammars/lisp.tmbundle:
- source.lisp
https://github.com/textmate/logtalk.tmbundle:
vendor/grammars/llvm.tmbundle:
- source.llvm
vendor/grammars/logtalk.tmbundle:
- source.logtalk
https://github.com/textmate/lua.tmbundle:
vendor/grammars/lua.tmbundle:
- source.lua
https://github.com/textmate/make.tmbundle:
vendor/grammars/make.tmbundle:
- source.makefile
https://github.com/textmate/markdown.tmbundle:
- text.html.markdown
https://github.com/textmate/matlab.tmbundle:
vendor/grammars/mako-tmbundle:
- text.html.mako
vendor/grammars/mathematica-tmbundle:
- source.mathematica
vendor/grammars/matlab.tmbundle:
- source.matlab
- source.octave
https://github.com/textmate/maven.tmbundle:
vendor/grammars/maven.tmbundle:
- text.xml.pom
https://github.com/textmate/nemerle.tmbundle:
vendor/grammars/mercury-tmlanguage:
- source.mercury
vendor/grammars/monkey.tmbundle:
- source.monkey
vendor/grammars/moonscript-tmbundle:
- source.moonscript
vendor/grammars/nemerle.tmbundle:
- source.nemerle
https://github.com/textmate/ninja.tmbundle:
vendor/grammars/nesC.tmbundle:
- source.nesc
vendor/grammars/ninja.tmbundle:
- source.ninja
https://github.com/textmate/objective-c.tmbundle:
vendor/grammars/objective-c.tmbundle:
- source.objc
- source.objc++
- source.objc.platform
- source.strings
https://github.com/textmate/ocaml.tmbundle:
vendor/grammars/ocaml.tmbundle:
- source.camlp4.ocaml
- source.ocaml
- source.ocamllex
- source.ocamlyacc
https://github.com/textmate/pascal.tmbundle:
vendor/grammars/ooc.tmbundle:
- source.ooc
vendor/grammars/opa.tmbundle:
- source.opa
vendor/grammars/oz-tmbundle/Syntaxes/Oz.tmLanguage:
- source.oz
vendor/grammars/pascal.tmbundle:
- source.pascal
https://github.com/textmate/perl.tmbundle:
vendor/grammars/perl.tmbundle:
- source.perl
https://github.com/textmate/php-smarty.tmbundle:
vendor/grammars/php-smarty.tmbundle:
- source.smarty
https://github.com/textmate/php.tmbundle:
vendor/grammars/php.tmbundle:
- text.html.php
https://github.com/textmate/postscript.tmbundle:
vendor/grammars/pike-textmate:
- source.pike
vendor/grammars/postscript.tmbundle:
- source.postscript
https://github.com/textmate/processing.tmbundle:
vendor/grammars/powershell.tmbundle:
- source.powershell
vendor/grammars/processing.tmbundle:
- source.processing
https://github.com/textmate/prolog.tmbundle:
vendor/grammars/prolog.tmbundle:
- source.prolog
https://github.com/textmate/python-django.tmbundle:
vendor/grammars/protobuf-tmbundle:
- source.protobuf
vendor/grammars/puppet-textmate-bundle:
- source.puppet
vendor/grammars/python-django.tmbundle:
- source.python.django
- text.html.django
https://github.com/textmate/r.tmbundle:
vendor/grammars/r.tmbundle:
- source.r
- text.tex.latex.rd
https://github.com/textmate/restructuredtext.tmbundle:
vendor/grammars/racket-tmbundle:
- source.racket
vendor/grammars/restructuredtext.tmbundle:
- text.restructuredtext
https://github.com/textmate/ruby-haml.tmbundle:
vendor/grammars/ruby-haml.tmbundle:
- text.haml
https://github.com/textmate/ruby-on-rails-tmbundle:
vendor/grammars/ruby-on-rails-tmbundle:
- source.js.erb.rails
- source.ruby.rails
- source.ruby.rails.rjs
- source.sql.ruby
- text.html.erb.rails
https://github.com/textmate/scheme.tmbundle:
vendor/grammars/ruby-slim.tmbundle:
- text.slim
vendor/grammars/ruby.tmbundle:
- source.ruby
- text.html.erb
vendor/grammars/sas.tmbundle:
- source.SASLog
- source.sas
vendor/grammars/sass-textmate-bundle:
- source.sass
vendor/grammars/scala.tmbundle:
- source.sbt
- source.scala
vendor/grammars/scheme.tmbundle:
- source.scheme
https://github.com/textmate/scilab.tmbundle:
vendor/grammars/scilab.tmbundle:
- source.scilab
https://github.com/textmate/sql.tmbundle:
vendor/grammars/smalltalk-tmbundle:
- source.smalltalk
vendor/grammars/sql.tmbundle:
- source.sql
https://github.com/textmate/standard-ml.tmbundle:
vendor/grammars/standard-ml.tmbundle:
- source.cm
- source.ml
https://github.com/textmate/swift.tmbundle:
vendor/grammars/sublime-MuPAD:
- source.mupad
vendor/grammars/sublime-befunge:
- source.befunge
vendor/grammars/sublime-better-typescript:
- source.ts
vendor/grammars/sublime-bsv:
- source.bsv
vendor/grammars/sublime-cirru:
- source.cirru
vendor/grammars/sublime-glsl:
- source.essl
- source.glsl
vendor/grammars/sublime-idris:
- source.idris
vendor/grammars/sublime-mask:
- source.mask
vendor/grammars/sublime-nginx:
- source.nginx
vendor/grammars/sublime-nix:
- source.nix
vendor/grammars/sublime-robot-plugin:
- text.robot
vendor/grammars/sublime-rust:
- source.rust
vendor/grammars/sublime-sourcepawn:
- source.sp
vendor/grammars/sublime-tea:
- source.tea
vendor/grammars/sublime_cobol:
- source.acucobol
- source.cobol
- source.opencobol
vendor/grammars/sublime_man_page_support:
- source.man
- text.groff
vendor/grammars/sublimetext-cuda-cpp:
- source.cuda-c++
vendor/grammars/swift.tmbundle:
- source.swift
https://github.com/textmate/tcl.tmbundle:
vendor/grammars/tcl.tmbundle:
- source.tcl
- text.html.tcl
https://github.com/textmate/text.tmbundle:
vendor/grammars/text.tmbundle:
- text.plain
https://github.com/textmate/textile.tmbundle:
vendor/grammars/textile.tmbundle:
- text.html.textile
https://github.com/textmate/textmate.tmbundle:
vendor/grammars/textmate.tmbundle:
- source.regexp.oniguruma
- source.tm-properties
https://github.com/textmate/thrift.tmbundle:
vendor/grammars/thrift.tmbundle:
- source.thrift
https://github.com/textmate/toml.tmbundle:
vendor/grammars/toml.tmbundle:
- source.toml
https://github.com/textmate/verilog.tmbundle:
vendor/grammars/verilog.tmbundle:
- source.verilog
https://github.com/textmate/xml.tmbundle:
vendor/grammars/x86-assembly-textmate-bundle:
- source.asm.x86
vendor/grammars/xml.tmbundle:
- text.xml
- text.xml.xsl
https://github.com/textmate/yaml.tmbundle:
- source.yaml
https://github.com/tomas-stefano/smalltalk-tmbundle:
- source.smalltalk
https://github.com/vic/ioke-outdated/raw/master/share/TextMate/Ioke.tmbundle/Syntaxes/Ioke.tmLanguage:
- source.ioke
https://github.com/vkostyukov/kotlin-sublime-package:
- source.Kotlin
https://github.com/vmg/zephir-sublime:
vendor/grammars/zephir-sublime:
- source.php.zephir
https://github.com/whitequark/llvm.tmbundle:
- source.llvm
https://github.com/wmertens/sublime-nix:
- source.nix
https://raw.githubusercontent.com/eregon/oz-tmbundle/master/Syntaxes/Oz.tmLanguage:
- source.oz

View File

@@ -51,20 +51,20 @@ module Linguist
#
# Return true or false
def generated?
minified_files? ||
compiled_coffeescript? ||
xcode_file? ||
generated_parser? ||
generated_net_docfile? ||
generated_net_designer_file? ||
generated_postscript? ||
generated_protocol_buffer? ||
generated_jni_header? ||
composer_lock? ||
node_modules? ||
godeps? ||
vcr_cassette? ||
generated_by_zephir?
generated_by_zephir? ||
minified_files? ||
compiled_coffeescript? ||
generated_parser? ||
generated_net_docfile? ||
generated_postscript? ||
generated_protocol_buffer? ||
generated_jni_header? ||
vcr_cassette?
end
# Internal: Is the blob an Xcode file?

View File

@@ -61,11 +61,19 @@ module Linguist
@heuristic.call(data)
end
disambiguate "BitBake", "BlitzBasic" do |data|
if /^\s*; /.match(data) || data.include?("End Function")
Language["BlitzBasic"]
elsif /^\s*(# |include|require)\b/.match(data)
Language["BitBake"]
end
end
disambiguate "Objective-C", "C++", "C" do |data|
if (/@(interface|class|protocol|property|end|synchronised|selector|implementation)\b/.match(data))
if (/^[ \t]*@(interface|class|protocol|property|end|synchronised|selector|implementation)\b/.match(data))
Language["Objective-C"]
elsif (/^\s*#\s*include <(cstdint|string|vector|map|list|array|bitset|queue|stack|forward_list|unordered_map|unordered_set|(i|o|io)stream)>/.match(data) ||
/^\s*template\s*</.match(data) || /^[^@]class\s+\w+/.match(data) || /^[^@](private|public|protected):$/.match(data) || /std::.+$/.match(data))
/^\s*template\s*</.match(data) || /^[ \t]*try/.match(data) || /^[ \t]*catch\s*\(/.match(data) || /^[ \t]*(class|(using[ \t]+)?namespace)\s+\w+/.match(data) || /^[ \t]*(private|public|protected):$/.match(data) || /std::\w+/.match(data))
Language["C++"]
end
end
@@ -129,7 +137,7 @@ module Linguist
disambiguate "FORTRAN", "Forth" do |data|
if /^: /.match(data)
Language["Forth"]
elsif /^([c*][^a-z]| subroutine\s)/i.match(data)
elsif /^([c*][^a-z]| (subroutine|program)\s|!)/i.match(data)
Language["FORTRAN"]
end
end
@@ -156,5 +164,22 @@ module Linguist
end
end
disambiguate "TypeScript", "XML" do |data|
if data.include?("<TS ")
Language["XML"]
else
Language["TypeScript"]
end
end
disambiguate "Frege", "Forth", "Text" do |data|
if /^(: |also |new-device|previous )/.match(data)
Language["Forth"]
elsif /\s*(import|module|package|data|type) /.match(data)
Language["Frege"]
else
Language["Text"]
end
end
end
end

View File

@@ -269,8 +269,12 @@ module Linguist
# Public: A List of languages compatible with Ace.
#
# TODO: Remove this method in a 5.x release. Every language now needs an ace_mode
# key, so this function isn't doing anything unique anymore.
#
# Returns an Array of Languages.
def self.ace_modes
warn "This method will be deprecated in a future 5.x release. Every language now has an `ace_mode` set."
@ace_modes ||= all.select(&:ace_mode).sort_by { |lang| lang.name.downcase }
end
@@ -544,7 +548,7 @@ module Linguist
if extnames = extensions[name]
extnames.each do |extname|
if !options['extensions'].include?(extname)
if !options['extensions'].index { |x| x.end_with? extname }
warn "#{name} has a sample with extension (#{extname}) that isn't explicitly defined in languages.yml" unless extname == '.script!'
options['extensions'] << extname
end

File diff suppressed because it is too large Load Diff

View File

@@ -3,7 +3,6 @@
# This file should only be edited by GitHub staff
- ActionScript
- Bash
- C
- C#
- C++
@@ -27,3 +26,4 @@
- SQL
- Scala
- Scheme
- Shell

View File

@@ -34,10 +34,6 @@ module Linguist
Dir.entries(ROOT).sort!.each do |category|
next if category == '.' || category == '..'
# Skip text and binary for now
# Possibly reconsider this later
next if category == 'Text' || category == 'Binary'
dirname = File.join(ROOT, category)
Dir.entries(dirname).each do |filename|
next if filename == '.' || filename == '..'

View File

@@ -18,23 +18,32 @@ module Linguist
#
# Returns a String or nil
def self.interpreter(data)
lines = data.lines
return unless match = /^#! ?(.+)$/.match(lines.first)
shebang = data.lines.first
tokens = match[1].split(' ')
script = tokens.first.split('/').last
# First line must start with #!
return unless shebang && shebang.start_with?("#!")
# Get the parts of the shebang without the #!
tokens = shebang.sub(/^#!\s*/, '').strip.split(' ')
# There was nothing after the #!
return if tokens.empty?
# Get the name of the interpreter
script = File.basename(tokens.first)
# Get next argument if interpreter was /usr/bin/env
script = tokens[1] if script == 'env'
# If script has an invalid shebang, we might get here
# Interpreter was /usr/bin/env with no arguments
return unless script
# "python2.6" -> "python2"
script.sub! $1, '' if script =~ /(\.\d+)$/
script.sub! /(\.\d+)$/, ''
# Check for multiline shebang hacks that call `exec`
if script == 'sh' &&
lines.first(5).any? { |l| l.match(/exec (\w+).+\$0.+\$@/) }
data.lines.first(5).any? { |l| l.match(/exec (\w+).+\$0.+\$@/) }
script = $1
end

View File

@@ -32,6 +32,7 @@
# Erlang bundles
- ^rebar$
- erlang.mk
# Go dependencies
- Godeps/_workspace/

View File

@@ -1,3 +1,3 @@
module Linguist
VERSION = "4.2.3"
VERSION = "4.2.6"
end

View File

@@ -0,0 +1,25 @@
include gstreamer1.0-libav.inc
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
file://COPYING.LIB;md5=6762ed442b3822387a51c92d928ead0d \
file://ext/libav/gstav.h;beginline=1;endline=18;md5=a752c35267d8276fd9ca3db6994fca9c \
file://gst-libs/ext/libav/LICENSE;md5=23a54f59b82572c203a559346e89ed57 \
file://gst-libs/ext/libav/COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
file://gst-libs/ext/libav/COPYING.GPLv3;md5=d32239bcb673463ab874e80d47fae504 \
file://gst-libs/ext/libav/COPYING.LGPLv2.1;md5=bd7a443320af8c812e4c18d1b79df004 \
file://gst-libs/ext/libav/COPYING.LGPLv3;md5=e6a600fd5e1d9cbde2d983680233ad02"
SRC_URI = " \
http://gstreamer.freedesktop.org/src/gst-libav/gst-libav-${PV}.tar.xz \
file://0001-Disable-yasm-for-libav-when-disable-yasm.patch \
"
SRC_URI[md5sum] = "86540dee14d31daf976eb2713f2294f3"
SRC_URI[sha256sum] = "585eb7971006100ad771a852e07bd2f3e23bcc6eb0b1253a40b5a0e40e4e7418"
LIBAV_EXTRA_CONFIGURE_COMMON_ARG = "--target-os=linux \
--cc='${CC}' --as='${CC}' --ld='${CC}' --nm='${NM}' --ar='${AR}' \
--ranlib='${RANLIB}' \
${GSTREAMER_1_0_DEBUG}"
S = "${WORKDIR}/gst-libav-${PV}"

View File

@@ -0,0 +1,13 @@
require qt5-git.inc
require ${PN}.inc
do_install_append() {
# for modules which are still using syncqt and call qtPrepareTool(QMAKE_SYNCQT, syncqt)
# e.g. qt3d, qtwayland
ln -sf syncqt.pl ${D}${OE_QMAKE_PATH_QT_BINS}/syncqt
}
QT_MODULE_BRANCH = "release"
# v5.2.1 + 168 commits
SRCREV = "08cbbde61778276ccdda73d89fd64d02c623779f"

View File

@@ -0,0 +1,26 @@
using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle("Simple")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion("1.0.*")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]

View File

@@ -0,0 +1,20 @@
using System;
namespace MongoDB.Serialization.Descriptors
{
internal class BsonPropertyValue
{
public bool IsDictionary { get; private set; }
public Type Type { get; private set; }
public object Value { get; private set; }
public BsonPropertyValue(Type type, object value, bool isDictionary)
{
Type = type;
Value = value;
IsDictionary = isDictionary;
}
}
}

View File

@@ -0,0 +1,153 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Linq.Expressions;
namespace MongoDB.Linq.Expressions
{
internal class MongoExpressionVisitor : ExpressionVisitor
{
protected override Expression Visit(Expression exp)
{
if (exp == null)
return null;
switch ((MongoExpressionType)exp.NodeType)
{
case MongoExpressionType.Collection:
return VisitCollection((CollectionExpression)exp);
case MongoExpressionType.Field:
return VisitField((FieldExpression)exp);
case MongoExpressionType.Projection:
return VisitProjection((ProjectionExpression)exp);
case MongoExpressionType.Select:
return VisitSelect((SelectExpression)exp);
case MongoExpressionType.Aggregate:
return VisitAggregate((AggregateExpression)exp);
case MongoExpressionType.AggregateSubquery:
return VisitAggregateSubquery((AggregateSubqueryExpression)exp);
case MongoExpressionType.Scalar:
return VisitScalar((ScalarExpression)exp);
default:
return base.Visit(exp);
}
}
protected virtual Expression VisitAggregate(AggregateExpression aggregate)
{
var exp = Visit(aggregate.Argument);
if (exp != aggregate.Argument)
return new AggregateExpression(aggregate.Type, aggregate.AggregateType, exp, aggregate.Distinct);
return aggregate;
}
protected virtual Expression VisitAggregateSubquery(AggregateSubqueryExpression aggregateSubquery)
{
Expression e = Visit(aggregateSubquery.AggregateAsSubquery);
ScalarExpression subquery = (ScalarExpression)e;
if (subquery != aggregateSubquery.AggregateAsSubquery)
return new AggregateSubqueryExpression(aggregateSubquery.GroupByAlias, aggregateSubquery.AggregateInGroupSelect, subquery);
return aggregateSubquery;
}
protected virtual Expression VisitCollection(CollectionExpression collection)
{
return collection;
}
protected virtual Expression VisitField(FieldExpression field)
{
var e = Visit(field.Expression);
if (field.Expression != e)
field = new FieldExpression(e, field.Alias, field.Name);
return field;
}
protected virtual Expression VisitProjection(ProjectionExpression projection)
{
var source = (SelectExpression)Visit(projection.Source);
var projector = Visit(projection.Projector);
if (source != projection.Source || projector != projection.Projector)
return new ProjectionExpression(source, projector, projection.Aggregator);
return projection;
}
protected ReadOnlyCollection<OrderExpression> VisitOrderBy(ReadOnlyCollection<OrderExpression> orderBys)
{
if (orderBys != null)
{
List<OrderExpression> alternate = null;
for (int i = 0, n = orderBys.Count; i < n; i++)
{
OrderExpression expr = orderBys[i];
Expression e = this.Visit(expr.Expression);
if (alternate == null && e != expr.Expression)
alternate = orderBys.Take(i).ToList();
if (alternate != null)
alternate.Add(new OrderExpression(expr.OrderType, e));
}
if (alternate != null)
return alternate.AsReadOnly();
}
return orderBys;
}
protected virtual Expression VisitScalar(ScalarExpression scalar)
{
SelectExpression select = (SelectExpression)Visit(scalar.Select);
if (select != scalar.Select)
return new ScalarExpression(scalar.Type, select);
return scalar;
}
protected virtual Expression VisitSelect(SelectExpression select)
{
var from = VisitSource(select.From);
var where = Visit(select.Where);
var groupBy = Visit(select.GroupBy);
var orderBy = VisitOrderBy(select.OrderBy);
var skip = Visit(select.Skip);
var take = Visit(select.Take);
var fields = VisitFieldDeclarationList(select.Fields);
if (from != select.From || where != select.Where || orderBy != select.OrderBy || groupBy != select.GroupBy || skip != select.Skip || take != select.Take || fields != select.Fields)
return new SelectExpression(select.Alias, fields, from, where, orderBy, groupBy, select.IsDistinct, skip, take);
return select;
}
protected virtual Expression VisitSource(Expression source)
{
return Visit(source);
}
protected virtual Expression VisitSubquery(SubqueryExpression subquery)
{
switch ((MongoExpressionType)subquery.NodeType)
{
case MongoExpressionType.Scalar:
return VisitScalar((ScalarExpression)subquery);
}
return subquery;
}
protected virtual ReadOnlyCollection<FieldDeclaration> VisitFieldDeclarationList(ReadOnlyCollection<FieldDeclaration> fields)
{
if (fields == null)
return fields;
List<FieldDeclaration> alternate = null;
for (int i = 0, n = fields.Count; i < n; i++)
{
var f = fields[i];
var e = Visit(f.Expression);
if (f.Expression != e && alternate == null)
alternate = fields.Take(i).ToList();
if (alternate != null)
alternate.Add(new FieldDeclaration(f.Name, e));
}
if (alternate != null)
return alternate.AsReadOnly();
return fields;
}
}
}

98
samples/C++/Entity.h Normal file
View File

@@ -0,0 +1,98 @@
/**
* @file Entity.h
* @page EntityPage Entity
* @brief represent an entity in the game
* @author vinz243
* @version 0.1.0
* This file represents an Entity in the game system
* This parent type is a static entity which is shown and loaded into the Physics engine but never updated
*/
#ifndef ENTITY_H
#define ENTITY_H
#include "base.h"
/// @namespace Whitedrop
namespace Whitedrop {
/** @class Entity
* This parent type is a static entity which is shown and loaded into the Physics engine but never updated
*/
class Entity {
public:
/**
* @brief Create static entity
* @details creates a static entity instance according to the mesh and the id, the position
* This needs to be attached to a World after!
* The material name is not the file name but the material name!
* @ref WorldPage
* @param mesh the name of the mesh for the object, file must be in media/meshes
* @param id an unique identifier for the object, shortest as possible
* @param dimensions an Ogre::Vector3 which contains the dimensions in meter
* @param position the Vector3 which contains it position
* @param material the material name
*/
Entity(std::string mesh, std::string id, Ogre::Vector3 dimensions, Ogre::Vector3 position, std::string material);
/**
* @brief The copy constructor
* @details A copy constr
*
* @param ref the Entity to be copied from
*/
Entity(const Entity &ref);
/**
* @brief The assignement operator
* @details
*
* @param ent the entity to be copied
*/
Entity& operator=(const Entity ent);
/**
* @brief destrctor
* @details
*/
virtual ~Entity(void);
/**
* @brief a constance type of the entity
* @details depends of the class.
* May contain STATIC, DYNAMIC or ETHERAL
*/
const std::string type = "STATIC";
/**
* @brief Attach the entity to specified sceneManager
* @details This creates the OgreEntity using sceneMgr,
* set material, create a Node with name as `<id>_n`,
* scale it to match dimensions and translate the node to pos
* @param sceneMgr the scene manager to use
*/
virtual void setup(Ogre::SceneManager* sceneMgr);
/**
* @brief the update method
* @details this method should be called on each world update.
* Even though the method is necessary declared, the main impl of
* a static entity should be empty since it is not updated by physics
* However, a Dynamic entity should implement this function in order to:
* 1) Get from the physics engine the actor position in the physic world
* 2) Update the OgreEntity position and rotation from the previous actor
* @return whether it was successful or not, if falsey engine should stop
*/
virtual bool update(void);
protected:
std::string mMesh = "cube.mesh";
std::string mId;
std::string mMaterial;
Ogre::Vector3 mDimensions;
Ogre::Vector3 mPosition;
Ogre::Entity* mEntity;
Ogre::SceneNode* mNode;
};
}
#endif

47
samples/C/bitmap.h Normal file
View File

@@ -0,0 +1,47 @@
#pragma once
/* Copyright © 2010 Christoph Sünderhauf
*
* This file is part of Xelix.
*
* Xelix is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xelix is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Xelix. If not, see <http://www.gnu.org/licenses/>.
*/
#include "generic.h"
typedef struct {
uint32_t numbits;
/* an array large enough for numbits to fit in. Might
* (if numbits%8!=0) have some spare bits at the end
*/
uint32_t* bits;
} bitmap_t;
// creates a new bitmap.
// CONTENT IS RANDOM! - use bitmap_clearall() to clear the bitmap.
bitmap_t bitmap_init(uint32_t numbits);
// returns 1 or 0
uint8_t bitmap_get(bitmap_t bitmap, uint32_t bitnum);
// sets a bit (to 1)
void bitmap_set(bitmap_t bitmap, uint32_t bitnum);
// clears a bit (to 0)
void bitmap_clear(bitmap_t bitmap, uint32_t bitnum);
// clears every bit to 0
void bitmap_clearAll(bitmap_t bitmap);
// finds the first bit set to 0 returns 0 if no cleared bit found (0 is also returned if the first bit is cleared)
uint32_t bitmap_findFirstClear(bitmap_t bitmap);

44
samples/C/color.h Normal file
View File

@@ -0,0 +1,44 @@
#pragma once
/* Copyright © 2011 Fritz Grimpen
*
* This file is part of Xelix.
*
* Xelix is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xelix is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Xelix. If not, see <http://www.gnu.org/licenses/>.
*/
#include <lib/generic.h>
typedef struct {
uint32_t background;
uint32_t foreground;
} console_color_t;
#define CONSOLE_COLOR_BLACK 0x0
#define CONSOLE_COLOR_BLUE 0x1
#define CONSOLE_COLOR_GREEN 0x2
#define CONSOLE_COLOR_CYAN 0x3
#define CONSOLE_COLOR_RED 0x4
#define CONSOLE_COLOR_MAGENTA 0x5
#define CONSOLE_COLOR_BROWN 0x6
#define CONSOLE_COLOR_LGREY 0x7
#define CONSOLE_COLOR_DGREY 0x8
#define CONSOLE_COLOR_LBLUE 0x9
#define CONSOLE_COLOR_LGREEN 0xa
#define CONSOLE_COLOR_LCYAN 0xb
#define CONSOLE_COLOR_LRED 0xc
#define CONSOLE_COLOR_LMAGENTA 0xd
#define CONSOLE_COLOR_YELLOW 0xe
#define CONSOLE_COLOR_WHITE 0xf

52
samples/C/driver.h Normal file
View File

@@ -0,0 +1,52 @@
#pragma once
/* Copyright © 2011 Fritz Grimpen
*
* This file is part of Xelix.
*
* Xelix is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xelix is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Xelix. If not, see <http://www.gnu.org/licenses/>.
*/
#include <lib/generic.h>
#include <console/info.h>
#define CONSOLE_DRV_CAP_CLEAR 0x01
#define CONSOLE_DRV_CAP_SCROLL 0x02
#define CONSOLE_DRV_CAP_SET_CURSOR 0x04
// Input modifier keys
typedef struct {
bool shift_left:1;
bool shift_right:1;
bool control_left:1;
bool control_right:1;
bool alt:1;
bool super:1;
} console_modifiers_t;
typedef struct {
char character;
console_modifiers_t* modifiers;
} console_read_t;
typedef struct {
int (*write)(console_info_t*, char);
console_read_t* (*read)(console_info_t*);
int capabilities;
int (*_clear)(console_info_t*);
int (*scroll)(console_info_t*, int32_t);
void (*setCursor)(console_info_t*, uint32_t, uint32_t);
} console_driver_t;

70
samples/C/elf.h Normal file
View File

@@ -0,0 +1,70 @@
#pragma once
/* Copyright © 2011 Lukas Martini
*
* This file is part of Xelix.
*
* Xelix is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xelix is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Xelix. If not, see <http://www.gnu.org/licenses/>.
*/
#include <lib/generic.h>
#include <tasks/scheduler.h>
#define ELF_TYPE_NONE 0
#define ELF_TYPE_REL 1
#define ELF_TYPE_EXEC 2
#define ELF_TYPE_DYN 3
#define ELF_TYPE_CORE 4
#define ELF_ARCH_NONE 0
#define ELF_ARCH_386 3
#define ELF_VERSION_CURRENT 1
typedef struct {
unsigned char magic[4];
/* Note: There _is_ other stuff in here, but we don't need it */
unsigned char pad[12];
} __attribute__((packed)) elf_ident_t;
typedef struct {
uint32_t type;
uint32_t offset;
void* virtaddr;
void* physaddr;
uint32_t filesize;
uint32_t memsize;
uint32_t flags;
uint32_t alignment;
} __attribute__((packed)) elf_program_t;
typedef struct {
elf_ident_t ident;
uint16_t type; /* Object file type */
uint16_t machine; /* Architecture */
uint32_t version; /* Object file version */
void* entry; /* Entry point virtual address */
uint32_t phoff; /* Program header table file offset */
uint32_t shoff; /* Section header table file offset */
uint32_t flags; /* Processor-specific flags */
uint16_t ehsize; /* ELF header size in bytes */
uint16_t phentsize; /* Program header table entry size */
uint16_t phnum; /* Program header table entry count */
uint16_t shentsize; /* Section header table entry size */
uint16_t shnum; /* Section header table entry count */
uint16_t shstrndx; /* Section header string table index */
} __attribute__((packed)) elf_t;
task_t* elf_load(elf_t* bin, char* name, char** environ, char** argv, int argc);
task_t* elf_load_file(char* path, char** environ, char** argv, int argc);

45
samples/C/filter.h Normal file
View File

@@ -0,0 +1,45 @@
#pragma once
/* Copyright © 2011 Fritz Grimpen
*
* This file is part of Xelix.
*
* Xelix is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xelix is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Xelix. If not, see <http://www.gnu.org/licenses/>.
*/
#include <lib/generic.h>
#include <console/info.h>
#include <console/driver.h>
struct console_filter {
// General callback for all actions etc.
// Preferred prototype:
// char <name>(char c, console_info_t *info, console_driver_t *input, console_driver_t *output);
char (*callback)(char, console_info_t*, console_driver_t*, console_driver_t*);
// Specific callbacks for read and write
// Preferred prototype:
// char <name>(char c, console_info_t *info, console_driver_t *input);
char (*read_callback)(char, console_info_t*, console_driver_t*);
// Preferred prototype:
// char <name>(char c, console_info_t *info, console_driver_t *output);
char (*write_callback)(char, console_info_t*, console_driver_t*);
// The next filter in the filter chain
struct console_filter* next;
};
typedef struct console_filter console_filter_t;

44
samples/C/info.h Normal file
View File

@@ -0,0 +1,44 @@
#pragma once
/* Copyright © 2011 Fritz Grimpen
*
* This file is part of Xelix.
*
* Xelix is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xelix is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Xelix. If not, see <http://www.gnu.org/licenses/>.
*/
#include <lib/generic.h>
#include <console/color.h>
typedef struct {
uint32_t cursor_x;
uint32_t cursor_y;
uint32_t rows;
uint32_t columns;
uint32_t tabstop;
console_color_t default_color;
console_color_t current_color;
uint8_t nonblocking;
uint8_t reverse_video;
uint8_t bold;
uint8_t blink;
uint8_t underline;
uint8_t newline_mode;
uint8_t auto_echo;
uint8_t handle_backspace;
} console_info_t;

47
samples/C/interface.h Normal file
View File

@@ -0,0 +1,47 @@
#pragma once
/* Copyright © 2011 Fritz Grimpen
*
* This file is part of Xelix.
*
* Xelix is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xelix is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Xelix. If not, see <http://www.gnu.org/licenses/>.
*/
#include <lib/generic.h>
#include <console/info.h>
#include <console/filter.h>
#include <console/driver.h>
typedef struct {
console_info_t info;
console_filter_t* input_filter;
console_filter_t* output_filter;
console_driver_t* input_driver;
console_driver_t* output_driver;
} console_t;
console_t* default_console;
// Generate raw console, connected to the Display, Keyboard and the
// ECMA-48-Filter
void console_init();
size_t console_write(console_t* console, const char* buffer, int32_t length);
#define console_write2(console, buffer) console_write(console, buffer, strlen(buffer))
size_t console_read(console_t* console, char* buffer, size_t length);
size_t console_scroll(console_t* console, int32_t pages);
void console_clear(console_t* console);

50
samples/C/ip4.h Normal file
View File

@@ -0,0 +1,50 @@
#pragma once
/* Copyright © 2011 Lukas Martini
*
* This file is part of Xelix.
*
* Xelix is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xelix is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Xelix. If not, see <http://www.gnu.org/licenses/>.
*/
#include <lib/generic.h>
#include <net/net.h>
#define IP4_TOS_ICMP 0
typedef uint32_t ip4_addr_t;
typedef struct {
unsigned int hl:4; /* both fields are 4 bits */
unsigned int version:4;
uint8_t tos;
uint16_t len;
uint16_t id;
uint16_t off;
uint8_t ttl;
uint8_t p;
uint16_t checksum;
ip4_addr_t src;
ip4_addr_t dst;
} ip4_header_t;
typedef struct {
uint8_t type;
uint8_t code;
uint16_t checksum;
uint16_t id;
uint16_t sequence;
} ip4_icmp_header_t;
void ip4_receive(net_device_t* origin, net_l2proto_t proto, size_t size, void* raw);

110
samples/C/multiboot.h Normal file
View File

@@ -0,0 +1,110 @@
#pragma once
/* Copyright © 2010, 2011 Lukas Martini
*
* This file is part of Xelix.
*
* Xelix is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xelix is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Xelix. If not, see <http://www.gnu.org/licenses/>.
*/
#include <lib/generic.h>
#define MULTIBOOT_KERNELMAGIC 0x2BADB002
#define MULTIBOOT_FLAG_MEM 0x001
#define MULTIBOOT_FLAG_DEVICE 0x002
#define MULTIBOOT_FLAG_CMDLINE 0x004
#define MULTIBOOT_FLAG_MODS 0x008
#define MULTIBOOT_FLAG_AOUT 0x010
#define MULTIBOOT_FLAG_ELF 0x020
#define MULTIBOOT_FLAG_MMAP 0x040
#define MULTIBOOT_FLAG_CONFIG 0x080
#define MULTIBOOT_FLAG_LOADER 0x100
#define MULTIBOOT_FLAG_APM 0x200
#define MULTIBOOT_FLAG_VBE 0x400
// The symbol table for a.out.
typedef struct
{
uint32_t tabSize;
uint32_t strSize;
uint32_t addr;
uint32_t reserved;
} __attribute__((packed)) multiboot_aoutSymbolTable_t;
// The section header table for ELF.
typedef struct
{
uint32_t num;
uint32_t size;
uint32_t addr;
uint32_t shndx;
} __attribute__((packed)) multiboot_elfSectionHeaderTable_t;
typedef struct
{
uint32_t size;
uint64_t addr;
uint64_t length;
uint32_t type;
} __attribute__((packed)) multiboot_memoryMap_t;
typedef struct
{
uint32_t start;
uint32_t end;
char* cmdLine;
uint32_t reserved;
} __attribute__((packed)) multiboot_module_t;
typedef struct
{
uint32_t flags;
uint32_t memLower;
uint32_t memUpper;
uint32_t bootDevice;
char* cmdLine;
uint32_t modsCount;
multiboot_module_t* modsAddr;
union
{
multiboot_aoutSymbolTable_t aoutSym;
multiboot_elfSectionHeaderTable_t elfSec;
} u;
uint32_t mmapLength;
uint32_t mmapAddr;
uint32_t drivesLength;
uint32_t drivesAddr;
// ROM configuration table
uint32_t configTable;
char* bootLoaderName;
uint32_t apmTable;
// Video
uint32_t vbeControlInfo;
uint32_t vbeModeInfo;
uint16_t vbeMode;
uint16_t vbeInterfaceSeg;
uint16_t vbeInterfaceOff;
uint16_t vbeInterfaceLen;
} __attribute__((packed)) multiboot_info_t;
multiboot_info_t* multiboot_info;
void arch_multiboot_printInfo();

43
samples/C/portio.h Normal file
View File

@@ -0,0 +1,43 @@
#pragma once
/* Copyright © 2011 Lukas Martini
*
* This file is part of Xelix.
*
* Xelix is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xelix is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Xelix. If not, see <http://www.gnu.org/licenses/>.
*/
#include <lib/generic.h>
#include <lib/stdint.h>
// Legacy
#define outb(args...) portio_out8(args)
#define outw(args...) portio_out16(args)
#define outl(args...) portio_out32(args)
#define outq(args...) portio_out64(args)
#define inb(args...) portio_in8(args)
#define inw(args...) portio_in16(args)
#define inl(args...) portio_in32(args)
#define inq(args...) portio_in64(args)
void portio_out8(uint16_t port, uint8_t value);
void portio_out16(uint16_t port, uint16_t value);
void portio_out32(uint16_t port, uint32_t value);
void portio_out64(uint16_t port, uint64_t value);
uint8_t portio_in8(uint16_t port);
uint16_t portio_in16(uint16_t port);
uint32_t portio_in32(uint16_t port);
uint64_t portio_in64(uint16_t port);

69
samples/C/scheduler.h Normal file
View File

@@ -0,0 +1,69 @@
#pragma once
/* Copyright © 2011 Lukas Martini
*
* This file is part of Xelix.
*
* Xelix is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xelix is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Xelix. If not, see <http://www.gnu.org/licenses/>.
*/
#include <lib/generic.h>
#include <hw/cpu.h>
#include <memory/vmem.h>
#define SCHEDULER_MAXNAME 256
#define SCHEDULER_TASK_PATH_MAX 256
// Single linked list
typedef struct task {
uint32_t pid;
char name[SCHEDULER_MAXNAME];
struct task *parent;
cpu_state_t* state;
struct task* next;
struct task* previous;
void* stack;
void* entry;
struct vmem_context *memory_context;
// Current task state
enum {
TASK_STATE_KILLED,
TASK_STATE_TERMINATED,
TASK_STATE_BLOCKING,
TASK_STATE_STOPPED,
TASK_STATE_RUNNING
} task_state;
char** environ;
char** argv;
int argc;
// TODO Is this actually the same as PATH_MAX in our toolchain?
char cwd[SCHEDULER_TASK_PATH_MAX + 1];
} task_t;
int scheduler_state;
task_t* scheduler_new(void* entry, task_t* parent, char name[SCHEDULER_MAXNAME],
char** environ, char** argv, int argc, struct vmem_context* memory_context, bool map_structs);
void scheduler_add(task_t *task);
void scheduler_terminate_current();
task_t* scheduler_get_current();
task_t* scheduler_select(cpu_state_t* lastRegs);
void scheduler_init();
void scheduler_yield();
void scheduler_remove(task_t *t);
task_t* scheduler_fork(task_t* to_fork, cpu_state_t* state);

95
samples/C/syscalls.h Normal file
View File

@@ -0,0 +1,95 @@
#pragma once
/* Copyright © 2011 Fritz Grimpen
*
* This file is part of Xelix.
*
* Xelix is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xelix is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Xelix. If not, see <http://www.gnu.org/licenses/>.
*/
#include <lib/generic.h>
#include <tasks/syscall.h>
#include "syscalls/write.h"
#include "syscalls/exit.h"
#include "syscalls/getpid.h"
#include "syscalls/getppid.h"
#include "syscalls/read.h"
#include "syscalls/brk.h"
#include "syscalls/mmap.h"
#include "syscalls/munmap.h"
#include "syscalls/test.h"
#include "syscalls/hostname.h"
#include "syscalls/uname.h"
#include "syscalls/open.h"
#include "syscalls/execve.h"
#include "syscalls/seek.h"
#include "syscalls/opendir.h"
#include "syscalls/readdir.h"
#include "syscalls/kill.h"
#include "syscalls/getexecdata.h"
#include "syscalls/cwd.h"
#include "syscalls/fork.h"
syscall_t syscall_table[] = {
NULL,
sys_exit, // 1
sys_read, // 2
sys_write, // 3
sys_getpid, // 4
sys_brk, // 5
sys_getppid, // 6
sys_mmap, // 7
sys_munmap, // 8
sys_test, // 9
sys_get_hostname, // 10
sys_set_hostname, // 11
sys_uname, // 12
sys_open, // 13
sys_execve, // 14
sys_seek, // 15
sys_opendir, // 16
sys_readdir, // 17
sys_kill, // 18
sys_getexecdata, // 19
sys_chdir, // 20
sys_getcwd, // 21
sys_fork, // 22
};
char* syscall_name_table[] = {
NULL,
"exit", // 1
"read", // 2
"write", // 3
"getpid", // 4
"brk", // 5
"getppid", // 6
"mmap", // 7
"munmap", // 8
"test", // 9
"get_hostname", // 10
"set_hostname", // 11
"uname", // 12
"open", // 13
"execve", // 14
"seek", // 15
"opendir", // 16
"readdir", // 17
"kill", // 18
"getexecdata", // 19
"chdir", // 20
"getcwd", // 21
"fork", // 22
};

56
samples/C/vfs.h Normal file
View File

@@ -0,0 +1,56 @@
#pragma once
/* Copyright © 2010, 2011 Lukas Martini
*
* This file is part of Xelix.
*
* Xelix is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xelix is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Xelix. If not, see <http://www.gnu.org/licenses/>.
*/
#include <lib/generic.h>
#define VFS_SEEK_SET 0
#define VFS_SEEK_CUR 1
#define VFS_SEEK_END 2
typedef struct {
uint64_t num;
char path[512];
char mount_path[512];
uint32_t offset;
uint32_t mountpoint;
} vfs_file_t;
typedef struct {
uint64_t num;
char path[512];
char mount_path[512];
uint32_t mountpoint;
} vfs_dir_t;
typedef void* (*vfs_read_callback_t)(char* path, uint32_t offset, uint32_t size);
typedef char* (*vfs_read_dir_callback_t)(char* path, uint32_t offset);
// Used to always store the last read/write attempt (used for kernel panic debugging)
char vfs_last_read_attempt[512];
vfs_file_t* vfs_get_from_id(uint32_t id);
vfs_dir_t* vfs_get_dir_from_id(uint32_t id);
void* vfs_read(vfs_file_t* fp, uint32_t size);
char* vfs_dir_read(vfs_dir_t* dir, uint32_t offset);
void vfs_seek(vfs_file_t* fp, uint32_t offset, int origin);
vfs_file_t* vfs_open(char* path);
vfs_dir_t* vfs_dir_open(char* path);
int vfs_mount(char* path, vfs_read_callback_t read_callback, vfs_read_dir_callback_t read_dir_callback);

94
samples/C/vmem.h Normal file
View File

@@ -0,0 +1,94 @@
#pragma once
/* Copyright © 2011 Fritz Grimpen
* Copyright © 2013 Lukas Martini
*
* This file is part of Xelix.
*
* Xelix is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xelix is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Xelix. If not, see <http://www.gnu.org/licenses/>.
*/
#include <lib/generic.h>
struct vmem_context;
struct vmem_page
{
enum
{
VMEM_SECTION_STACK, /* Initial stack */
VMEM_SECTION_CODE, /* Contains program code and is read-only */
VMEM_SECTION_DATA, /* Contains static data */
VMEM_SECTION_HEAP, /* Allocated by brk(2) at runtime */
VMEM_SECTION_MMAP, /* Allocated by mmap(2) at runtime */
VMEM_SECTION_KERNEL, /* Contains kernel-internal data */
VMEM_SECTION_UNMAPPED /* Unmapped */
} section;
bool readonly:1;
bool cow:1; /* Copy-on-Write mechanism */
bool allocated:1;
void *cow_src_addr;
void *virt_addr;
void *phys_addr;
};
typedef void (*vmem_iterator_t)(struct vmem_context *, struct vmem_page *, uint32_t);
/* Initialize vmem_kernelContext for paging_init() */
void vmem_init();
struct vmem_context *vmem_kernelContext;
struct vmem_context *vmem_currentContext;
struct vmem_context *vmem_processContext;
void *vmem_faultAddress;
/* Some callbacks for magic functions */
void (*vmem_applyPage)(struct vmem_context *, struct vmem_page *);
/* Generate new page context */
struct vmem_context *vmem_new();
struct vmem_page *vmem_new_page();
int vmem_add_page(struct vmem_context *ctx, struct vmem_page *pg);
struct vmem_page *vmem_get_page_phys(struct vmem_context *ctx, void *phys_addr);
struct vmem_page *vmem_get_page_virt(struct vmem_context *ctx, void *virt_addr);
struct vmem_page *vmem_get_page(struct vmem_context *ctx, uint32_t offset);
/* Remove pages in a specific context by physical or virtual address */
struct vmem_page *vmem_rm_page_phys(struct vmem_context *ctx, void *phys_addr);
struct vmem_page *vmem_rm_page_virt(struct vmem_context *ctx, void *virt_addr);
/* Iterator */
int vmem_iterate(struct vmem_context *ctx, vmem_iterator_t callback);
uint32_t vmem_count_pages(struct vmem_context *ctx);
void vmem_dump_page(struct vmem_page *pg);
void vmem_dump(struct vmem_context *ctx);
void vmem_handle_fault(uint32_t code, void *addr, void *instruction);
/* Get/Set cached paging context */
void vmem_set_cache(struct vmem_context *ctx, void *cache);
void *vmem_get_cache(struct vmem_context *ctx);
#ifdef __i386__
#define PAGE_SIZE 4096
#define VMEM_ALIGN(x) (typeof(x))(((intptr_t)(x) & 0xFFFFF000) + 0x1000)
#define VMEM_ALIGN_DOWN(x) (typeof(x))( \
((intptr_t)(x) - ((intptr_t)(x) % PAGE_SIZE)))
#else
#define PAGE_SIZE 0
#define VMEM_ALIGN(x) (x)
#endif

View File

@@ -0,0 +1,12 @@
cmake_minimum_required(VERSION 2.8)
project(Foo)
set(CMAKE_SKIP_RPATH TRUE)
set(CMAKE_INSTALL_PREFIX "/usr/local")
add_subdirectory(bar)
add_executable(foo foo.c)
target_link_libraries(foo pthread)
install(TARGETS foo DESTINATION bin)

File diff suppressed because it is too large Load Diff

244
samples/Forth/asm.fr Normal file
View File

@@ -0,0 +1,244 @@
\ Copyright 2013-2014 Lars Brinkhoff
\ Assembler for x86.
\ Adds to FORTH vocabulary: ASSEMBLER CODE ;CODE.
\ Creates ASSEMBLER vocabulary with: END-CODE and x86 opcodes.
\ Conventional prefix syntax: "<source> <destination> <opcode>,".
\ Addressing modes:
\ - immediate: "n #"
\ - direct: n
\ - register: <reg>
\ - indirect: "<reg> )"
\ - indirect with displacement: "n <reg> )#"
\ - indexed: not supported yet
require lib/common.fth
require search.fth
vocabulary assembler
also assembler definitions
\ Access to the target image.
' header, defer header, is header,
' cell defer cell is cell
' dp defer dp is dp
0 value delta
: aligned cell + 1 - cell negate nand invert ;
: align dp @ aligned dp ! ;
: allot dp +! ;
: here dp @ ;
: cells cell * ;
: c! delta + c! ;
: c, here c! 1 allot ;
: h, dup c, 8 rshift c, ;
: , dup h, 16 rshift h, ;
base @ hex
\ This constant signals that an operand is not a direct address.
deadbeef constant -addr
\ Assembler state.
variable opcode
variable d
variable s
variable dir?
variable mrrm defer ?mrrm,
variable sib defer ?sib,
variable disp defer ?disp,
variable imm defer ?imm,
defer imm,
defer immediate-opcode
defer reg
defer ?opsize
\ Set opcode. And destination: register or memory.
: opcode! 3@ is immediate-opcode >r opcode ! ;
: !reg dir? @ if 2 d ! then dir? off ;
: !mem dir? off ;
\ Set bits in mod/reg/rm byte.
: -mrrm ['] nop is ?mrrm, ;
: mod! mrrm c0 !bits ;
: reg@ mrrm 38 @bits ;
: reg! mrrm 38 !bits ;
: rm@ mrrm 7 @bits ;
: rm! rm@ 3 lshift reg! mrrm 7 !bits ;
: reg>opcode rm@ opcode 07 !bits ;
: opcode>reg opcode @ dup 3 rshift rm! 8 rshift opcode ! ;
\ Write parts of instruction to memory.
: ds d @ s @ + ;
: ?twobyte dup FF > if dup 8 rshift c, then ;
: opcode, opcode @ ?twobyte ds + c, ;
: mrrm, mrrm @ c, ;
: sib, sib @ c, ;
: imm8, imm @ c, ;
: imm16, imm @ h, ;
: imm32, imm @ , ;
: disp8, disp @ c, ;
: disp32, disp @ , ;
\ Set operand size.
: -opsize 2drop r> drop ;
: opsize! is imm, s ! ['] -opsize is ?opsize ;
: !op8 0 ['] imm8, ?opsize ;
: !op32 1 ['] imm32, ?opsize ;
: !op16 1 ['] imm16, ?opsize 66 c, ;
\ Set SIB byte.
: !sib ['] sib, is ?sib, ;
: sib! 3 lshift + sib ! !sib ;
\ Set displacement.
: byte? -80 80 within ;
: disp! is ?disp, disp ! ;
: !disp8 ['] disp8, disp! ;
: !disp32 ['] disp32, disp! ;
: !disp ( a -- u ) dup byte? if !disp8 40 else !disp32 80 then ;
: -pc here 5 + negate ;
: relative -pc disp +! ;
\ Set immediate operand.
: imm! imm ! ['] imm, is ?imm, ;
\ Implements addressing modes: register, indirect, indexed, and direct.
: reg1 rm! !reg ;
: reg2 3 lshift reg! ;
: !reg2 ['] reg2 is reg ;
: ind dup mod! rm! !mem !reg2 ;
: ind# swap !disp + ind ;
: idx 04 ind sib! ;
: idx# rot !disp 04 + ind sib! ;
: addr !disp32 05 ind ;
\ Reset assembler state.
: 0opsize ['] opsize! is ?opsize ;
: 0ds d off s off ;
: 0reg ['] reg1 is reg ;
: 0mrrm c0 mrrm ! ['] mrrm, is ?mrrm, ;
: 0sib ['] nop is ?sib, ;
: 0disp ['] nop is ?disp, ;
: 0imm imm off ['] nop is ?imm, 0 is imm, ;
: 0asm 0imm 0disp 0reg 0ds 0mrrm 0sib 0opsize dir? on ;
\ Enter and exit assembler mode.
: start-code also assembler 0asm ;
: end-code align previous ;
\ Implements addressing mode: immediate.
: imm8? imm @ byte? ;
: ?sign-extend d off imm8? if 2 d ! ['] imm8, is ?imm, then ;
: alu# opcode @ reg! 80 opcode ! ?sign-extend ;
: mov# B0 s @ 3 lshift + rm@ + opcode ! 0ds -mrrm ;
: push# imm8? if ['] imm8, 6A else ['] imm32, 68 then dup opcode ! rm! is ?imm, ;
: test# F6 opcode ! ;
: imm-op imm! immediate-opcode ;
\ Process one operand. All operands except a direct address
\ have the stack picture ( n*x xt -addr ).
: addr? dup -addr <> ;
: op addr? if addr else drop execute then ;
\ Define instruction formats.
: instruction, opcode! opcode, ?mrrm, ?sib, ?disp, ?imm, 0asm ;
: mnemonic ( u a "name" -- ) create ['] nop 3, does> instruction, ;
: format: create ] !csp does> mnemonic ;
: immediate: ' latestxt >body ! ;
\ Instruction formats.
format: 0op -mrrm ;
format: 1reg op reg>opcode 0ds -mrrm ;
format: 1op opcode>reg op d off ;
format: 2op op op ;
format: 2op-d op op d off ;
format: 2op-ds op op 0ds ;
format: 1addr op relative -mrrm ;
format: 1imm8 !op8 op -mrrm ;
\ Instruction mnemonics.
00 2op add, immediate: alu#
08 2op or, immediate: alu#
0F44 2op-ds cmove, \ Todo: other condition codes.
0FB6 2op-ds movzx,
0FBE 2op-ds movsx,
10 2op adc, immediate: alu#
18 2op sbb, immediate: alu#
20 2op and, immediate: alu#
26 0op es,
28 2op sub, immediate: alu#
2E 0op cs,
30 2op xor, immediate: alu#
36 0op ss,
38 2op cmp, immediate: alu#
3E 0op ds,
50 1reg push, immediate: push#
58 1reg pop,
64 0op fs,
65 0op gs,
\ 70 jcc
84 2op-d test, immediate: test#
86 2op-d xchg,
88 2op mov, immediate: mov#
8D 2op-ds lea,
\ 8F/0 pop, rm
90 0op nop,
C3 0op ret,
\ C6/0 immediate mov to r/m
\ C7/0 immediate mov to r/m
CD 1imm8 int,
E8 1addr call,
E9 1addr jmp,
\ EB jmp rel8
F0 0op lock,
F2 0op rep,
F3 0op repz,
F4 0op hlt,
F5 0op cmc,
F610 1op not,
F618 1op neg,
F8 0op clc,
F9 0op stc,
FA 0op cli,
FB 0op sti,
FC 0op cld,
FD 0op std,
\ FE 0 inc rm
\ FF 1 dec rm
\ FF 2 call rm
\ FF 4 jmp rm
\ FF 6 push rm
: sp? dup 4 = ;
\ Addressing mode syntax: immediate, indirect, and displaced indirect.
: # ['] imm-op -addr ;
: ) 2drop sp? if 4 ['] idx else ['] ind then -addr 0reg 0opsize ;
: )# 2drop sp? if 4 ['] idx# else ['] ind# then -addr 0reg 0opsize ;
\ Define registers.
: reg8 create , does> @ ['] reg -addr !op8 ;
: reg16 create , does> @ ['] reg -addr !op16 ;
: reg32 create , does> @ ['] reg -addr !op32 ;
: reg: dup reg8 dup reg16 dup reg32 1+ ;
\ Register names.
0
reg: al ax eax reg: cl cx ecx reg: dl dx edx reg: bl bx ebx
reg: ah sp esp reg: ch bp ebp reg: dh si esi reg: bh di edi
drop
\ Runtime for ;CODE. CODE! is defined elsewhere.
: (;code) r> code! ;
base ! only forth definitions also assembler
\ Standard assembler entry points.
: code parse-name header, ?code, start-code ;
: ;code postpone (;code) reveal postpone [ ?csp start-code ; immediate
0asm
previous

56
samples/Jasmin/if1.j Normal file
View File

@@ -0,0 +1,56 @@
.class public if1
.super java/lang/Object
;
; standard initializer (calls java.lang.Object's initializer)
;
.method public <init>()V
aload_0
invokenonvirtual java/lang/Object/<init>()V
return
.end method
.method public static main([Ljava/lang/String;)V
.limit locals 1
.limit stack 5
BeginGlobal:
.line 2
ldc 0x1
ldc 0x1
if_icmpeq If556261059
goto IfElse556261059
If556261059:
.line 3
.line 3
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc 0x1
invokevirtual java/io/PrintStream/print(I)V
goto IfDone556261059
IfElse556261059:
.line 5
.line 5
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc 0x2
invokevirtual java/io/PrintStream/print(I)V
IfDone556261059:
.line 6
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc 0x3
invokevirtual java/io/PrintStream/print(I)V
.line 7
ldc 0x1
ldc 0x1
if_icmpne IfNot-920218690
.line 8
.line 8
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc 0x4
invokevirtual java/io/PrintStream/print(I)V
IfNot-920218690:
EndGlobal:
return
.end method

167
samples/Jasmin/if2.j Normal file
View File

@@ -0,0 +1,167 @@
.class public if2
.super java/lang/Object
;
; standard initializer (calls java.lang.Object's initializer)
;
.method public <init>()V
aload_0
invokenonvirtual java/lang/Object/<init>()V
return
.end method
.method public static main([Ljava/lang/String;)V
.limit locals 1
.limit stack 5
BeginGlobal:
.line 2
ldc 0x1
ldc 0x1
if_icmpeq Cmp1893841232
ldc 0x0
goto CmpDone1893841232
Cmp1893841232:
ldc 0x1
CmpDone1893841232:
ldc 0x1
if_icmpeq If-1736765035
goto IfElse-1736765035
If-1736765035:
.line 2
.line 3
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc 0x1
invokevirtual java/io/PrintStream/print(I)V
goto IfDone-1736765035
IfElse-1736765035:
.line 4
.line 4
ldc 0x2
ldc 0x1
if_icmpeq Cmp-1460884369
ldc 0x0
goto CmpDone-1460884369
Cmp-1460884369:
ldc 0x1
CmpDone-1460884369:
ldc 0x1
if_icmpeq If-247349760
goto IfElse-247349760
If-247349760:
.line 4
.line 5
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc 0x2
invokevirtual java/io/PrintStream/print(I)V
goto IfDone-247349760
IfElse-247349760:
.line 6
.line 7
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc 0x3
invokevirtual java/io/PrintStream/print(I)V
IfDone-247349760:
IfDone-1736765035:
.line 10
ldc 0x1
ldc 0x2
if_icmpeq Cmp933554851
ldc 0x0
goto CmpDone933554851
Cmp933554851:
ldc 0x1
CmpDone933554851:
ldc 0x1
if_icmpeq If1623625546
goto IfElse1623625546
If1623625546:
.line 10
.line 11
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc 0x1
invokevirtual java/io/PrintStream/print(I)V
goto IfDone1623625546
IfElse1623625546:
.line 12
.line 12
ldc 0x2
ldc 0x2
if_icmpeq Cmp1572138409
ldc 0x0
goto CmpDone1572138409
Cmp1572138409:
ldc 0x1
CmpDone1572138409:
ldc 0x1
if_icmpeq If126354425
goto IfElse126354425
If126354425:
.line 12
.line 13
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc 0x2
invokevirtual java/io/PrintStream/print(I)V
goto IfDone126354425
IfElse126354425:
.line 14
.line 15
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc 0x3
invokevirtual java/io/PrintStream/print(I)V
IfDone126354425:
IfDone1623625546:
.line 18
ldc 0x1
ldc 0x2
if_icmpeq Cmp126493150
ldc 0x0
goto CmpDone126493150
Cmp126493150:
ldc 0x1
CmpDone126493150:
ldc 0x1
if_icmpeq If1522284422
goto IfElse1522284422
If1522284422:
.line 18
.line 19
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc 0x1
invokevirtual java/io/PrintStream/print(I)V
goto IfDone1522284422
IfElse1522284422:
.line 20
.line 20
ldc 0x2
ldc 0x1
if_icmpeq Cmp-906666545
ldc 0x0
goto CmpDone-906666545
Cmp-906666545:
ldc 0x1
CmpDone-906666545:
ldc 0x1
if_icmpeq If1083939031
goto IfElse1083939031
If1083939031:
.line 20
.line 21
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc 0x2
invokevirtual java/io/PrintStream/print(I)V
goto IfDone1083939031
IfElse1083939031:
.line 22
.line 23
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc 0x3
invokevirtual java/io/PrintStream/print(I)V
IfDone1083939031:
IfDone1522284422:
EndGlobal:
return
.end method

55
samples/Jasmin/if3.j Normal file
View File

@@ -0,0 +1,55 @@
.class public if3
.super java/lang/Object
;
; standard initializer (calls java.lang.Object's initializer)
;
.method public <init>()V
aload_0
invokenonvirtual java/lang/Object/<init>()V
return
.end method
.method public static main([Ljava/lang/String;)V
.limit locals 1
.limit stack 5
BeginGlobal:
.line 2
ldc 0x1
ldc 0x1
if_icmpeq If-811796083
goto IfElse-811796083
If-811796083:
.line 3
.line 3
ldc 0x0
ldc 0x1
if_icmpeq If-1001319390
goto IfElse-1001319390
If-1001319390:
.line 4
.line 4
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc 0x1
invokevirtual java/io/PrintStream/print(I)V
goto IfDone-1001319390
IfElse-1001319390:
.line 6
.line 6
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc 0x2
invokevirtual java/io/PrintStream/print(I)V
IfDone-1001319390:
goto IfDone-811796083
IfElse-811796083:
.line 8
.line 8
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc 0x3
invokevirtual java/io/PrintStream/print(I)V
IfDone-811796083:
EndGlobal:
return
.end method

37
samples/Jasmin/if4.j Normal file
View File

@@ -0,0 +1,37 @@
.class public if4
.super java/lang/Object
;
; standard initializer (calls java.lang.Object's initializer)
;
.method public <init>()V
aload_0
invokenonvirtual java/lang/Object/<init>()V
return
.end method
.method public static main([Ljava/lang/String;)V
.limit locals 1
.limit stack 5
BeginGlobal:
.line 2
ldc 0x1
ldc 0x1
if_icmpne IfNot1919266740
.line 2
.line 2
ldc 0x1
ldc 0x1
if_icmpne IfNot613368541
.line 2
.line 2
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc 0x1
invokevirtual java/io/PrintStream/print(I)V
IfNot613368541:
IfNot1919266740:
EndGlobal:
return
.end method

54
samples/Jasmin/op1.j Normal file
View File

@@ -0,0 +1,54 @@
.class public op1
.super java/lang/Object
;
; standard initializer (calls java.lang.Object's initializer)
;
.method public <init>()V
aload_0
invokenonvirtual java/lang/Object/<init>()V
return
.end method
.method public static main([Ljava/lang/String;)V
.limit locals 1
.limit stack 5
BeginGlobal:
.line 2
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc 0x1
ldc 0x1
iadd
invokevirtual java/io/PrintStream/println(I)V
.line 3
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc 0xa
ldc 0x5
isub
invokevirtual java/io/PrintStream/println(I)V
.line 4
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc 0x15
ldc 0x3
idiv
invokevirtual java/io/PrintStream/println(I)V
.line 5
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc 0x159
ldc 0x38
imul
invokevirtual java/io/PrintStream/println(I)V
.line 6
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc 0x52
ldc 0x9
irem
invokevirtual java/io/PrintStream/println(I)V
EndGlobal:
return
.end method

34
samples/Jasmin/op2.j Normal file
View File

@@ -0,0 +1,34 @@
.class public op2
.super java/lang/Object
;
; standard initializer (calls java.lang.Object's initializer)
;
.method public <init>()V
aload_0
invokenonvirtual java/lang/Object/<init>()V
return
.end method
.method public static main([Ljava/lang/String;)V
.limit locals 1
.limit stack 5
BeginGlobal:
.line 2
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc 0x1
ldc 0x0
iand
invokevirtual java/io/PrintStream/println(Z)V
.line 3
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc 0x1
ldc 0x0
ior
invokevirtual java/io/PrintStream/println(Z)V
EndGlobal:
return
.end method

68
samples/Jasmin/op3.j Normal file
View File

@@ -0,0 +1,68 @@
.class public op3
.super java/lang/Object
;
; standard initializer (calls java.lang.Object's initializer)
;
.method public <init>()V
aload_0
invokenonvirtual java/lang/Object/<init>()V
return
.end method
.method public static main([Ljava/lang/String;)V
.limit locals 1
.limit stack 5
BeginGlobal:
.line 2
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc 0x0
ldc 0x1
if_icmpeq Cmp-1307183590
ldc 0x0
goto CmpDone-1307183590
Cmp-1307183590:
ldc 0x1
CmpDone-1307183590:
invokevirtual java/io/PrintStream/println(Z)V
.line 3
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc 0x0
ldc 0x0
if_icmpeq Cmp-1443270821
ldc 0x0
goto CmpDone-1443270821
Cmp-1443270821:
ldc 0x1
CmpDone-1443270821:
invokevirtual java/io/PrintStream/println(Z)V
.line 4
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc 0x1
ldc 0x1
if_icmpeq Cmp1759327329
ldc 0x0
goto CmpDone1759327329
Cmp1759327329:
ldc 0x1
CmpDone1759327329:
invokevirtual java/io/PrintStream/println(Z)V
.line 5
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc 0x1
ldc 0x0
if_icmpeq Cmp-678570146
ldc 0x0
goto CmpDone-678570146
Cmp-678570146:
ldc 0x1
CmpDone-678570146:
invokevirtual java/io/PrintStream/println(Z)V
EndGlobal:
return
.end method

68
samples/Jasmin/op4.j Normal file
View File

@@ -0,0 +1,68 @@
.class public op4
.super java/lang/Object
;
; standard initializer (calls java.lang.Object's initializer)
;
.method public <init>()V
aload_0
invokenonvirtual java/lang/Object/<init>()V
return
.end method
.method public static main([Ljava/lang/String;)V
.limit locals 1
.limit stack 5
BeginGlobal:
.line 2
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc 0x0
ldc 0x1
if_icmpne Cmp-191731100
ldc 0x0
goto CmpDone-191731100
Cmp-191731100:
ldc 0x1
CmpDone-191731100:
invokevirtual java/io/PrintStream/println(Z)V
.line 3
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc 0x0
ldc 0x0
if_icmpne Cmp-901585603
ldc 0x0
goto CmpDone-901585603
Cmp-901585603:
ldc 0x1
CmpDone-901585603:
invokevirtual java/io/PrintStream/println(Z)V
.line 4
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc 0x1
ldc 0x1
if_icmpne Cmp1522577937
ldc 0x0
goto CmpDone1522577937
Cmp1522577937:
ldc 0x1
CmpDone1522577937:
invokevirtual java/io/PrintStream/println(Z)V
.line 5
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc 0x1
ldc 0x0
if_icmpne Cmp-1653028684
ldc 0x0
goto CmpDone-1653028684
Cmp-1653028684:
ldc 0x1
CmpDone-1653028684:
invokevirtual java/io/PrintStream/println(Z)V
EndGlobal:
return
.end method

View File

@@ -0,0 +1,434 @@
//
// AppController.j
// FlickrPhoto
//
// Created by Ross Boucher.
// Copyright 2008 - 2010, 280 North, Inc. All rights reserved.
@import <Foundation/Foundation.j>
@import <AppKit/AppKit.j>
var SliderToolbarItemIdentifier = "SliderToolbarItemIdentifier",
AddToolbarItemIdentifier = "AddToolbarItemIdentifier",
RemoveToolbarItemIdentifier = "RemoveToolbarItemIdentifier";
/*
Important note about CPJSONPConnection: CPJSONPConnection is ONLY for JSONP APIs.
If aren't sure you NEED JSONP (see http://ajaxian.com/archives/jsonp-json-with-padding ),
you most likely don't want to use CPJSONPConnection, but rather the more standard
CPURLConnection. CPJSONPConnection is designed for cross-domain
connections, and if you are making requests to the same domain (as most web
applications do), you do not need it.
*/
@implementation AppController : CPObject
{
CPString lastIdentifier;
CPDictionary photosets;
CPCollectionView listCollectionView;
CPCollectionView photosCollectionView;
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
//the first thing we need to do is create a window to take up the full screen
//we'll also create a toolbar to go with it, and grab its size for future reference
var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask],
contentView = [theWindow contentView],
toolbar = [[CPToolbar alloc] initWithIdentifier:"Photos"],
bounds = [contentView bounds];
//we tell the toolbar that we want to be its delegate and attach it to theWindow
[toolbar setDelegate:self];
[toolbar setVisible:true];
[theWindow setToolbar:toolbar];
photosets = [CPDictionary dictionary]; //storage for our sets of photos return from Flickr
//now we create a scroll view to contain the list of collections of photos (photosets)
//inside the scroll view, we'll place our collection view, which manages a collection of "cells"
//each cell will represent one photo collection, and choosing cells will select that collection
var listScrollView = [[CPScrollView alloc] initWithFrame:CGRectMake(0, 0, 200, CGRectGetHeight(bounds) - 58)];
[listScrollView setAutohidesScrollers:YES];
[listScrollView setAutoresizingMask:CPViewHeightSizable];
[[listScrollView contentView] setBackgroundColor:[CPColor colorWithRed:213.0 / 255.0 green:221.0 / 255.0 blue:230.0 / 255.0 alpha:1.0]];
//we create the collection view cells by creating a single prototype (CPCollectionViewItem) and setting its view.
//the CPCollectionView class will then duplicate this item as many times as it needs
var photosListItem = [[CPCollectionViewItem alloc] init];
[photosListItem setView:[[PhotosListCell alloc] initWithFrame:CGRectMakeZero()]];
listCollectionView = [[CPCollectionView alloc] initWithFrame:CGRectMake(0, 0, 200, 0)];
[listCollectionView setDelegate:self]; //we want delegate methods
[listCollectionView setItemPrototype:photosListItem]; //set the item prototype
[listCollectionView setMinItemSize:CGSizeMake(20.0, 45.0)];
[listCollectionView setMaxItemSize:CGSizeMake(1000.0, 45.0)];
[listCollectionView setMaxNumberOfColumns:1]; //setting a single column will make this appear as a vertical list
[listCollectionView setVerticalMargin:0.0];
[listCollectionView setAutoresizingMask:CPViewWidthSizable];
//finally, we put our collection view inside the scroll view as it's document view, so it can be scrolled
[listScrollView setDocumentView:listCollectionView];
//and we add it to the window's content view, so it will show up on the screen
[contentView addSubview:listScrollView];
//repeat the process with another collection view for the actual photos
//this time we'll use a different view for the prototype (PhotoCell)
var photoItem = [[CPCollectionViewItem alloc] init];
[photoItem setView:[[PhotoCell alloc] initWithFrame:CGRectMake(0, 0, 150, 150)]];
var scrollView = [[CPScrollView alloc] initWithFrame:CGRectMake(200, 0, CGRectGetWidth(bounds) - 200, CGRectGetHeight(bounds) - 58)];
photosCollectionView = [[CPCollectionView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(bounds) - 200, 0)];
[photosCollectionView setDelegate:self];
[photosCollectionView setItemPrototype:photoItem];
[photosCollectionView setMinItemSize:CGSizeMake(150, 150)];
[photosCollectionView setMaxItemSize:CGSizeMake(150, 150)];
[photosCollectionView setAutoresizingMask:CPViewWidthSizable];
[scrollView setAutoresizingMask:CPViewHeightSizable | CPViewWidthSizable];
[scrollView setDocumentView:photosCollectionView];
[scrollView setAutohidesScrollers:YES];
[[scrollView contentView] setBackgroundColor:[CPColor colorWithCalibratedWhite:0.25 alpha:1.0]];
[contentView addSubview:scrollView];
//bring forward the window to display it
[theWindow orderFront:self];
//get the most interesting photos on flickr
var request = [CPURLRequest requestWithURL:"http://www.flickr.com/services/rest/?method=flickr.interestingness.getList&per_page=20&format=json&api_key=ca4dd89d3dfaeaf075144c3fdec76756"];
// see important note about CPJSONPConnection above
var connection = [CPJSONPConnection sendRequest:request callback:"jsoncallback" delegate:self];
lastIdentifier = "Interesting Photos";
}
- (void)add:(id)sender
{
var string = prompt("Enter a tag to search Flickr for photos.");
if (string)
{
//create a new request for the photos with the tag returned from the javascript prompt
var request = [CPURLRequest requestWithURL:"http://www.flickr.com/services/rest/?"+
"method=flickr.photos.search&tags="+encodeURIComponent(string)+
"&media=photos&machine_tag_mode=any&per_page=20&format=json&api_key=ca4dd89d3dfaeaf075144c3fdec76756"];
// see important note about CPJSONPConnection above
[CPJSONPConnection sendRequest:request callback:"jsoncallback" delegate:self];
lastIdentifier = string;
}
}
- (void)remove:(id)sender
{
//remove this photo
[self removeImageListWithIdentifier:[[photosets allKeys] objectAtIndex:[[listCollectionView selectionIndexes] firstIndex]]];
}
- (void)addImageList:(CPArray)images withIdentifier:(CPString)aString
{
[photosets setObject:images forKey:aString];
[listCollectionView setContent:[[photosets allKeys] copy]];
[listCollectionView setSelectionIndexes:[CPIndexSet indexSetWithIndex:[[photosets allKeys] indexOfObject:aString]]];
}
- (void)removeImageListWithIdentifier:(CPString)aString
{
var nextIndex = MAX([[listCollectionView content] indexOfObject:aString] - 1, 0);
[photosets removeObjectForKey:aString];
[listCollectionView setContent:[[photosets allKeys] copy]];
[listCollectionView setSelectionIndexes:[CPIndexSet indexSetWithIndex:nextIndex]];
}
- (void)adjustImageSize:(id)sender
{
var newSize = [sender value];
[photosCollectionView setMinItemSize:CGSizeMake(newSize, newSize)];
[photosCollectionView setMaxItemSize:CGSizeMake(newSize, newSize)];
}
- (void)collectionViewDidChangeSelection:(CPCollectionView)aCollectionView
{
if (aCollectionView == listCollectionView)
{
var listIndex = [[listCollectionView selectionIndexes] firstIndex];
if (listIndex === CPNotFound)
return;
var key = [listCollectionView content][listIndex];
[photosCollectionView setContent:[photosets objectForKey:key]];
[photosCollectionView setSelectionIndexes:[CPIndexSet indexSet]];
}
}
- (void)connection:(CPJSONPConnection)aConnection didReceiveData:(CPString)data
{
//this method is called when the network request returns. the data is the returned
//information from flickr. we set the array of photo urls as the data to our collection view
[self addImageList:data.photos.photo withIdentifier:lastIdentifier];
}
- (void)connection:(CPJSONPConnection)aConnection didFailWithError:(CPString)error
{
alert(error); //a network error occurred
}
//these two methods are the toolbar delegate methods, and tell the toolbar what it should display to the user
- (CPArray)toolbarAllowedItemIdentifiers:(CPToolbar)aToolbar
{
return [self toolbarDefaultItemIdentifiers:aToolbar];
}
- (CPArray)toolbarDefaultItemIdentifiers:(CPToolbar)aToolbar
{
return [AddToolbarItemIdentifier, RemoveToolbarItemIdentifier, CPToolbarFlexibleSpaceItemIdentifier, SliderToolbarItemIdentifier];
}
//this delegate method returns the actual toolbar item for the given identifier
- (CPToolbarItem)toolbar:(CPToolbar)aToolbar itemForItemIdentifier:(CPString)anItemIdentifier willBeInsertedIntoToolbar:(BOOL)aFlag
{
var toolbarItem = [[CPToolbarItem alloc] initWithItemIdentifier:anItemIdentifier];
if (anItemIdentifier == SliderToolbarItemIdentifier)
{
[toolbarItem setView:[[PhotoResizeView alloc] initWithFrame:CGRectMake(0, 0, 180, 32)]];
[toolbarItem setMinSize:CGSizeMake(180, 32)];
[toolbarItem setMaxSize:CGSizeMake(180, 32)];
[toolbarItem setLabel:"Scale"];
}
else if (anItemIdentifier == AddToolbarItemIdentifier)
{
var image = [[CPImage alloc] initWithContentsOfFile:[[CPBundle mainBundle] pathForResource:"add.png"] size:CPSizeMake(30, 25)],
highlighted = [[CPImage alloc] initWithContentsOfFile:[[CPBundle mainBundle] pathForResource:"addHighlighted.png"] size:CPSizeMake(30, 25)];
[toolbarItem setImage:image];
[toolbarItem setAlternateImage:highlighted];
[toolbarItem setTarget:self];
[toolbarItem setAction:@selector(add:)];
[toolbarItem setLabel:"Add Photo List"];
[toolbarItem setMinSize:CGSizeMake(32, 32)];
[toolbarItem setMaxSize:CGSizeMake(32, 32)];
}
else if (anItemIdentifier == RemoveToolbarItemIdentifier)
{
var image = [[CPImage alloc] initWithContentsOfFile:[[CPBundle mainBundle] pathForResource:"remove.png"] size:CPSizeMake(30, 25)],
highlighted = [[CPImage alloc] initWithContentsOfFile:[[CPBundle mainBundle] pathForResource:"removeHighlighted.png"] size:CPSizeMake(30, 25)];
[toolbarItem setImage:image];
[toolbarItem setAlternateImage:highlighted];
[toolbarItem setTarget:self];
[toolbarItem setAction:@selector(remove:)];
[toolbarItem setLabel:"Remove Photo List"];
[toolbarItem setMinSize:CGSizeMake(32, 32)];
[toolbarItem setMaxSize:CGSizeMake(32, 32)];
}
return toolbarItem;
}
@end
/*
This code demonstrates how to add a category to an existing class.
In this case, we are adding the class method +flickr_labelWithText: to
the CPTextField class. Later on, we can call [CPTextField flickr_labelWithText:"foo"]
to return a new text field with the string foo.
Best practices suggest prefixing category methods with your unique prefix, to prevent collisions.
*/
@implementation CPTextField (CreateLabel)
+ (CPTextField)flickr_labelWithText:(CPString)aString
{
var label = [[CPTextField alloc] initWithFrame:CGRectMakeZero()];
[label setStringValue:aString];
[label sizeToFit];
[label setTextShadowColor:[CPColor whiteColor]];
[label setTextShadowOffset:CGSizeMake(0, 1)];
return label;
}
@end
// This class wraps our slider + labels combo
@implementation PhotoResizeView : CPView
{
}
- (id)initWithFrame:(CGRect)aFrame
{
self = [super initWithFrame:aFrame];
var slider = [[CPSlider alloc] initWithFrame:CGRectMake(30, CGRectGetHeight(aFrame) / 2.0 - 8, CGRectGetWidth(aFrame) - 65, 24)];
[slider setMinValue:50.0];
[slider setMaxValue:250.0];
[slider setIntValue:150.0];
[slider setAction:@selector(adjustImageSize:)];
[self addSubview:slider];
var label = [CPTextField flickr_labelWithText:"50"];
[label setFrameOrigin:CGPointMake(0, CGRectGetHeight(aFrame) / 2.0 - 4.0)];
[self addSubview:label];
label = [CPTextField flickr_labelWithText:"250"];
[label setFrameOrigin:CGPointMake(CGRectGetWidth(aFrame) - CGRectGetWidth([label frame]), CGRectGetHeight(aFrame) / 2.0 - 4.0)];
[self addSubview:label];
return self;
}
@end
// This class displays a single photo collection inside our list of photo collecitions
@implementation PhotosListCell : CPView
{
CPTextField label;
CPView highlightView;
}
- (void)setRepresentedObject:(JSObject)anObject
{
if (!label)
{
label = [[CPTextField alloc] initWithFrame:CGRectInset([self bounds], 4, 4)];
[label setFont:[CPFont systemFontOfSize:16.0]];
[label setTextShadowColor:[CPColor whiteColor]];
[label setTextShadowOffset:CGSizeMake(0, 1)];
[self addSubview:label];
}
[label setStringValue:anObject];
[label sizeToFit];
[label setFrameOrigin:CGPointMake(10,CGRectGetHeight([label bounds]) / 2.0)];
}
- (void)setSelected:(BOOL)flag
{
if (!highlightView)
{
highlightView = [[CPView alloc] initWithFrame:CGRectCreateCopy([self bounds])];
[highlightView setBackgroundColor:[CPColor blueColor]];
}
if (flag)
{
[self addSubview:highlightView positioned:CPWindowBelow relativeTo:label];
[label setTextColor:[CPColor whiteColor]];
[label setTextShadowColor:[CPColor blackColor]];
}
else
{
[highlightView removeFromSuperview];
[label setTextColor:[CPColor blackColor]];
[label setTextShadowColor:[CPColor whiteColor]];
}
}
@end
// This class displays a single photo from our collection
@implementation PhotoCell : CPView
{
CPImage image;
CPImageView imageView;
CPView highlightView;
}
- (void)setRepresentedObject:(JSObject)anObject
{
if (!imageView)
{
imageView = [[CPImageView alloc] initWithFrame:CGRectMakeCopy([self bounds])];
[imageView setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable];
[imageView setImageScaling:CPScaleProportionally];
[imageView setHasShadow:YES];
[self addSubview:imageView];
}
[image setDelegate:nil];
image = [[CPImage alloc] initWithContentsOfFile:thumbForFlickrPhoto(anObject)];
[image setDelegate:self];
if ([image loadStatus] == CPImageLoadStatusCompleted)
[imageView setImage:image];
else
[imageView setImage:nil];
}
- (void)imageDidLoad:(CPImage)anImage
{
[imageView setImage:anImage];
}
- (void)setSelected:(BOOL)flag
{
if (!highlightView)
{
highlightView = [[CPView alloc] initWithFrame:[self bounds]];
[highlightView setBackgroundColor:[CPColor colorWithCalibratedWhite:0.8 alpha:0.6]];
[highlightView setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable];
}
if (flag)
{
[highlightView setFrame:[self bounds]];
[self addSubview:highlightView positioned:CPWindowBelow relativeTo:imageView];
}
else
[highlightView removeFromSuperview];
}
@end
// helper javascript functions for turning a Flickr photo object into a URL for getting the image
function urlForFlickrPhoto(photo)
{
return "http://farm" + photo.farm + ".static.flickr.com/" + photo.server + "/" + photo.id+"_" + photo.secret + ".jpg";
}
function thumbForFlickrPhoto(photo)
{
return "http://farm" + photo.farm + ".static.flickr.com/" + photo.server + "/" + photo.id + "_" + photo.secret + "_m.jpg";
}

View File

@@ -0,0 +1,88 @@
@import <Foundation/CPObject.j>
@import <AppKit/CPView.j>
@import <AppKit/CPButton.j>
@import <AppKit/CPWebView.j>
@import "LOBoard.j"
@implementation LOInfoView : CPView
{
}
- (void)drawRect:(CGRect)r
{
[[CPColor whiteColor] setFill]
var path = [CPBezierPath bezierPath];
[path appendBezierPathWithRoundedRect:CGRectMake(5, 0, CGRectGetWidth([self bounds]) - 10.0, CGRectGetHeight([self bounds])) xRadius:10 yRadius:10];
[path fill];
}
@end
@implementation AppController : CPObject
{
}
- (CPPanel)initInfoWindow
{
var infoWindow = [[CPPanel alloc] initWithContentRect:CGRectMake(400, 50, 320, 480) styleMask:CPHUDBackgroundWindowMask | CPResizableWindowMask];
[infoWindow setFloatingPanel:YES];
var _infoContent = [infoWindow contentView],
_iconImage = [[CPImage alloc] initWithContentsOfFile:"Resources/icon.png" size:CPSizeMake(59, 60)],
_iconView = [[CPImageView alloc] initWithFrame:CGRectMake(125, 0, 59, 60)];
[_iconView setImage:_iconImage];
[_infoContent addSubview:_iconView];
var _infoView = [[LOInfoView alloc] initWithFrame:CGRectMake(0, 65, 320, 395)],
_webView = [[CPWebView alloc] initWithFrame:CGRectMake(20, 0, 270, 370)];
[_webView loadHTMLString:@"<center><h3>Lights Off</h3></center> <p>Lights Off is a fantastic game exclusively for iPhone and iPod touch and inspired by Tiger Electronic's 'Lights Out'.</p> <p>The goal of the game is simply to switch all of the lights off, but it's harder than it looks! Give the first few levels a try in the playable demo to the left.</p><center><img src='Resources/avail_on_app_store.png'></center>"];
[_infoView addSubview:_webView];
[_infoContent addSubview:_infoView];
return infoWindow;
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
/* Enable Logging (DEBUG) */
// CPLogRegister(CPLogPopup);
var rootWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask];
[rootWindow setBackgroundColor:[CPColor grayColor]];
[rootWindow orderFront:self];
var infoWindow = [self initInfoWindow],
gameWindow = [[CPPanel alloc] initWithContentRect:CGRectMake(50, 50, 324, 482) styleMask:CPHUDBackgroundWindowMask];
[gameWindow setFloatingPanel:YES];
[gameWindow setTitle:@"Lights Off"];
contentView = [gameWindow contentView];
var _board = [[LOBoard alloc] initWithFrame:CGRectMake(2, 0, 320, 480)],
_bgImage = [[CPImage alloc] initWithContentsOfFile:"Resources/lo-background.png" size:CPSizeMake(320, 480)];
[_board setImage:_bgImage];
[_board resetBoard];
var _buttonImage = [[CPImage alloc] initWithContentsOfFile:"Resources/button-reset.png" size:CPSizeMake(90, 28)],
_buttonPressImage = [[CPImage alloc] initWithContentsOfFile:"Resources/button-reset-press.png" size:CPSizeMake(90, 28)],
_resetButton = [[CPButton alloc] initWithFrame:CGRectMake(195, 422, 90, 28)];
[_resetButton setImage:_buttonImage];
[_resetButton setAlternateImage:_buttonPressImage];
[_resetButton setBordered:NO];
[contentView addSubview:_board];
[contentView addSubview:_resetButton];
[_resetButton setTarget:_board];
[_resetButton setAction:@selector(resetBoard)];
[gameWindow orderFront:self];
[infoWindow orderFront:self];
}
@end

View File

@@ -0,0 +1,47 @@
@import <Foundation/CPObject.j>
@implementation AppController : CPObject
{
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
// The end result of this layout will be the kind of master/detail/auxilliary view
// found in iTunes, Mail, and many other apps.
var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask],
contentView = [theWindow contentView];
var navigationArea = [[CPView alloc] initWithFrame:CGRectMake(0.0, 0.0, 150.0, CGRectGetHeight([contentView bounds]) - 150.0)];
[navigationArea setBackgroundColor:[CPColor redColor]];
// This view will grow in height, but stay fixed width attached to the left side of the screen.
[navigationArea setAutoresizingMask:CPViewHeightSizable | CPViewMaxXMargin];
[contentView addSubview:navigationArea];
var metaDataArea = [[CPView alloc] initWithFrame:CGRectMake(0.0, CGRectGetMaxY([navigationArea frame]), 150.0, 150.0)];
[metaDataArea setBackgroundColor:[CPColor greenColor]];
// This view will stay the same size in both directions, and fixed to the lower left corner.
[metaDataArea setAutoresizingMask:CPViewMinYMargin | CPViewMaxXMargin];
[contentView addSubview:metaDataArea];
var contentArea = [[CPView alloc] initWithFrame:CGRectMake(150.0, 0.0, CGRectGetWidth([contentView bounds]) - 150.0, CGRectGetHeight([contentView bounds]))];
[contentArea setBackgroundColor:[CPColor blueColor]];
// This view will grow in both height an width.
[contentArea setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable];
[contentView addSubview:contentArea];
[theWindow orderFront:self];
}
@end

View File

@@ -0,0 +1,76 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2
mQINBFJJNS0BEADE9QkGDstkCAbUWIMnyzfYb+Z7KdF1vFR2WLe4yov9lwQ1gfjy
3lV5AZfEmNe+AGTRney/jpp9It0wyVQWvKM7N9yvFkWRVHq/thz8oDz/SknBoD1F
jACJgPXGlK3+YiXa03e3XM1JZxBgvHEH4MQTnNHQ2N7ey2J3oZ6NtOkZdu1xHKZS
hn1WUR9zRMa1XK1yLAowlKThnPk+jQVrMrwLtjoJ4wyWHGz+sZJw0IkV/7YJa2it
0h7z2x0JmkkiNtYGmbwiTKIIbR2ZcjXLN/VgQ5dvMJDHqkiuVG8VCZ5RetYbLPza
6+xsJoByuAzK5Zgg8lB73TgjkJYN19F56W10e5b+4VUYjU1g7rFbYh0JRz4u6IVJ
4lJykVHTCIVbGPNeBlqw/LeGnDsXV3a9OGnWvHZzLzFEp9RZwrUMOFUtdkEwZU+j
nt/I7c1+RVrmjW0aNulR9fywD+GdaTEnxl08m2yNokMdjy6Z43yUNbYf4F5HFYCi
wZRD40jHb8N89DPZhdZaDub5F+ePfy3+JIXm1e8rdWjr1z9UjF8eX5XQ89OVNS62
Kb2VM5YT/gCa/4Iwaoag/URVyB/BDJIuqjBpu6Al6zdtuOkvbawoezrqaWN6JJF7
BBaVYy2AS5OjGtu8Uxfz0iYevwql1lIczK2c0E+InNNyFPOu/rpppgURwQARAQAB
tCRSeWFuIEphY29icyA8cnlhbi5tamFjb2JzQGdtYWlsLmNvbT6JAjkEEwECACMF
AlOeONMCGwMHCwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRC9jrHuX4qBgQJ7
D/kBzMpbQeoZ6LCIRs2Yngalc+8U+Td9GSjdmo1oIjrYtowSTeOQcoIznv8gKY2n
yUypNNsgYtT8lpMtnT6BjHJU05vdGBVZDbD6NnxcgIwo3DM9I9eazjy9oHVIXPDu
offTfwFmVEIlWWLcn0bHzyy70Gp7p0J3QbEN1Q2nXNX5LXzqfPlaeLpwotnSiKD8
xNZ/iKVhMduLOZ6YY2jDcdlYba1hDoDHgO1Xh0wR2ZO7Yl50XM4mQlMudX1YsTuy
dLEbEtX+CR2uMpvhPYUhQzE4st9r7ZPlUO33cOn5FCyn29EB5DyMpILjS6M9Vlwa
oByPOhsCg7U23gviGxx7h/9dSFx6pZ7/Ejhwq+NgtmnMn+xQ5SL0UgVm1O3lruf+
0OxlkShpx85PRJIr+lJvFAulb+h5kjzDTV5ekqL0poGlRzLvC4xSbEzYdpBN2mbD
sR2yR4KJ6K972CufYTdKVk2hnvlYunP1Yg7NYaQvSITKbcZ+M6tvAkbXyOV6MGVV
u8dhKwKmR4+s8Rajf0x2n2wl7DZy5sdSmSIGPMYOskgsVxXcuaWa7DEqcjrdoGPQ
uJiBubAQnMKnUvOwY1dsD3H7FQu3INQbarngcPUfxKjGWRveGYYQtAf5FF5Cuj7T
OuQM2+CVaPWlrj944IEGWp75ezWDCsEMTQZC7B86BDer2bQvUnlhbiBKYWNvYnMg
KER1a2VsYW5hKSA8cnlhbi5tamFjb2JzQGdtYWlsLmNvbT6JAjMEMAECAB0FAlOe
OU8WHQBSZW1vdmVkIHRoZSBjb21tZW50LgAKCRC9jrHuX4qBgTLxEACrFljsl+8F
EPHZ2fhMr+2601RktBttkl3RgFMpaXKBBuiGwaatfo9k6GsXaVfzAXpR7jf1RxUr
qzJ3H8YT5mvnXzVSe0i42Ykfj8+SxsggfcJfLZfyMtTsT0mE1WCb1JaTfn0HyYum
kuVtCm3pBhrwlyEGjRMx1HKeOnQCXYLjtTgjsmlitRl/mwKpHkTuKOdt9rpTU77H
x3+Hi5YEeSDd5jEujj0THC98WcokhBuKT3Ki805jqPuyFIN17+cJK8rHEQSnZOLG
Xj/VzogQ/t2OZw5IpmdLefLRTCvcZNsfqsHLc543+C0dzK3eL2z+g/rOU0VnVjf9
ANKZHzoUkYSmKDS/JQDXgCgKC5FjtyEjvP4xgQasqmtt3FWT/CljxEqP5tXGdLnE
MBeKJO9UkomG2bHTeJhS5yVL53ULtMvNmQX+21zz7QQdbL6wIKw7MwjhmkuUAeKG
+6ZfqEJnCCEvOp8Q0RddQ00JLneY54WuR1I17+peDIc59zS+wpwCcHA2MiVBwouB
2eUYb0O+TBdcrx/NMoIQWJ6QK2z/CP90tCKcMvCoU0fCRwkiWk9CFcrk0MAbPt8N
C3LV3Xr9qFBAyPRsg8SkTzeWf9oCsQDydWTN+UydHMbdTnQLs4qCt5/i3jOmYpSK
j5f5VcqO+Uq8fcAFasQt8giSuzBrcdW4+4kCOAQTAQIAIgUCUkk1LQIbAwYLCQgH
AwIGFQgCCQoLBBYCAwECHgECF4AACgkQvY6x7l+KgYFlkxAAkHwIjv9bIcHhQ5HK
It6ZKPTEuZJM5VUYGO3o0bA8wPRGapJ+6ndCbeC7/U+W8ShfNJM789cFLTN0dQbU
jbbkucTCqG+0lAgimP7KiCLx2Hs3McdOTHt3m4dzPiUsz1waNDkrD3QzU6k6jebW
ApAzhMkYH1IALxd4yScNR2CPcdV/YQUt4OG0+h69rubsHbszQOpAsFoygNAZGWbD
6i4gQz5CYat+TCmooI/kJh/cdZ+IFfwZXfQHndwsmByqZYydu4Lc0i/KgaW4r4fp
u5/L19qWPjoJKQf8y1aiVjEq/QCi0fKEAIhrOJq6Woyv97WDsGu5u0yDIOpCInSC
5J8okLl2CtATYh9YayxAHyus/137skhJwwLwAadpmsXeZR+xOpE8HMXxS8DiVH+O
nu3beOZnY6g4g8/uxzY0FpQ6MB1DRVPRxPZ/+3RjMqAjSRFVZag3zwv19Qu/IHhR
uQal7eR5Ml0MqTBPl2cKt3iKmrY2RIMfLC2Emv5cH5y3iep7A6FrLn4fiS6u0AXJ
NmPk23C65K/dlIdytm9qZi7EJpOw0IE1x4UU6wNS+kM4mqnWtzCZvMIhq2lQY1k0
PEB2NAGrOgNRkr6MsL4XOQhy6lT18sO39LTWdMoz0IviGSpdO9MukxhraBt/6GWK
YP8E+8TwsCqxq2LD/9E8G4n9IaC5Ag0EUkk1LQEQAK5R+XG9q2rcVkZhsTOOJf6k
Bc/aYYsEJktnZD7jqFRUve9p/K31qPL/qtMyLxQqRJla9PUiPtwY1vZo+omtg1Eh
eu2Na6z7m5ZuFE7GkS2hvFlM/STqiZ09Vrv8CaCb8Vs/sbrsupgeNGOTZOf53DHF
VszV9C1KY5Ux+t7gua0mKwBOrk4l5ctGDsV7GE8BsplfZHwsYKW2ez4462s2lgDf
H+nBxToT0pv5OVvE6Iv5oXUTaotpOm2s/leNiHBYOS+qYXq58LcvjNaFY6ROexWW
JQbaK8jEYP5HKSA7p2+5Cnf1FNP4LjH0dnT3OOC5PTlZ9Di4reLtLlsmCQkhRRyx
tjZfWCNDI70pme0SMXUe4lYnLjNTrmryu9PV0RYaMAL1VZYhrMLCT0SMaHNm1gKN
+j00X8bGTEvA9bTzWo2oOS0r1hw0AdgfeFaMvSzTaiZfrB5a6UEDDMwrraaTwlPp
SXVL9OWtdvr5kuIwMG6uHxGXmDHkxQsm0jqiWMl8y43QJ1qJQ02DYyAFGH/liKmt
j46fxRWxoCUVF6xaBf7zQv3h5YouM+tVe0X/bcZKGc+tFbngy8MtP3cuv5I1UZ+C
Gg9mttl8/SrLtpOtHSkKtJqU69sVVZazRn/GXApnhTdSMySCkmwdafEnK73izBt/
SJiaoDIvVejvuIt5jFudABEBAAGJAh8EGAECAAkFAlJJNS0CGwwACgkQvY6x7l+K
gYFX2xAAhiK/NeQdoZ44MqNxeXyo+xqBAotYGXZ5G8pNc07FtDcU/Ile4PKpmrVG
zH0de0Gw1e2gTHmDJHMadPGjaYqDK6ZTXE4M58u7KAoQNQIXU4URHmTSBreB3qVp
kXepM6lGZq5/DXOT2r+OzyCDI3isza2Xqzy6doC2/QGPMG3GMgc1aolToPznSTWX
KIlOuEpvGvZICprlb4fOVAa6nGF5WFi+kyF4UpkxOniaVW6fAfezlBEiQKlJe2Rh
SsDBbS2DmRw/6TEWzd2DVobfWfK+wWDLqm6L+zS3StkMCm3A6UKkoHZzWAAbKqta
sbQPFFfJnKyWXi0kjiAHlycdMouSgk1JY72fCxHUMxYRLKHGvpX1o2MlqUkjn5Yv
OVD9U8w4BUnv/iXd0Txdp1nkz/NLM174HCrQKSfubKNL1K53K0+iFNo4Ow2RJodR
71SGZgfkBxjD4bkJhaLB9xUmBkz6PaQl7pRVBtS7INbEbiyR2QvMYwsn7XwY92iI
WQ1yopiNGIub7pvrhs/qpzmftb/r9OaiGUoXB0FeQnDHo7x0vulX+0nU9crPcVCe
h/qQe/KCbs6ZuUkKKG9Y4XreJ8S1s3iGsVefwHQ/mjRB1b857of+61K4pquQ4u9J
svBlAR7nTIPqbZDw1lf5V2UrsyXQ2xBpCp5WGlRZ+SGvB0zvlzU=
=xJ8l
-----END PGP PUBLIC KEY BLOCK-----

View File

@@ -0,0 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQConqV+vS0WfY9swk8St+JcRuhft0jTg4IrAEfmxahSLurkbf54jbe8mrNn96Nm2gkRzs2RNVQ9r4dZzdhKTUk395Vs3LbX3cfdRNaCrs3udqhRZK7Go69DQECnEHFNczBxSrhT5DoO4nuzVimHgSsX7rHKHo6J7SDNowf83/nLUr7SAJvOeQo5yZQqqZQi5NXqH6pEOQtWPILdbZWuhq8s4JIXc38I+w3IXEJ0ttsfkyShv85bhwSFzrOlq2oGY37YVWeXPREXg9ksA6rlxe29SIdAQbINlgJ/ELzDVMYiaQkI5opAvI2EzPVd4325PcMgyFM/weO9F6bKZaGCNyt3

View File

@@ -0,0 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCw3QQtYgRViVH8ZpkQ2A7BuCeyPYC4hB9kKNhxwUfJ2hFgW8soGMBhsLN+vOeAJ2IXDMsezJO2/qhoZFQMvHoWpWTRTLPeNtBsKD+nhOZX28A4D+QRzVZ6hdWoh9W+mIP69MIT3aX35oLb86IycbNdRJlEK4FAUt7tjezNkU7boQ== root@use1-2.nitrousbox.com

View File

@@ -0,0 +1,15 @@
Type Bits/KeyID Date User ID
pub 1024/79949ADD 2005/08/07 sun <sun.strongswan.org>
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: 2.6.3i
mQCNA0L2Km8AAAEEANRAVMn8HBxfYaGhLqtQ3IZJArn9wpcQ+7sH/F9PaXIjzHRQ
rfFkfmxxp9lVjCk0LM/BnnlnUmyz6F8K7V0Gi40Am4+ln1zHvZZIQJYGrDhDnjb7
I5TVeD4Ib5bQ1CoUbIhv2LocCeR6OjefQgGmerC5RQ3d5ci7uB0pVpd5lJrdAAUR
tBhzdW4gPHN1bi5zdHJvbmdzd2FuLm9yZz6JAJUDBRBC9ipvHSlWl3mUmt0BAUZR
A/43nuZbxADMSviu54Mj8pvQbYeGLQVabiWT6h7L0ZPX4MWpFH3dTixBfRrZRSsj
0AgiMMuZAMebfOe+Xf9uDQv7p1yumEiNg43tg85zyawkARWNTZZ04woxtvAqNwXn
lQotGz7YA6JMxry9RQo5yI4Y4dPnVZ/o8eDpP0+I88cOhQ==
=lLvB
-----END PGP PUBLIC KEY BLOCK-----

View File

@@ -0,0 +1,137 @@
EnableExplicit
; ##################################################### Includes ####################################################
XIncludeFile "Includes/AudioOut.pbi"
; ##################################################### Prototypes ##################################################
; ##################################################### Structures ##################################################
; ##################################################### Constants ###################################################
#Samplerate = 44100
; ##################################################### Structures ##################################################
Structure Main
*AudioOut
Quit.i
EndStructure
Global Main.Main
Structure Main_Window
ID.i
TrackBar.i [10]
EndStructure
Global Main_Window.Main_Window
; ##################################################### Variables ###################################################
Global Frequency.d = 1000
Global Amplitude.d = 0.25
; ##################################################### Procedures ##################################################
Procedure Main_Window_Open()
Main_Window\ID = OpenWindow(#PB_Any, 0, 0, 800, 100, "AudioOut Example", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_ScreenCentered)
If Main_Window\ID
Main_Window\TrackBar[0] = TrackBarGadget(#PB_Any, 10, 10, 780, 30, 0, 20000)
SetGadgetState(Main_Window\TrackBar[0], Frequency)
Main_Window\TrackBar[1] = TrackBarGadget(#PB_Any, 10, 40, 780, 30, 0, 1000)
SetGadgetState(Main_Window\TrackBar[1], Amplitude*1000)
EndIf
EndProcedure
Procedure Notifier_CallBack(*AudioOut)
Protected *Temp, Temp_Size.i
Static Rotation.d
While AudioOut::GetQueuedBlocks(*AudioOut) <= 3
Temp_Size = AudioOut::GetBufferBlocksize(*AudioOut)
If Temp_Size > 0
*Temp = AllocateMemory(Temp_Size)
Define Left.d, Right.d, i
For i = 0 To Temp_Size / 4 - 1
Left = Sin(Rotation) * Amplitude
Right = Sin(Rotation) * Amplitude
PokeW(*Temp + i*4 , Left*32767)
PokeW(*Temp + i*4 + 2, Right*32767)
Rotation + 2.0*#PI / #Samplerate * Frequency
Next
AudioOut::Write_Data(Main\AudioOut, *Temp, Temp_Size)
FreeMemory(*Temp)
EndIf
Wend
EndProcedure
; ##################################################### Initialisation ##############################################
Main_Window_Open()
AudioOut::GetDevices()
ForEach AudioOut::Device()
Debug PeekS(AudioOut::@Device()\szPname)
Next
Main\AudioOut = AudioOut::Initialize(#WAVE_MAPPER, #Samplerate, 2, 16, @Notifier_CallBack())
If Not Main\AudioOut
Debug AudioOut::GetError()
End
EndIf
Notifier_CallBack(Main\AudioOut)
; ##################################################### Main ########################################################
Repeat
Repeat
Select WaitWindowEvent(100)
Case #PB_Event_Gadget
Select EventGadget()
Case Main_Window\TrackBar[0]
Frequency = GetGadgetState(Main_Window\TrackBar[0])
Debug Frequency
Case Main_Window\TrackBar[1]
Amplitude = GetGadgetState(Main_Window\TrackBar[1]) / 1000
EndSelect
Case #PB_Event_CloseWindow
Main\Quit = #True
Case 0
Break
EndSelect
ForEver
Until Main\Quit
; ##################################################### End #########################################################
AudioOut::Deinitialize(Main\AudioOut)
; IDE Options = PureBasic 5.30 Beta 2 (Windows - x64)
; CursorPosition = 109
; FirstLine = 79
; Folding = -
; EnableUnicode
; EnableThread
; EnableXP

View File

@@ -0,0 +1,203 @@
Structure Memory_Operation
Src_Offset.q
Src_Size.q
Dst_Offset.q
Dst_Size.q
Copy_Size.q
EndStructure
; #### Cuts the Offset's / Sizes of the memory operation to prevent memory violations
Procedure Memory_Operation_Check(*Memory_Operation.Memory_Operation)
Protected Temp.q
If *Memory_Operation\Src_Offset < 0
*Memory_Operation\Copy_Size + *Memory_Operation\Src_Offset
*Memory_Operation\Dst_Offset - *Memory_Operation\Src_Offset
*Memory_Operation\Src_Offset - *Memory_Operation\Src_Offset
EndIf
If *Memory_Operation\Dst_Offset < 0
*Memory_Operation\Copy_Size + *Memory_Operation\Dst_Offset
*Memory_Operation\Src_Offset - *Memory_Operation\Dst_Offset
*Memory_Operation\Dst_Offset - *Memory_Operation\Dst_Offset
EndIf
Temp = *Memory_Operation\Src_Size - *Memory_Operation\Src_Offset
If *Memory_Operation\Copy_Size > Temp
*Memory_Operation\Copy_Size = Temp
EndIf
Temp = *Memory_Operation\Dst_Size - *Memory_Operation\Dst_Offset
If *Memory_Operation\Copy_Size > Temp
*Memory_Operation\Copy_Size = Temp
EndIf
If *Memory_Operation\Copy_Size < 0
*Memory_Operation\Copy_Size = 0
EndIf
ProcedureReturn #True
EndProcedure
; #### Fills a *Destination with a specified amount of data.
; #### It cuts everything, to prevent memory violations
Procedure Memory_Range_Fill(Ascii.a, Fill_Size.q, *Dst, Dst_Offset.q, Dst_Size.q=-1)
Protected Temp.q
If Not *Dst
ProcedureReturn #False
EndIf
If Dst_Size = -1
Dst_Size.q = MemorySize(*Dst)
EndIf
If Dst_Offset < 0
Fill_Size + Dst_Offset
Dst_Offset - Dst_Offset
EndIf
Temp = Dst_Size - Dst_Offset
If Fill_Size > Temp
Fill_Size = Temp
EndIf
If Fill_Size > 0
FillMemory(*Dst+Dst_Offset, Fill_Size, Ascii)
EndIf
ProcedureReturn #True
EndProcedure
; #### Copies a specified amount of data (Copy_Size) from the source to the destination.
; #### It cuts everything, to prevent memory violations
Procedure Memory_Range_Copy(*Src, Src_Offset.q, *Dst, Dst_Offset.q, Copy_Size.q, Src_Size.q=-1, Dst_Size.q=-1)
Protected Temp.q
If Not *Src
ProcedureReturn #False
EndIf
If Not *Dst
ProcedureReturn #False
EndIf
If Src_Size = -1
Src_Size.q = MemorySize(*Src)
EndIf
If Dst_Size = -1
Dst_Size.q = MemorySize(*Dst)
EndIf
If Src_Offset < 0
Copy_Size + Src_Offset
Dst_Offset - Src_Offset
Src_Offset - Src_Offset
EndIf
If Dst_Offset < 0
Copy_Size + Dst_Offset
Src_Offset - Dst_Offset
Dst_Offset - Dst_Offset
EndIf
Temp = Src_Size - Src_Offset
If Copy_Size > Temp
Copy_Size = Temp
EndIf
Temp = Dst_Size - Dst_Offset
If Copy_Size > Temp
Copy_Size = Temp
EndIf
If Copy_Size > 0
CopyMemory(*Src+Src_Offset, *Dst+Dst_Offset, Copy_Size)
EndIf
ProcedureReturn #True
EndProcedure
; #### Copies (MoveMemory) a specified amount of data (Copy_Size) from the source to the destination.
; #### It cuts everything, to prevent memory violations
Procedure Memory_Range_Move(*Src, Src_Offset.q, *Dst, Dst_Offset.q, Copy_Size.q, Src_Size.q=-1, Dst_Size.q=-1)
Protected Temp.q
If Not *Src
ProcedureReturn #False
EndIf
If Not *Dst
ProcedureReturn #False
EndIf
If Src_Size = -1
Src_Size.q = MemorySize(*Src)
EndIf
If Dst_Size = -1
Dst_Size.q = MemorySize(*Dst)
EndIf
If Src_Offset < 0
Copy_Size + Src_Offset
Dst_Offset - Src_Offset
Src_Offset - Src_Offset
EndIf
If Dst_Offset < 0
Copy_Size + Dst_Offset
Src_Offset - Dst_Offset
Dst_Offset - Dst_Offset
EndIf
Temp = Src_Size - Src_Offset
If Copy_Size > Temp
Copy_Size = Temp
EndIf
Temp = Dst_Size - Dst_Offset
If Copy_Size > Temp
Copy_Size = Temp
EndIf
If Copy_Size > 0
MoveMemory(*Src+Src_Offset, *Dst+Dst_Offset, Copy_Size)
EndIf
ProcedureReturn #True
EndProcedure
; #### Mirrors the memory, usable for little/big endian switching
Procedure Memory_Mirror(*Memory, Memory_Size)
Protected Elements, i
Protected Temp.a, *A.Ascii, *B.Ascii
If Not *Memory
ProcedureReturn #False
EndIf
If Memory_Size < 1
ProcedureReturn #True
EndIf
Elements = Memory_Size/2
*A = *Memory
*B = *Memory + Memory_Size - 1
For i = 0 To Elements - 1
Temp = *A\a
*A\a = *B\a
*B\a = Temp
*A + 1
*B - 1
Next
ProcedureReturn #True
EndProcedure
; IDE Options = PureBasic 5.31 (Windows - x64)
; CursorPosition = 190
; FirstLine = 177
; Folding = -
; EnableXP
; DisableDebugger

275
samples/SAS/detect_phi.sas Normal file
View File

@@ -0,0 +1,275 @@
%macro check_dataset(dset =, obs_lim = max, eldest_age = 89) ;
%local i ;
%local inset_name ;
%let inset_name = &dset ;
%if %lowcase(&obs_lim) = max %then %do ;
%** Nothing ;
%end ;
%else %do ;
proc surveyselect
data = &inset_name
out = __sub_dset
method = srs
sampsize = &obs_lim SELECTALL
seed = 1234567
noprint
;
run;
%let dset = __sub_dset ;
%end ;
%macro check_varname(regx, msg) ;
create table possible_bad_vars as
select name, label
from these_vars
where prxmatch(compress("/(&regx)/i"), name)
;
%if &sqlobs > 0 %then %do ;
insert into phi_warnings(dset, variable, label, warning)
select "&inset_name" as dset, name, label, "&msg"
from possible_bad_vars
;
%end ;
%mend check_varname ;
%macro check_vars_for_mrn(length_limit = 6, obs_lim = max) ;
%local char ;
%let char = 2 ;
proc sql noprint ;
select name
into :mrn_array separated by ' '
from these_vars
where type = &char and length ge &length_limit
;
quit ;
%if &sqlobs > 0 %then %do ;
%put Checking these vars for possible MRN contents: &mrn_array ;
data __gnu ;
retain
mrn_regex_handle
badcount
;
set &inset_name (obs = &obs_lim keep = &mrn_array) ;
if _n_ = 1 then do ;
mrn_regex_handle = prxparse("/&mrn_regex/") ;
badcount = 0 ;
end ;
array p &mrn_array ;
do i = 1 to dim(p) ;
if prxmatch(mrn_regex_handle, p{i}) then do ;
badvar = vname(p{i}) ;
badvalue = p{i} ;
badcount = _n_ ;
output ;
end ;
keep badvar badvalue badcount ;
end ;
run ;
proc sql noprint ;
select compress(put(max(badcount), best.))
into :badcount
from __gnu
;
insert into phi_warnings(dset, variable, warning)
select distinct "&inset_name", badvar, "Could this var hold MRN values? Contents of %trim(&badcount) records match the pattern given for MRN values. MRNs should never move across sites."
from __gnu ;
drop table __gnu ;
quit ;
%end ;
%mend check_vars_for_mrn ;
%macro check_vars_for_oldsters(eldest_age = 89, obs_lim = max) ;
%local dtfmts ;
%let dtfmts = 'B8601DA','B8601DN','B8601DT','B8601DZ','B8601LZ','B8601TM','B8601TZ','DATE','DATEAMPM','DATETIME','DAY','DDMMYY',
'DDMMYYB','DDMMYYC','DDMMYYD','DDMMYYN','DDMMYYP','DDMMYYS','DOWNAME','DTDATE','DTMONYY','DTWKDATX','DTYEAR',
'DTYYQC','E8601DA','E8601DN','E8601DT','E8601DZ','E8601LZ','E8601TM','E8601TZ','HHMM','HOUR','JULDAY','JULIAN',
'MMDDYY','MMDDYYB','MMDDYYC','MMDDYYD','MMDDYYN','MMDDYYP','MMDDYYS','MMSS','MMYY','MMYY','MONNAME','MONTH','MONYY',
'PDJULG','PDJULI','QTR','QTRR','WEEKDATE','WEEKDATX','WEEKDAY','WEEKU','WEEKV','WEEKW','WORDDATE','WORDDATX',
'YEAR','YYMM','YYMMC','YYMMD','YYMMN','YYMMP','YYMMS','YYMMDD','YYMMDDB','YYMMDDC','YYMMDDD','YYMMDDN','YYMMDDP',
'YYMMDDS','YYMON','YYQ','YYQC','YYQD','YYQN','YYQP','YYQS','YYQR','YYQRC','YYQRD','YYQRN','YYQRP','YYQRS' ;
%local num ;
%let num = 1 ;
proc sql noprint ;
select name
into :dat_array separated by ' '
from these_vars
where type = &num and (format in (&dtfmts) or lowcase(name) like '%date%')
;
/* added by cb to shorten the process of looking at all dates */
%if &sqlobs > 0 %then %do ;
%put Checking these vars for possible DOB contents: &dat_array ;
select 'min(' || trim(name) || ') as ' || name into :var_list separated by ','
from these_vars
where type = &num and (format in (&dtfmts) or lowcase(name) like '%date%')
;
create table __gnu as
select &var_list from &inset_name
;
/* end cb additions */
quit ;
data __gnu ;
set __gnu (obs = &obs_lim keep = &dat_array) ;
array d &dat_array ;
do i = 1 to dim(d) ;
if n(d{i}) then maybe_age = %calcage(bdtvar = d{i}, refdate = "&sysdate9."d) ;
if maybe_age ge &eldest_age then do ;
badvar = vname(d{i}) ;
badvalue = d{i} ;
output ;
end ;
keep badvar badvalue maybe_age ;
end ;
run ;
proc sql outobs = 30 nowarn ;
insert into phi_warnings(dset, variable, warning)
select distinct "&inset_name", badvar, "If this is a date, at least one value is " || compress(put(maybe_age, best.)) || " years ago, which is older than &eldest_age.. " ||
"If this date applies to a person, the record is probably PHI."
from __gnu ;
drop table __gnu ;
quit ;
%end ;
%else %do ;
%put No obvious date variables found in &inset_name.--skipping age checks. ;
%end ;
%mend check_vars_for_oldsters ;
proc contents noprint data = &inset_name out = these_vars ;
run ;
proc sql noprint ;
create table phi_warnings (dset char(50), variable char(256), label char(256), warning char(200)) ;
%check_varname(regx = mrn|hrn , msg = %str(Name suggests this var may be an MRN, which should never move across sites.)) ;
%check_varname(regx = birth_date|BirthDate|DOB|BDate , msg = %str(Name suggests this var may be a date of birth.)) ;
%check_varname(regx = SSN|SocialSecurityNumber|social_security_number|socsec, msg = %str(Name suggests this var may be a social security number.)) ;
%if %symexist(locally_forbidden_varnames) %then %do ;
%check_varname(regx = &locally_forbidden_varnames, msg = %str(May be on the locally defined list of variables not allowed to be sent to other sites.)) ;
%end ;
quit ;
%check_vars_for_mrn(obs_lim = &obs_lim) ;
%check_vars_for_oldsters(obs_lim = &obs_lim, eldest_age = &eldest_age) ;
title3 "WARNINGS for dataset &inset_name:" ;
proc sql noprint ;
select count(*) as num_warns into :num_warns from phi_warnings ;
%if &num_warns = 0 %then %do ;
reset print outobs = 5 NOWARN ;
select "No obvious PHI-like data elements in &inset_name--BUT PLEASE INSPECT THE CONTENTS AND PRINTs TO FOLLOW" as x label = "No warnings for &inset_name"
from &inset_name
;
%do i = 1 %to 5 ;
%put No obvious phi-like data elements in &inset_name. BUT PLEASE INSPECT THE CONTENTS AND PRINTs CAREFULLY TO MAKE SURE OF THIS! ;
%end ;
%end ;
%else %do ;
reset print ;
select variable, warning from phi_warnings
order by variable, warning
;
quit ;
%end ;
title3 "Dataset &inset_name" ;
proc contents data = &inset_name varnum ;
run ;
/*
proc print data = &inset_name (obs = 20) ;
run ;
*/
** TODO: make the print print out recs that trip the value warnings. ;
proc sql number ;
select *
from &inset_name (obs = 20)
;
quit ;
quit ;
%RemoveDset(dset = __sub_dset) ;
%RemoveDset(dset = possible_bad_vars) ;
%RemoveDset(dset = phi_warnings) ;
%RemoveDset(dset = these_vars) ;
%mend check_dataset ;
%macro detect_phi(transfer_lib, obs_lim = max, eldest_age = 89) ;
%put ;
%put ;
%put ============================================================== ;
%put ;
%put Macro detect_phi: ;
%put ;
%put Checking all datasets found in %sysfunc(pathname(&transfer_lib)) for the following signs of PHI: ;
%put - Variable names signifying sensitive items like 'MRN', 'birth_date', 'SSN' and so forth. ;
%if %symexist(locally_forbidden_varnames) %then %do ;
%put - Variable names on the list defined in the standard macro variable locally_forbidden_varnames (here those names are: &locally_forbidden_varnames). ;
%end ;
%put - Contents of CHARACTER variables that match the pattern given in the standard macro variable mrn_regex (here that var is &mrn_regex) ;
%put Please note that numeric variables ARE NOT CHECKED FOR MRN-LIKE CONTENT. ;
%put - The contents of date variables (as divined by their formats) for values that, if they were DOBs, would indicate a person older than &eldest_age years. ;
%put ;
%put THIS IS BETA SOFTWARE-PLEASE SCRUTINIZE THE RESULTS AND REPORT PROBLEMS TO pardee.r@ghc.org. ;
%put ;
%put THIS MACRO IS NOT A SUBSTITUTE FOR HUMAN INSPECTION AND THOUGHT--PLEASE CAREFULLY INSPECT ALL VARIABLES--WHETHER ;
%put OR NOT THEY TRIP A WARNING--TO MAKE SURE THE DATA COMPORTS WITH YOUR DATA SHARING AGREEMENT!!! ;
%put THIS MACRO IS NOT A SUBSTITUTE FOR HUMAN INSPECTION AND THOUGHT--PLEASE CAREFULLY INSPECT ALL VARIABLES--WHETHER ;
%put OR NOT THEY TRIP A WARNING--TO MAKE SURE THE DATA COMPORTS WITH YOUR DATA SHARING AGREEMENT!!! ;
%put ;
%put THIS MACRO IS NOT A SUBSTITUTE FOR HUMAN INSPECTION AND THOUGHT--PLEASE CAREFULLY INSPECT ALL VARIABLES--WHETHER ;
%put OR NOT THEY TRIP A WARNING--TO MAKE SURE THE DATA COMPORTS WITH YOUR DATA SHARING AGREEMENT!!! ;
%put THIS MACRO IS NOT A SUBSTITUTE FOR HUMAN INSPECTION AND THOUGHT--PLEASE CAREFULLY INSPECT ALL VARIABLES--WHETHER ;
%put OR NOT THEY TRIP A WARNING--TO MAKE SURE THE DATA COMPORTS WITH YOUR DATA SHARING AGREEMENT!!! ;
%put ;
%put THIS MACRO IS NOT A SUBSTITUTE FOR HUMAN INSPECTION AND THOUGHT--PLEASE CAREFULLY INSPECT ALL VARIABLES--WHETHER ;
%put OR NOT THEY TRIP A WARNING--TO MAKE SURE THE DATA COMPORTS WITH YOUR DATA SHARING AGREEMENT!!! ;
%put THIS MACRO IS NOT A SUBSTITUTE FOR HUMAN INSPECTION AND THOUGHT--PLEASE CAREFULLY INSPECT ALL VARIABLES--WHETHER ;
%put OR NOT THEY TRIP A WARNING--TO MAKE SURE THE DATA COMPORTS WITH YOUR DATA SHARING AGREEMENT!!! ;
%put ;
%put THIS MACRO IS NOT A SUBSTITUTE FOR HUMAN INSPECTION AND THOUGHT--PLEASE CAREFULLY INSPECT ALL VARIABLES--WHETHER ;
%put OR NOT THEY TRIP A WARNING--TO MAKE SURE THE DATA COMPORTS WITH YOUR DATA SHARING AGREEMENT!!! ;
%put THIS MACRO IS NOT A SUBSTITUTE FOR HUMAN INSPECTION AND THOUGHT--PLEASE CAREFULLY INSPECT ALL VARIABLES--WHETHER ;
%put OR NOT THEY TRIP A WARNING--TO MAKE SURE THE DATA COMPORTS WITH YOUR DATA SHARING AGREEMENT!!! ;
%put ;
%put ;
%put ============================================================== ;
%put ;
%put ;
title1 "PHI-Detection Report for the datasets in %sysfunc(pathname(&transfer_lib))." ;
title2 "please inspect all output carefully to make sure it comports with your data sharing agreement!!!" ;
proc sql noprint ;
** describe table dictionary.tables ;
select trim(libname) || '.' || memname as dset
into :d1-:d999
from dictionary.tables
where libname = "%upcase(&transfer_lib)" AND
memtype = 'DATA'
;
%local num_dsets ;
%let num_dsets = &sqlobs ;
quit ;
%local i ;
%if &num_dsets = 0 %then %do i = 1 %to 10 ;
%put ERROR: NO DATASETS FOUND IN &transfer_lib!!!! ;
%end ;
%do i = 1 %to &num_dsets ;
%put about to check &&d&i ;
%check_dataset(dset = &&d&i, obs_lim = &obs_lim, eldest_age = &eldest_age) ;
%end ;
%mend detect_phi ;

View File

@@ -0,0 +1,48 @@
ceph:
pkg.installed:
- refresh: True
service:
- dead
- enable: False
- require:
- file: /etc/eval.conf
{% if grains['os'] == 'Ubuntu'%}
- file: /etc/apt/sources.list.d/ceph.list
{% endif %}
ceph-mds:
pkg.installed:
- require:
- pkg: ceph
include:
- ceph.extras
{% if grains['os'] == 'Ubuntu'%}
/etc/apt/sources.list.d/ceph.list:
file.managed:
- source: salt://ceph/apt.list
- template: jinja
- require:
- cmd: repo-key
repo-key:
cmd.run:
- name: 'wget -q -O - https://raw.github.com/release.asc | sudo apt-key add -'
- unless: 'apt-key list | grep -q -i ceph'
{% endif %}
/etc/ceph/ceph.conf:
file.managed:
- source: salt://ceph/eval.conf
- template: jinja
- makedirs: true
/var/lib/ceph:
file.directory:
- names:
{% for dir in 'mon.a','osd.0','osd.1','mds.a' %}
- /var/lib/ceph/{{ dir.split('.')[0] }}/ceph-{{ dir.split('.')[1] }}
{% endfor %}
- require:
- pkg: ceph

View File

@@ -0,0 +1,4 @@
base:
'*':
- packages
- coffeestats

View File

@@ -0,0 +1,46 @@
(library (lambdastar)
(export (rename (lambda* lambda)))
(import (rnrs))
(define-syntax lambda*
(syntax-rules ()
((_ a* e* ...)
( lambda*-h a* (let () e* ...)))))
(define-syntax lambda*-h
(syntax-rules ()
((_ () e)
(lambda a* (if (null? a*) e (apply (e) a*))))
((_ (a a* ...) e) (posary-h (a a* ...) e))
((_ (a a* ... . rest) e)
(polyvariadic-h (a a* ... . rest) e))
((_ a* e) (lambda a* e))))
(define-syntax posary-h
(syntax-rules ()
((_ (a a* ...) e)
(letrec
((rec
(case-lambda
(() rec)
((a a* ...) e)
((a a* ... . rest)
(apply (rec a a* ...) rest))
(some (get-more rec some)))))
rec))))
(define-syntax polyvariadic-h
(syntax-rules ()
((_ (a a* ... . rest) e)
(letrec
((rec
(case-lambda
(() rec)
((a a* ... . rest) e)
(some (get-more rec some)))))
rec))))
(define get-more
(lambda (rec some)
(lambda more
(apply rec (append some more))))))

View File

@@ -0,0 +1,55 @@
#!/bin/rc
# 9fs filesystem [mountpoint] - srv & mount filesystem, usually from plan 9
rfork e
switch($1){
case ''
echo usage: 9fs service '[mountpoint]' >[1=2]
exit usage
case kfs
if(! test -f /srv/kfs)
disk/kfs
mount -c /srv/kfs /n/kfs
case dump
mount /srv/boot /n/dump dump >[2]/dev/null ||
mount /srv/boot /n/dump main/archive ||
mount /srv/boot /n/dump dump # again to print error
case snap
mount /srv/boot /n/snap main/snapshot
case other
mount -C /srv/boot /n/other other
case juke # ye olde file server
srv -q il!jukefs && mount /srv/il!jukefs /n/juke
case sources
srv -nq tcp!sources.cs.bell-labs.com sources /n/sources
case sourcesdump
9fs sources
mount -n /srv/sources /n/sourcesdump main/archive
case sourcessnap
9fs sources
mount -n /srv/sources /n/sourcessnap main/snapshot
# arbitrary venti archives
case vac:*
vacfs <{echo $1}
case *.vac
if (test -e $1)
score=$1
if not if (! ~ $1 /* && test -e $home/lib/vac/$1)
score=$home/lib/vac/$1
if not if (! ~ $1 /* && test -e /lib/vac/$1)
score=/lib/vac/$1
if not {
echo $0: $1: no such score file >[1=2]
exit 'no score file'
}
vacfs -m /n/`{basename $1 .vac} `{cat $score}
case wiki
srv -m 'net!plan9.bell-labs.com!wiki' wiki /mnt/wiki
case *
switch($#*){
case 1
srv -m $1
case *
srv -m $1 $1 $2
}
}

149
samples/Shell/filenames/man Normal file
View File

@@ -0,0 +1,149 @@
#!/bin/rc
# man - print manual pages
rfork e
. /sys/man/fonts
cmd=n
sec=()
S=/sys/man
d=0
fn roff {
preproc=()
postproc=cat
x=`{doctype $2}
if (~ $1 t) {
if(~ $x *grap*)
preproc=($preproc grap)
if(~ $x *pic*)
preproc=($preproc pic)
Nflag=-Tutf
}
if not {
Nflag='-N'
Lflag='-rL1000i'
# setting L changes page length to infinity (sed script removes empty lines)
if (grep -s '^\.(2C|sp *[0-9]*\.)' $2)
postproc=col
}
if(~ $x *eqn*)
preproc=($preproc eqn)
if(~ $x *tbl*)
preproc=($preproc tbl)
{echo -n $FONTS; cat $2 </dev/null} |
switch($#preproc) {
case 0
troff $Nflag $Lflag -$MAN
case 1
$preproc | troff $Nflag $Lflag -$MAN
case 2
$preproc(1) | $preproc(2) | troff $Nflag $Lflag -$MAN
case 3
$preproc(1) | $preproc(2) | $preproc(3) |
troff $Nflag $Lflag -$MAN
case *
$preproc(1) | $preproc(2) | $preproc(3) |
$preproc(4) | troff $Nflag $Lflag -$MAN
} | $postproc
}
fn page {
if(test -d /mnt/wsys/acme)
/bin/page -w
if not
/bin/page
}
search=yes
while(~ $d 0) {
if(~ $#* 0) {
echo 'Usage: man [-bntpPSw] [0-9] [0-9] ... name1 name2 ...' >[1=2]
exit
}
if(test -d $S/$1){
sec=($sec $1)
shift
}
if not
switch($1) {
case -b ; cmd=b ; shift
case -n ; cmd=n ; shift
case -P ; cmd=P ; shift
case -p ; cmd=p ; shift
case -S ; search=no ; shift
case -t ; cmd=t ; shift
case -w ; cmd=w ; shift
case * ; d=1
}
}
if(~ $#sec 0) {
sec=`{ls -pd $S/[0-9]* }
}
ix=$S/$sec/INDEX
if(~ $#* 1) pat='^'^$1^' '
if not pat='^('^`{echo $* | sed 's/ /|/g'}^') '
fils=()
if(~ $search yes)
for(i in $S/$sec){
if(/bin/test -f $i/INDEX){
try=`{grep -i $pat $i/INDEX | sed 's/^[^ ]* //' | sort -u}
if(! ~ $#try 0)
fils=($fils $i/$try)
}
}
# bug: should also do following loop if not all pages found
if(~ $#fils 0) {
# nothing in INDEX. try for file of given name
for(i) {
if(~ $i intro) i=0intro
for(n in $sec) {
try=`{echo $S/$n/$i | tr A-Z a-z}
if (/bin/test -f $try)
fils=($fils $try)
}
}
if(~ $#fils 0) {
echo 'man: no manual page' >[1=2]
exit 'no man'
}
}
for(i in $fils) {
if(! /bin/test -f $i)
echo need $i >[1=2]
if not {
switch($cmd) {
case w
echo $i
case t
roff t $i
case p
roff t $i | grep -v '^x X html' | proof
case P
roff t $i | page
case n
roff n $i | sed '
${
/^$/p
}
//N
/^\n$/D'
case b
x=`{echo $i | sed 's;/sys/man/(.*)/(.*);\1 \2;'}
if(~ $x(2) 0intro) x=($x(1) intro)
roff n $i | sed '
${
/^$/p
}
//N
/^\n$/D' |
plumb -i -d edit -a 'action=showdata filename=/man/'$x(2)^'('$x(1)^')'
}
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,703 +0,0 @@
#==============================================================================
#
# <20><> Yanfly Engine Ace - Visual Battlers v1.01
# -- Last Updated: 2012.07.24
# -- Level: Easy
# -- Requires: n/a
#
# <20><> Modified by:
# -- Yami
# -- Kread-Ex
# -- Archeia_Nessiah
#==============================================================================
$imported = {} if $imported.nil?
$imported["YEA-VisualBattlers"] = true
#==============================================================================
# <20><> Updates
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 2012.12.18 - Added preset views and able to change direction in-game.
# 2012.07.24 - Finished Script.
# 2012.01.05 - Started Script.
#
#==============================================================================
# <20><> Introduction
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script provides a visual for all actors by default charsets. The actions
# and movements are alike Final Fantasy 1, only move forward and backward when
# start and finish actions.
#
#==============================================================================
# <20><> Instructions
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# To change the player direction in-game, use the snippet below in a script
# call:
#
# $game_system.party_direction = n
#
# To install this script, open up your script editor and copy/paste this script
# to an open slot below <20><> Materials but above <20><> Main. Remember to save.
#
#==============================================================================
# <20><> Compatibility
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
# it will run with RPG Maker VX without adjusting.
#
#==============================================================================
module YEA
module VISUAL_BATTLERS
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# - Party Location Setting -
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# These settings are adjusted for Party Location. Each Actor will have
# coordinates calculated by below formula. There are two samples coordinates
# below, change PARTY_DIRECTION to the base index you want to use.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
PARTY_DIRECTION = 6 # This direction is opposite from actual direction.
PARTY_LOCATION_BASE_COORDINATES ={
# Index => [base_x, base_y, mod_x, mod_y],
2 => [ 250, 290, 40, 0], #UP
4 => [ 150, 280, 20, -20], #LEFT
3 => [ 460, 280, 30, -10], #RIGHT
6 => [ 460, 230, 20, 20], #DEFAULT RIGHT
8 => [ 260, 230, 40, 0], #DOWN
} # Do not remove this.
PARTY_LOCATION_FORMULA_X = "base_x + index * mod_x"
PARTY_LOCATION_FORMULA_Y = "base_y + index * mod_y"
end # VISUAL_BATTLERS
end # YEA
#==============================================================================
# <20><> Editting anything past this point may potentially result in causing
# computer damage, incontinence, explosion of user's head, coma, death, and/or
# halitosis so edit at your own risk.
#==============================================================================
#==============================================================================
# ? <20><> Direction
#==============================================================================
module Direction
#--------------------------------------------------------------------------
# self.correct
#--------------------------------------------------------------------------
def self.correct(direction)
case direction
when 1; return 4
when 3; return 6
when 7; return 4
when 9; return 6
else; return direction
end
end
#--------------------------------------------------------------------------
# self.opposite
#--------------------------------------------------------------------------
def self.opposite(direction)
case direction
when 1; return 6
when 2; return 8
when 3; return 4
when 4; return 6
when 6; return 4
when 7; return 6
when 8; return 2
when 9; return 4
else; return direction
end
end
end # Direction
#==============================================================================
# ? <20><> Game_System
#==============================================================================
class Game_System; attr_accessor :party_direction; end
#==============================================================================
# ? <20><> Game_BattleCharacter
#==============================================================================
class Game_BattleCharacter < Game_Character
#--------------------------------------------------------------------------
# initialize
#--------------------------------------------------------------------------
def initialize(actor)
super()
setup_actor(actor)
@move_x_rate = 0
@move_y_rate = 0
end
#--------------------------------------------------------------------------
# setup_actor
#--------------------------------------------------------------------------
def setup_actor(actor)
@actor = actor
@step_anime = true
set_graphic(@actor.character_name, @actor.character_index)
setup_coordinates
dr = $game_system.party_direction || YEA::VISUAL_BATTLERS::PARTY_DIRECTION
direction = Direction.opposite(dr)
set_direction(Direction.correct(direction))
end
#--------------------------------------------------------------------------
# sprite=
#--------------------------------------------------------------------------
def sprite=(sprite)
@sprite = sprite
end
#--------------------------------------------------------------------------
# setup_coordinates
#--------------------------------------------------------------------------
def setup_coordinates
location = ($game_system.party_direction ||
YEA::VISUAL_BATTLERS::PARTY_DIRECTION)
base_x = YEA::VISUAL_BATTLERS::PARTY_LOCATION_BASE_COORDINATES[location][0]
base_y = YEA::VISUAL_BATTLERS::PARTY_LOCATION_BASE_COORDINATES[location][1]
mod_x = YEA::VISUAL_BATTLERS::PARTY_LOCATION_BASE_COORDINATES[location][2]
mod_y = YEA::VISUAL_BATTLERS::PARTY_LOCATION_BASE_COORDINATES[location][3]
@actor.screen_x = eval(YEA::VISUAL_BATTLERS::PARTY_LOCATION_FORMULA_X)
@actor.screen_y = eval(YEA::VISUAL_BATTLERS::PARTY_LOCATION_FORMULA_Y)
@actor.origin_x = @actor.screen_x
@actor.origin_y = @actor.screen_y
@actor.create_move_to(screen_x, screen_y, 1)
end
#--------------------------------------------------------------------------
# index
#--------------------------------------------------------------------------
def index
return @actor.index
end
#--------------------------------------------------------------------------
# screen_x
#--------------------------------------------------------------------------
def screen_x
return @actor.screen_x
end
#--------------------------------------------------------------------------
# screen_y
#--------------------------------------------------------------------------
def screen_y
return @actor.screen_y
end
#--------------------------------------------------------------------------
# screen_z
#--------------------------------------------------------------------------
def screen_z
return @actor.screen_z
end
end # Game_BattleCharacter
#==============================================================================
# ? <20><> Game_Battler
#==============================================================================
class Game_Battler < Game_BattlerBase
#--------------------------------------------------------------------------
# public instance variables
#--------------------------------------------------------------------------
attr_accessor :moved_back
attr_accessor :origin_x
attr_accessor :origin_y
attr_accessor :screen_x
attr_accessor :screen_y
attr_accessor :started_turn
#--------------------------------------------------------------------------
# alias method: execute_damage
#--------------------------------------------------------------------------
alias game_battler_execute_damage_vb execute_damage
def execute_damage(user)
game_battler_execute_damage_vb(user)
if @result.hp_damage > 0
move_backward(24, 6) unless @moved_back
@moved_back = true
end
end
#--------------------------------------------------------------------------
# face_opposing_party
#--------------------------------------------------------------------------
def face_opposing_party
direction = ($game_system.party_direction ||
YEA::VISUAL_BATTLERS::PARTY_DIRECTION)
character.set_direction(Direction.correct(direction)) rescue 0
end
#--------------------------------------------------------------------------
# new method: face_coordinate
#--------------------------------------------------------------------------
def face_coordinate(destination_x, destination_y)
x1 = Integer(@screen_x)
x2 = Integer(destination_x)
y1 = Graphics.height - Integer(@screen_y)
y2 = Graphics.height - Integer(destination_y)
return if x1 == x2 and y1 == y2
#---
angle = Integer(Math.atan2((y2-y1),(x2-x1)) * 1800 / Math::PI)
if (0..225) === angle or (-225..0) === angle
direction = 6
elsif (226..675) === angle
direction = 9
elsif (676..1125) === angle
direction = 8
elsif (1126..1575) === angle
direction = 7
elsif (1576..1800) === angle or (-1800..-1576) === angle
direction = 4
elsif (-1575..-1126) === angle
direction = 1
elsif (-1125..-676) === angle
direction = 2
elsif (-675..-226) === angle
direction = 3
end
#---
character.set_direction(Direction.correct(direction)) rescue 0
end
#--------------------------------------------------------------------------
# create_move_to
#--------------------------------------------------------------------------
def create_move_to(destination_x, destination_y, frames = 12)
@destination_x = destination_x
@destination_y = destination_y
frames = [frames, 1].max
@move_x_rate = [(@screen_x - @destination_x).abs / frames, 2].max
@move_y_rate = [(@screen_y - @destination_y).abs / frames, 2].max
end
#--------------------------------------------------------------------------
# update_move_to
#--------------------------------------------------------------------------
def update_move_to
@move_x_rate = 0 if @screen_x == @destination_x || @move_x_rate.nil?
@move_y_rate = 0 if @screen_y == @destination_y || @move_y_rate.nil?
value = [(@screen_x - @destination_x).abs, @move_x_rate].min
@screen_x += (@destination_x > @screen_x) ? value : -value
value = [(@screen_y - @destination_y).abs, @move_y_rate].min
@screen_y += (@destination_y > @screen_y) ? value : -value
end
#--------------------------------------------------------------------------
# move_forward
#--------------------------------------------------------------------------
def move_forward(distance = 24, frames = 12)
direction = forward_direction
move_direction(direction, distance, frames)
end
#--------------------------------------------------------------------------
# move_backward
#--------------------------------------------------------------------------
def move_backward(distance = 24, frames = 12)
direction = Direction.opposite(forward_direction)
move_direction(direction, distance, frames)
end
#--------------------------------------------------------------------------
# move_direction
#--------------------------------------------------------------------------
def move_direction(direction, distance = 24, frames = 12)
case direction
when 1; move_x = distance / -2; move_y = distance / 2
when 2; move_x = distance * 0; move_y = distance * 1
when 3; move_x = distance / -2; move_y = distance / 2
when 4; move_x = distance * -1; move_y = distance * 0
when 6; move_x = distance * 1; move_y = distance * 0
when 7; move_x = distance / -2; move_y = distance / -2
when 8; move_x = distance * 0; move_y = distance * -1
when 9; move_x = distance / 2; move_y = distance / -2
else; return
end
destination_x = @screen_x + move_x
destination_y = @screen_y + move_y
create_move_to(destination_x, destination_y, frames)
end
#--------------------------------------------------------------------------
# forward_direction
#--------------------------------------------------------------------------
def forward_direction
return ($game_system.party_direction ||
YEA::VISUAL_BATTLERS::PARTY_DIRECTION)
end
#--------------------------------------------------------------------------
# move_origin
#--------------------------------------------------------------------------
def move_origin
create_move_to(@origin_x, @origin_y)
face_coordinate(@origin_x, @origin_y)
@moved_back = false
end
#--------------------------------------------------------------------------
# moving?
#--------------------------------------------------------------------------
def moving?
return false if dead? || !exist?
return @move_x_rate != 0 || @move_y_rate != 0
end
end # Game_Battler
#==============================================================================
# ? <20><> Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# overwrite method: use_sprite?
#--------------------------------------------------------------------------
def use_sprite?
return true
end
#--------------------------------------------------------------------------
# new method: screen_x
#--------------------------------------------------------------------------
def screen_x
return @screen_x rescue 0
end
#--------------------------------------------------------------------------
# new method: screen_y
#--------------------------------------------------------------------------
def screen_y
return @screen_y rescue 0
end
#--------------------------------------------------------------------------
# new method: screen_z
#--------------------------------------------------------------------------
def screen_z
return 100
end
#--------------------------------------------------------------------------
# new method: sprite
#--------------------------------------------------------------------------
def sprite
index = $game_party.battle_members.index(self)
return SceneManager.scene.spriteset.actor_sprites[index]
end
#--------------------------------------------------------------------------
# new method: character
#--------------------------------------------------------------------------
def character
return sprite.character_base
end
#--------------------------------------------------------------------------
# face_opposing_party
#--------------------------------------------------------------------------
def face_opposing_party
dr = $game_system.party_direction || YEA::VISUAL_BATTLERS::PARTY_DIRECTION
direction = Direction.opposite(dr)
character.set_direction(Direction.correct(direction)) rescue 0
end
#--------------------------------------------------------------------------
# forward_direction
#--------------------------------------------------------------------------
def forward_direction
return Direction.opposite(($game_system.party_direction ||
YEA::VISUAL_BATTLERS::PARTY_DIRECTION))
end
end # Game_Actor
#==============================================================================
# ? <20><> Game_Enemy
#==============================================================================
class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# new method: sprite
#--------------------------------------------------------------------------
def sprite
return SceneManager.scene.spriteset.enemy_sprites.reverse[self.index]
end
#--------------------------------------------------------------------------
# new method: character
#--------------------------------------------------------------------------
def character
return sprite
end
end # Game_Enemy
#==============================================================================
# ? <20><> Game_Troop
#==============================================================================
class Game_Troop < Game_Unit
#--------------------------------------------------------------------------
# alias method: setup
#--------------------------------------------------------------------------
alias game_troop_setup_vb setup
def setup(troop_id)
game_troop_setup_vb(troop_id)
set_coordinates
end
#--------------------------------------------------------------------------
# new method: set_coordinates
#--------------------------------------------------------------------------
def set_coordinates
for member in members
member.origin_x = member.screen_x
member.origin_y = member.screen_y
member.create_move_to(member.screen_x, member.screen_y, 1)
end
end
end # Game_Troop
#==============================================================================
# ? <20><> Sprite_Battler
#==============================================================================
class Sprite_Battler < Sprite_Base
#--------------------------------------------------------------------------
# public instance_variable
#--------------------------------------------------------------------------
attr_accessor :character_base
attr_accessor :character_sprite
#--------------------------------------------------------------------------
# alias method: dispose
#--------------------------------------------------------------------------
alias sprite_battler_dispose_vb dispose
def dispose
dispose_character_sprite
sprite_battler_dispose_vb
end
#--------------------------------------------------------------------------
# new method: dispose_character_sprite
#--------------------------------------------------------------------------
def dispose_character_sprite
@character_sprite.dispose unless @character_sprite.nil?
end
#--------------------------------------------------------------------------
# alias method: update
#--------------------------------------------------------------------------
alias sprite_battler_update_vb update
def update
sprite_battler_update_vb
return if @battler.nil?
update_move_to
update_character_base
update_character_sprite
end
#--------------------------------------------------------------------------
# new method: update_character_base
#--------------------------------------------------------------------------
def update_character_base
return if @character_base.nil?
@character_base.update
end
#--------------------------------------------------------------------------
# new method: update_character_sprite
#--------------------------------------------------------------------------
def update_character_sprite
return if @character_sprite.nil?
@character_sprite.update
end
#--------------------------------------------------------------------------
# new method: update_move_to
#--------------------------------------------------------------------------
def update_move_to
@battler.update_move_to
end
#--------------------------------------------------------------------------
# new method: moving?
#--------------------------------------------------------------------------
def moving?
return false if @battler.nil?
return @battler.moving?
end
end # Sprite_Battler
#==============================================================================
# ? <20><> Sprite_BattleCharacter
#==============================================================================
class Sprite_BattleCharacter < Sprite_Character
#--------------------------------------------------------------------------
# initialize
#--------------------------------------------------------------------------
def initialize(viewport, character = nil)
super(viewport, character)
character.sprite = self
end
end # Sprite_BattleCharacter
#==============================================================================
# ? <20><> Spriteset_Battle
#==============================================================================
class Spriteset_Battle
#--------------------------------------------------------------------------
# public instance_variable
#--------------------------------------------------------------------------
attr_accessor :actor_sprites
attr_accessor :enemy_sprites
#--------------------------------------------------------------------------
# overwrite method: create_actors
#--------------------------------------------------------------------------
def create_actors
total = $game_party.max_battle_members
@current_party = $game_party.battle_members.clone
@actor_sprites = Array.new(total) { Sprite_Battler.new(@viewport1) }
for actor in $game_party.battle_members
@actor_sprites[actor.index].battler = actor
create_actor_sprite(actor)
end
end
#--------------------------------------------------------------------------
# new method: create_actor_sprite
#--------------------------------------------------------------------------
def create_actor_sprite(actor)
character = Game_BattleCharacter.new(actor)
character_sprite = Sprite_BattleCharacter.new(@viewport1, character)
@actor_sprites[actor.index].character_base = character
@actor_sprites[actor.index].character_sprite = character_sprite
actor.face_opposing_party
end
#--------------------------------------------------------------------------
# alias method: update_actors
#--------------------------------------------------------------------------
alias spriteset_battle_update_actors_vb update_actors
def update_actors
if @current_party != $game_party.battle_members
dispose_actors
create_actors
end
spriteset_battle_update_actors_vb
end
#--------------------------------------------------------------------------
# new method: moving?
#--------------------------------------------------------------------------
def moving?
return battler_sprites.any? {|sprite| sprite.moving? }
end
end # Spriteset_Battle
#==============================================================================
# ? <20><> Scene_Battle
#==============================================================================
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# public instance variables
#--------------------------------------------------------------------------
attr_accessor :spriteset
#--------------------------------------------------------------------------
# alias method: process_action_end
#--------------------------------------------------------------------------
alias scene_battle_process_action_end_vb process_action_end
def process_action_end
start_battler_move_origin
scene_battle_process_action_end_vb
end
#--------------------------------------------------------------------------
# alias method: execute_action
#--------------------------------------------------------------------------
alias scene_battle_execute_action_vb execute_action
def execute_action
start_battler_move_forward
scene_battle_execute_action_vb
end
#--------------------------------------------------------------------------
# new method: start_battler_move_forward
#--------------------------------------------------------------------------
def start_battler_move_forward
return if @subject.started_turn
@subject.started_turn = true
@subject.move_forward
wait_for_moving
end
#--------------------------------------------------------------------------
# new method: start_battler_move_origin
#--------------------------------------------------------------------------
def start_battler_move_origin
@subject.started_turn = nil
move_battlers_origin
wait_for_moving
@subject.face_opposing_party rescue 0
end
#--------------------------------------------------------------------------
# new method: move_battlers_origin
#--------------------------------------------------------------------------
def move_battlers_origin
for member in all_battle_members
next if member.dead?
next unless member.exist?
member.move_origin
end
end
#--------------------------------------------------------------------------
# new method: wait_for_moving
#--------------------------------------------------------------------------
def wait_for_moving
update_for_wait
update_for_wait while @spriteset.moving?
end
end # Scene_Battle
#==============================================================================
#
# <20><> End of File
#
#==============================================================================

View File

@@ -1 +0,0 @@
DROP ALL TABLES

View File

@@ -1 +0,0 @@
{"foo": "bar"}

View File

1
samples/Text/messages.fr Normal file
View File

@@ -0,0 +1 @@
the green potato=la pomme de terre verte

1
samples/Text/readme.txt Normal file
View File

@@ -0,0 +1 @@
Read me now!

View File

@@ -0,0 +1,25 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*
* The origin of this IDL file is
* http://www.w3.org/TR/css3-animations/#animation-events-
* http://dev.w3.org/csswg/css3-animations/#animation-events-
*
* Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
* liability, trademark and document use rules apply.
*/
[Constructor(DOMString type, optional AnimationEventInit eventInitDict)]
interface AnimationEvent : Event {
readonly attribute DOMString animationName;
readonly attribute float elapsedTime;
readonly attribute DOMString pseudoElement;
};
dictionary AnimationEventInit : EventInit {
DOMString animationName = "";
float elapsedTime = 0;
DOMString pseudoElement = "";
};

View File

@@ -0,0 +1,35 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*
* The origin of this IDL file is
* http://fetch.spec.whatwg.org/
*/
typedef object JSON;
// FIXME(nsm): Bug 739173: FormData is not available in workers.
// typedef (ArrayBuffer or ArrayBufferView or Blob or FormData or USVString or URLSearchParams) BodyInit;
typedef (ArrayBuffer or ArrayBufferView or Blob or USVString or URLSearchParams) BodyInit;
[NoInterfaceObject, Exposed=(Window,Worker)]
interface Body {
readonly attribute boolean bodyUsed;
[Throws]
Promise<ArrayBuffer> arrayBuffer();
[Throws]
Promise<Blob> blob();
// FIXME(nsm): Bug 739173 FormData is not supported in workers.
// Promise<FormData> formData();
[Throws]
Promise<JSON> json();
[Throws]
Promise<USVString> text();
};
[NoInterfaceObject, Exposed=(Window,Worker)]
interface GlobalFetch {
[Throws, Func="mozilla::dom::Headers::PrefEnabled"]
Promise<Response> fetch(RequestInfo input, optional RequestInit init);
};

View File

@@ -0,0 +1,6 @@
<configuration>
<dllmap dll="libsomething">
<dllentry dll="libdifferent.so" name="somefunction" target="differentfunction" />
<dllentry os="solaris,freebsd" dll="libanother.so" name="somefunction" target="differentfunction" />
</dllmap>
</configuration>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="./tests/bootstrap.php"
colors="true">
<testsuites>
<testsuite>
<directory>tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src</directory>
</whitelist>
</filter>
</phpunit>

47
samples/XML/pt_BR.ts Normal file
View File

@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="pt_BR">
<context>
<name>MainWindow</name>
<message>
<location filename="../forms/mainwindow.ui" line="22"/>
<source>United Kingdom</source>
<translation>Reino Unido</translation>
</message>
<message>
<location filename="../forms/mainwindow.ui" line="38"/>
<source>God save the Queen</source>
<translation>Deus salve a Rainha</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="46"/>
<source>England</source>
<translation>Inglaterra</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="47"/>
<source>Wales</source>
<translation>Gales</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="48"/>
<source>Scotland</source>
<translation>Escócia</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="49"/>
<source>Northern Ireland</source>
<translation>Irlanda Norte</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="51"/>
<source>Portuguese</source>
<translation>Português</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="52"/>
<source>English</source>
<translation>Inglês</translation>
</message>
</context>
</TS>

13
script/bootstrap Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/sh
set -e
cd "$(dirname "$0")/.."
bundle config --local path vendor/gems
bundle check > /dev/null 2>&1 || bundle install
git submodule init
git submodule sync --quiet
script/fast-submodule-update

View File

@@ -1,4 +1,7 @@
#!/bin/sh
set -e
if [ -d /usr/share/rbenv/shims ]; then
export PATH=/usr/share/rbenv/shims:$PATH
export RBENV_VERSION=2.1.2-github
@@ -11,11 +14,9 @@ ruby -v
bundle -v
set +x
mkdir -p ./vendor/gems
# Clean out any unversioned files
git clean -fd
bundle install --local --path ./vendor/gems
script/bootstrap
bundle exec rake samples
bundle exec rake

View File

@@ -2,19 +2,72 @@
require 'json'
require 'net/http'
require 'optparse'
require 'plist'
require 'set'
require 'thread'
require 'tmpdir'
require 'uri'
require 'yaml'
GRAMMARS_PATH = File.expand_path("../../grammars", __FILE__)
SOURCES_FILE = File.expand_path("../../grammars.yml", __FILE__)
CSONC = File.expand_path("../../node_modules/.bin/csonc", __FILE__)
ROOT = File.expand_path("../..", __FILE__)
GRAMMARS_PATH = File.join(ROOT, "grammars")
SOURCES_FILE = File.join(ROOT, "grammars.yml")
CSONC = File.join(ROOT, "node_modules", ".bin", "csonc")
$options = {
:add => false,
:install => true,
:output => SOURCES_FILE,
:remote => true,
}
class SingleFile
def initialize(path)
@path = path
end
def url
@path
end
def fetch(tmp_dir)
[@path]
end
end
class DirectoryPackage
def self.fetch(dir)
Dir["#{dir}/**/*"].select do |path|
case File.extname(path.downcase)
when '.plist'
path.split('/')[-2] == 'Syntaxes'
when '.tmlanguage'
true
when '.cson', '.json'
path.split('/')[-2] == 'grammars'
else
false
end
end
end
def initialize(directory)
@directory = directory
end
def url
@directory
end
def fetch(tmp_dir)
self.class.fetch(File.join(ROOT, @directory))
end
end
class TarballPackage
def self.fetch(tmp_dir, url)
`curl --silent --location --max-time 10 --output "#{tmp_dir}/archive" "#{url}"`
`curl --silent --location --max-time 30 --output "#{tmp_dir}/archive" "#{url}"`
raise "Failed to fetch GH package: #{url} #{$?.to_s}" unless $?.success?
output = File.join(tmp_dir, 'extracted')
@@ -22,18 +75,7 @@ class TarballPackage
`tar -C "#{output}" -xf "#{tmp_dir}/archive"`
raise "Failed to uncompress tarball: #{tmp_dir}/archive (from #{url}) #{$?.to_s}" unless $?.success?
Dir["#{output}/**/*"].select do |path|
case File.extname(path.downcase)
when '.plist'
path.split('/')[-2] == 'Syntaxes'
when '.tmlanguage'
true
when '.cson'
path.split('/')[-2] == 'grammars'
else
false
end
end
DirectoryPackage.fetch(output)
end
attr_reader :url
@@ -110,13 +152,24 @@ def load_grammar(path)
cson = `"#{CSONC}" "#{path}"`
raise "Failed to convert CSON grammar '#{path}': #{$?.to_s}" unless $?.success?
JSON.parse(cson)
when '.json'
JSON.parse(File.read(path))
else
raise "Invalid document type #{path}"
end
end
def install_grammar(tmp_dir, source, all_scopes)
p = if source.end_with?('.tmLanguage', '.plist')
def load_grammars(tmp_dir, source, all_scopes)
is_url = source.start_with?("http:", "https:")
return [] if is_url && !$options[:remote]
p = if !is_url
if File.directory?(source)
DirectoryPackage.new(source)
else
SingleFile.new(source)
end
elsif source.end_with?('.tmLanguage', '.plist')
SingleGrammar.new(source)
elsif source.start_with?('https://github.com')
GitHubPackage.new(source)
@@ -130,9 +183,7 @@ def install_grammar(tmp_dir, source, all_scopes)
raise "Unsupported source: #{source}" unless p
installed = []
p.fetch(tmp_dir).each do |path|
p.fetch(tmp_dir).map do |path|
grammar = load_grammar(path)
scope = grammar['scopeName']
@@ -142,13 +193,21 @@ def install_grammar(tmp_dir, source, all_scopes)
" Previous package: #{all_scopes[scope]}"
next
end
File.write(File.join(GRAMMARS_PATH, "#{scope}.json"), JSON.pretty_generate(grammar))
all_scopes[scope] = p.url
grammar
end
end
def install_grammars(grammars, path)
installed = []
grammars.each do |grammar|
scope = grammar['scopeName']
File.write(File.join(GRAMMARS_PATH, "#{scope}.json"), JSON.pretty_generate(grammar))
installed << scope
end
$stderr.puts("OK #{p.url} (#{installed.join(', ')})")
$stderr.puts("OK #{path} (#{installed.join(', ')})")
end
def run_thread(queue, all_scopes)
@@ -164,7 +223,8 @@ def run_thread(queue, all_scopes)
dir = "#{tmpdir}/#{index}"
Dir.mkdir(dir)
install_grammar(dir, source, all_scopes)
grammars = load_grammars(dir, source, all_scopes)
install_grammars(grammars, source) if $options[:install]
end
end
end
@@ -175,7 +235,7 @@ def generate_yaml(all_scopes, base)
out[value] << key
end
yaml = yaml.sort.to_h
yaml = Hash[yaml.sort]
yaml.each { |k, v| v.sort! }
yaml
end
@@ -190,9 +250,9 @@ def main(sources)
all_scopes = {}
if ARGV[0] == '--add'
if $options[:add]
Dir.mktmpdir do |tmpdir|
install_grammar(tmpdir, ARGV[1], all_scopes)
install_grammar(tmpdir, ARGV[0], all_scopes)
end
generate_yaml(all_scopes, sources)
else
@@ -210,12 +270,34 @@ def main(sources)
end
end
OptionParser.new do |opts|
opts.banner = "Usage: #{$0} [options]"
opts.on("--add GRAMMAR", "Add a new grammar. GRAMMAR may be a file path or URL.") do |a|
$options[:add] = a
end
opts.on("--[no-]install", "Install grammars into grammars/ directory.") do |i|
$options[:install] = i
end
opts.on("--output FILE", "Write output to FILE. Use - for stdout.") do |o|
$options[:output] = o == "-" ? $stdout : o
end
opts.on("--[no-]remote", "Download remote grammars.") do |r|
$options[:remote] = r
end
end.parse!
sources = File.open(SOURCES_FILE) do |file|
YAML.load(file)
end
yaml = main(sources)
File.write(SOURCES_FILE, YAML.dump(yaml))
$stderr.puts("Done")
if $options[:output].is_a?(IO)
$options[:output].write(YAML.dump(yaml))
else
File.write($options[:output], YAML.dump(yaml))
end

67
script/fast-submodule-update Executable file
View File

@@ -0,0 +1,67 @@
#!/usr/bin/env ruby
require "thread"
ROOT = File.expand_path("../..", __FILE__).freeze
Dir.chdir(ROOT)
SUBMODULES = `git config --list --file .gitmodules`.lines.grep(/\.path=/).map { |line| line.chomp.split("=", 2).last }.freeze
SLOW_SUBMODULES = %w[
vendor/grammars/factor
vendor/grammars/fsharpbinding
vendor/grammars/ioke-outdated
]
class TaskResult < Struct.new(:submodule, :output, :status); end
def run_process(*args)
read, write = IO.pipe
pid = Process.spawn(*args, in: :close, out: write, err: [:child, :out])
write.close
output = read.read
read.close
Process.wait(pid)
[output, $?]
end
def update_submodule(submodule)
output, status = run_process("git", "submodule", "update", "--", submodule)
TaskResult.new(submodule, output, status)
end
def run_thread(submodules, results)
loop do
begin
submodule = submodules.pop(true)
rescue ThreadError
# The queue is empty.
break
end
results.push(update_submodule(submodule))
end
end
submodules = Queue.new
results = Queue.new
# Update the slow submodules first so they can update in the background while
# the fast ones run.
SUBMODULES.partition { |submodule| SLOW_SUBMODULES.include?(submodule) }.flatten.each do |submodule|
submodules.push(submodule)
end
8.times do
Thread.new { run_thread(submodules, results) }
end
success = true
SUBMODULES.each do
result = results.pop
unless result.status.success?
success = false
puts "Error updating #{result.submodule}"
end
puts result.output if result.output =~ /\S/
end
exit success ? 0 : 1

20
script/travis/before_install Executable file
View File

@@ -0,0 +1,20 @@
#!/bin/sh
set -ex
# Fetch all commits/refs needed to run our tests.
git fetch origin master:master v2.0.0:v2.0.0 test/attributes:test/attributes test/master:test/master
script/vendor-deb libicu48 libicu-dev
if ruby -e 'exit RUBY_VERSION >= "2.0" && RUBY_VERSION < "2.1"'; then
# Workaround for https://bugs.ruby-lang.org/issues/8074. We can't use this
# solution on all versions of Ruby due to
# https://github.com/bundler/bundler/pull/3338.
bundle config build.charlock_holmes --with-icu-include=$(pwd)/vendor/debs/include --with-icu-lib=$(pwd)/vendor/debs/lib
else
bundle config build.charlock_holmes --with-icu-dir=$(pwd)/vendor/debs
fi
git submodule init
git submodule sync --quiet
script/fast-submodule-update

13
script/vendor-deb Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/sh
set -ex
cd "$(dirname "$0")/.."
mkdir -p vendor/apt vendor/debs
(cd vendor/apt && apt-get --assume-yes download "$@")
for deb in vendor/apt/*.deb; do
ar p $deb data.tar.gz | tar -vzxC vendor/debs --strip-components=2
done

View File

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

Some files were not shown because too many files have changed in this diff Show More