Compare commits
439 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7ada448bce | |||
| c2258c449e | |||
| 612267d322 | |||
| 6de0914788 | |||
| e4f702d1e2 | |||
| 2f864c5e15 | |||
| 7139590798 | |||
| 0870655455 | |||
| ba24a7bb8c | |||
| f32d7465a2 | |||
| e202698bf1 | |||
| 11c2bf7dae | |||
| 53cf0e1148 | |||
| 2d1e49e3f2 | |||
| 199161f611 | |||
| ece5c775f1 | |||
| 3121c43b71 | |||
| 51e8caf369 | |||
| e7e7937678 | |||
| a0f5a60ea0 | |||
| af29c6e441 | |||
| 00dfecb1c7 | |||
| cc249bef15 | |||
| 9a2231804d | |||
| 1edcf15bcd | |||
| 0190e08763 | |||
| d3cc5a69c4 | |||
| 07ca53a778 | |||
| 6910b6d024 | |||
| f02c934ad7 | |||
| 236680aab9 | |||
| 6316f97c06 | |||
| 14830af306 | |||
| b620decde7 | |||
| b08ca620a0 | |||
| 66a2bb0393 | |||
| 0675844d97 | |||
| 148eda2990 | |||
| 330f7b4002 | |||
| def0fc8866 | |||
| fa1bcf9608 | |||
| 5a5e56a47b | |||
| e64f40eaa3 | |||
| 3f3d86ad4c | |||
| 91833dd72e | |||
| c049f7c11f | |||
| 6bd2f3bff5 | |||
| 8c3c519679 | |||
| 4e5002a31e | |||
| 5a53c58b04 | |||
| a61d1e3d10 | |||
| 1a50f99189 | |||
| 6caacbf388 | |||
| f876aa7d0f | |||
| 31e1281600 | |||
| 90072a9332 | |||
| bacd2893b9 | |||
| 7362fd859b | |||
| 3811fb46b3 | |||
| ab42c0c0df | |||
| de5aed2f6a | |||
| ce68a88293 | |||
| 288f75929d | |||
| 8528dd0c7f | |||
| e0f35eceab | |||
| 7e36517a79 | |||
| 69327766bb | |||
| 9ecf8a61ba | |||
| 2323506c82 | |||
| caa1a55e7a | |||
| 2ce44c157a | |||
| e17778190d | |||
| d1d81a0043 | |||
| ddb5ced3d5 | |||
| 9cebe655fd | |||
| 51b5a11a54 | |||
| f3405851a7 | |||
| 5b6870d610 | |||
| c3dceaff5c | |||
| 0a9b35c039 | |||
| dc32997f45 | |||
| 67c64c17d5 | |||
| 9cc02982be | |||
| b4c70a62a9 | |||
| c9d5921f4e | |||
| 0f47a4de5d | |||
| 0ba5e4d3c7 | |||
| 73e61dbcff | |||
| ba142e3b19 | |||
| f651a401e8 | |||
| 3301252fb2 | |||
| fe77e2b0d3 | |||
| d586567c3b | |||
| 211178d39e | |||
| d8354faa49 | |||
| f9e5c05046 | |||
| 596afe9451 | |||
| f7b5de986a | |||
| ee9262472b | |||
| 8a6a8db730 | |||
| 3642370f11 | |||
| 2db2cfb81c | |||
| 279b028c5e | |||
| f268827a2e | |||
| d8bc065057 | |||
| 6301bbbb66 | |||
| 3ad65eaef8 | |||
| 3d1bc7949d | |||
| 26e092fd20 | |||
| be7ddec1b0 | |||
| 5781ac6bbd | |||
| a51bc4427a | |||
| 80854584bb | |||
| 93af289d3b | |||
| a27b882493 | |||
| ba6f957692 | |||
| ec0e1bf26f | |||
| e4df298bb4 | |||
| 804d21e31d | |||
| 6d33687866 | |||
| 21bb1efb46 | |||
| 9d0986f1ca | |||
| fd483f397f | |||
| 09364850ee | |||
| 4d3a8bad4c | |||
| cc39b0aa41 | |||
| 1cceb7d4b4 | |||
| 6fc3b4be75 | |||
| af6d690fc8 | |||
| eea5152444 | |||
| 1ca38b625b | |||
| f964407c47 | |||
| 3be2e76ec0 | |||
| f9a9b90ed7 | |||
| 1f2917ac22 | |||
| fe1a8569f6 | |||
| 33e8d4f328 | |||
| e183260d0a | |||
| b4023942b4 | |||
| c10c24d90d | |||
| 915f63cac4 | |||
| 5c30ff4d3e | |||
| 3269f02ba7 | |||
| e5c2e3b3eb | |||
| 77f4aee0af | |||
| 868cbdfc7b | |||
| a650c0eab8 | |||
| a7dc8d8c6f | |||
| 355db16d2c | |||
| c54ce41eb7 | |||
| afb7d4c9d1 | |||
| b55cdde9da | |||
| 93cbc6c770 | |||
| 3b1b4a0a96 | |||
| 10b45cb54d | |||
| 9d289e571b | |||
| cce871c30e | |||
| c2b605a90f | |||
| 09149592b5 | |||
| e7410e551b | |||
| 9d77bc4192 | |||
| 537fa0c423 | |||
| c78dbc8bc1 | |||
| 249eed5c2c | |||
| 55eb3b24f7 | |||
| 508c255d0f | |||
| 9f8a90c0ac | |||
| 861dc935cb | |||
| 96ef8cacea | |||
| 5f3ecc8713 | |||
| 8b8ef0eb46 | |||
| 2dbea54c84 | |||
| a776d9fb6f | |||
| 57b7bbff5a | |||
| a832b0ed54 | |||
| 3ec75b84ae | |||
| b932763080 | |||
| 374f8f2f69 | |||
| 226c253d5a | |||
| c78a9f7950 | |||
| 7264510ab2 | |||
| 3458ec6511 | |||
| 2c80db6678 | |||
| 439aa6e4f5 | |||
| adf544dca9 | |||
| 0965269ee9 | |||
| 19d370c4e9 | |||
| cee0f8b652 | |||
| 37664d3487 | |||
| 5a78015d81 | |||
| 7250962ba3 | |||
| 442120bfdb | |||
| de624d1e54 | |||
| 523029cc45 | |||
| 934affe419 | |||
| 55b9af1589 | |||
| 16dd7e46ef | |||
| 851c77d8f2 | |||
| ee55b74898 | |||
| 13fc1e5c66 | |||
| 87112c2942 | |||
| 2664fdca30 | |||
| e05f523145 | |||
| 1148d29439 | |||
| 7ba52978d1 | |||
| 138a9fee43 | |||
| 1d522eaf0d | |||
| b5c5da64c9 | |||
| 8466425836 | |||
| b774ee5cd0 | |||
| 7e2e0e926b | |||
| 30f673c63c | |||
| bb5be728e3 | |||
| 0be5d1c657 | |||
| d143e6be06 | |||
| e65a78a5f5 | |||
| 4f443a3c62 | |||
| ff82ddea97 | |||
| 2e2d3f5e87 | |||
| 491b1041f8 | |||
| ce192d33f7 | |||
| ca1cb64026 | |||
| 71b5f5e469 | |||
| 946567f903 | |||
| 036e739511 | |||
| 87a95b85c5 | |||
| 4f49859bf7 | |||
| 2c53e55533 | |||
| 2ae75978dd | |||
| 452d825e66 | |||
| a7a1c4f81e | |||
| 00740eb9e8 | |||
| d76264c255 | |||
| 2297ce418d | |||
| fec85e6c59 | |||
| 54efa35fb3 | |||
| 988aebf630 | |||
| d2f7766aea | |||
| 25d30aee64 | |||
| 8af92da23c | |||
| 08dd36e1b0 | |||
| 324ff0a17c | |||
| cfb372e5e2 | |||
| 6513c732ba | |||
| c4ea869223 | |||
| 5387267675 | |||
| 8e4c3cc562 | |||
| 8b6b0699e5 | |||
| 229bff1658 | |||
| 7a59d37350 | |||
| d06b1e7883 | |||
| c8a284db9d | |||
| c7d6aceff4 | |||
| 7ea45d5e89 | |||
| 48c4aafb15 | |||
| ff302ed842 | |||
| 20a2424b83 | |||
| de0f34a27a | |||
| d0992cce3f | |||
| 15feeb3614 | |||
| fc0a879e52 | |||
| 9b675146a2 | |||
| 4d0bdcc8c0 | |||
| 0abdb67687 | |||
| d1fb98cf1b | |||
| 5eac24eacb | |||
| 3fd16daeca | |||
| d9b38c3b73 | |||
| 0a5176c1ee | |||
| b836b0e273 | |||
| 9a41e2a65d | |||
| cb1b74ed7b | |||
| e25e5d9768 | |||
| 9f3766952f | |||
| cb4471b07f | |||
| 9fa7eac41f | |||
| 94fa985550 | |||
| 1c498ead35 | |||
| 5abc983172 | |||
| 7a0d4919b0 | |||
| d5e9183877 | |||
| 9b39a51e9f | |||
| bec7eabd1c | |||
| cd3791087f | |||
| 714985e377 | |||
| 76c37dce96 | |||
| 5a9af40058 | |||
| e871ff35b7 | |||
| ecc6c32933 | |||
| 831cf61a08 | |||
| cc1231dece | |||
| bb3d1a165b | |||
| 3da0426c54 | |||
| e01aa25be3 | |||
| ee2f9d8dcb | |||
| 4d8677965c | |||
| 72729d5510 | |||
| 0b57e70c87 | |||
| 033d6489f8 | |||
| 8608007337 | |||
| 665e493570 | |||
| eb1e2f60f3 | |||
| dc637f0a9b | |||
| f81634728d | |||
| 440cd5ebc0 | |||
| 1cd7d0f205 | |||
| a69d62911c | |||
| 395e9bd006 | |||
| 90e20810d5 | |||
| 9c714e7687 | |||
| 6c3523d61c | |||
| 183840b793 | |||
| 4e2856aa64 | |||
| 4627a39165 | |||
| c87cbe83d2 | |||
| f05282badf | |||
| 957879346e | |||
| 87e64f67f3 | |||
| 43840d246d | |||
| 4aeb9af8a7 | |||
| b37acb8bc6 | |||
| 433865e927 | |||
| 5428161e0f | |||
| db0b536b5b | |||
| a4e50908fb | |||
| 96b89fe83d | |||
| adb131f131 | |||
| 757ab87e8a | |||
| f1d1db1159 | |||
| 3942bf60a6 | |||
| e2c0dcc0da | |||
| f63180d8d8 | |||
| 999bbf3d50 | |||
| eab612bdd0 | |||
| 1147186b4c | |||
| a88314e061 | |||
| 9221f5528d | |||
| 520f60cd65 | |||
| 84c85774e8 | |||
| 1f118deed9 | |||
| 55ce07ae73 | |||
| 85677d5e91 | |||
| 04f9be15b8 | |||
| 09cd72a829 | |||
| f5f5ad70e3 | |||
| a0774b320a | |||
| 4feea6051a | |||
| f548ea757b | |||
| abc8ea5280 | |||
| bacd2313fb | |||
| 63295d3f9b | |||
| 9c25eb20cf | |||
| 7f533f33ae | |||
| 352b4e1ed8 | |||
| 9a4252b579 | |||
| ed7011c229 | |||
| 4ddd6a5207 | |||
| 0a74c7cfd2 | |||
| d84fdc7599 | |||
| dac1268266 | |||
| b42db1c7c1 | |||
| 7a7a27c5c7 | |||
| af83186b10 | |||
| a8646f8fe7 | |||
| 01c1e30284 | |||
| b3980f9e39 | |||
| c9fd50d23e | |||
| ea3544f46d | |||
| 4e04f5f540 | |||
| b1021cf233 | |||
| 8fa3529123 | |||
| 3b494c235a | |||
| 1641c3e3e8 | |||
| ccd5d850ac | |||
| b989f160cf | |||
| 54e144564c | |||
| ab8599da6d | |||
| 0885702873 | |||
| 0083bc9302 | |||
| cbc0821928 | |||
| 7a70169d06 | |||
| bf2377ac11 | |||
| 1f79126b27 | |||
| 624e324383 | |||
| 846ebb285e | |||
| e567759935 | |||
| fe706c184e | |||
| 90bbb8e348 | |||
| e21ec540c2 | |||
| 2a4517ced4 | |||
| 8c8d151b3e | |||
| 44a3cf1934 | |||
| 5dcd3c8c8f | |||
| 251bd7cd3d | |||
| 02dfb0a8c1 | |||
| 544d499ab1 | |||
| 8ebc2f7079 | |||
| a31ba16070 | |||
| 60e3baad8a | |||
| f720a84831 | |||
| b74b2c4399 | |||
| 252aa10d75 | |||
| 6f3d362920 | |||
| 9b54e4c79f | |||
| f908d0d170 | |||
| 852ecdd1a9 | |||
| 78f5df5e56 | |||
| 580a61a515 | |||
| 4faf5a0150 | |||
| 1201d2434a | |||
| e1ca392da6 | |||
| 3ee6d22727 | |||
| 28a0329f65 | |||
| 2dc696c940 | |||
| e3acef0e91 | |||
| 62601f1adc | |||
| 982915a22f | |||
| 9f1bbd097f | |||
| 694bd6e74a | |||
| 394cf0bc8e | |||
| 09257deaae | |||
| 21c4b0dd95 | |||
| 3b4662b583 | |||
| 2e2e6457c7 | |||
| 631a7cccd6 | |||
| 2a3d51c7dc | |||
| e7e8a17b61 | |||
| 8fd8a56893 | |||
| 443c453507 | |||
| 0495c89ba1 | |||
| 78e4dfbece | |||
| 1c7a481ed9 | |||
| c3dedcbba5 | |||
| 1c767a0e9f | |||
| f3b0ba49e0 | |||
| 31dfcbaa9e | |||
| 8e11c5f46d | |||
| 70793ff559 | |||
| 6621e71e6c |
@@ -5,3 +5,4 @@ pkg
|
||||
Gemfile.lock
|
||||
*.gem
|
||||
*.swp
|
||||
.*
|
||||
|
||||
+9
-4
@@ -1,7 +1,12 @@
|
||||
rvm:
|
||||
- 1.8.7
|
||||
- 1.9.3
|
||||
notifications:
|
||||
disabled: true
|
||||
- 2.1.0
|
||||
- 2.1.1
|
||||
- 2.2.2
|
||||
- 2.3.0
|
||||
- 2.4.0
|
||||
- jruby-9.1.8.0
|
||||
jdk:
|
||||
- oraclejdk8
|
||||
before_install:
|
||||
- sudo apt-get update
|
||||
- sudo apt-get install libicu-dev
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
# Contributing to Gollum
|
||||
|
||||
Thanks for your interest in the gollum project!
|
||||
|
||||
## Submitting an Issue
|
||||
|
||||
Please note that the issue tracker is meant for:
|
||||
|
||||
1. Bug reports.
|
||||
2. Feature requests.
|
||||
|
||||
If your have problems using or installing the software which stem from bugs in the software or a lack of documentation, we are always happy to help out! However, **for ordinary usage questions, please consider asking elsewhere**, for instance on [StackOverflow](http://stackoverflow.com/questions/tagged/gollum-wiki).
|
||||
|
||||
Gollum supports [custom macros](https://github.com/gollum/gollum/wiki#macros) for the creation of additional wiki markup tags. Please **do not** use this tracker to request macros specific to your situation. However, if you have or are working on a macro that you think may be useful to more users, you can share it as a GitHub [gist](https://gist.github.com) and link to it in the [wiki](https://github.com/gollum/gollum/wiki/Custom-macros).
|
||||
|
||||
Before submitting an issue, **please carefully look through the following places** to make sure your problem is not already addressed:
|
||||
|
||||
1. The issue tracker.
|
||||
1. The [README](https://github.com/gollum/gollum/blob/master/README.md).
|
||||
1. The project's [wiki](https://github.com/gollum/gollum/wiki).
|
||||
|
||||
Lastly, please **consider helping out** by opening a Pull Request!
|
||||
|
||||
Serious bugs can be reported directly to the maintainers using these GPG keys:
|
||||
|
||||
* [@dometto](https://pgp.mit.edu/pks/lookup?op=vindex&search=0xD637E455CD3E27BF)
|
||||
|
||||
## Opening a Pull Request
|
||||
|
||||
Pull Requests fixing bugs, implementing new features, or updating documentation and dependencies are all very welcome! If you would like to help out with the project, you can pick an open issue from the issue tracker. We're more than happy to help you get started! Here's how you can proceed:
|
||||
|
||||
1. Fork and clone Gollum.
|
||||
2. Create a thoughtfully named topic branch to contain your changes.
|
||||
3. If you haven't installed dependencies yet, navigate to your clone and execute:
|
||||
```
|
||||
[sudo] bundle install
|
||||
```
|
||||
4. Hack away.
|
||||
5. Add your own tests and make sure they're all still passing.
|
||||
6. If some of your changes deserve a mention on Gollum's home page, edit the README accordingly.
|
||||
7. If necessary, rebase your commits into logical chunks, without errors.
|
||||
8. Push the branch to your fork on GitHub.
|
||||
9. Create a pull request for Gollum.
|
||||
|
||||
**Notes:**
|
||||
* Do not change Gollum's version numbers, we will do that on our own.
|
||||
|
||||
### Running tests
|
||||
|
||||
1. Install [Bundler](http://bundler.io/).
|
||||
2. Navigate to the cloned source of Gollum.
|
||||
3. Install dependencies:
|
||||
```
|
||||
[sudo] bundle install
|
||||
```
|
||||
4. Run the tests:
|
||||
```
|
||||
bundle exec rake test
|
||||
```
|
||||
|
||||
### Working with test repositories
|
||||
|
||||
An example of how to add a test file to the bare repository lotr.git.
|
||||
|
||||
```
|
||||
mkdir tmp
|
||||
cd tmp
|
||||
git clone ../lotr.git/
|
||||
git log
|
||||
echo "test" > test.md
|
||||
git add .
|
||||
git commit -am "Add test"
|
||||
git push ../lotr.git/ master
|
||||
```
|
||||
|
||||
## Releasing the gem
|
||||
|
||||
Gollum uses [Semantic Versioning](http://semver.org/).
|
||||
|
||||
x.y.z
|
||||
|
||||
For z releases:
|
||||
|
||||
```
|
||||
rake bump
|
||||
rake release
|
||||
```
|
||||
|
||||
For x.y releases:
|
||||
|
||||
```
|
||||
# First update VERSION in lib/gollum.rb and then:
|
||||
rake gemspec
|
||||
rake release
|
||||
```
|
||||
@@ -1,4 +1,4 @@
|
||||
source 'https://rubygems.org'
|
||||
|
||||
gemspec
|
||||
gem 'rake', '~> 10.0.2'
|
||||
gem 'rake', '~> 10.4'
|
||||
|
||||
+36
@@ -1,3 +1,39 @@
|
||||
# 4.1.2 /2017-08-07
|
||||
|
||||
* Lock to a newer version of gollum-lib to avoid installing an outdated and vulnerable dependency (nokogiri) on ruby 2.0. See https://github.com/gollum/gollum-lib/pull/279. Note: this breaks semantic versioning so those using outdated rubies will discover the problem on update.
|
||||
|
||||
# 4.1.0 /2017-03-09
|
||||
|
||||
* Added file deletion functionality to file view
|
||||
* Various performance improvements
|
||||
* Emoji support
|
||||
|
||||
# 4.0.0 /2015-04-11
|
||||
|
||||
* Now compatible with JRuby (via the [rjgit](https://github.com/repotag/rjgit) [adapter](https://github.com/repotag/gollum-lib_rjgit_adapter))
|
||||
|
||||
# 3.1.1 /2014-12-04
|
||||
|
||||
* Security fix for [remote code execution issue](https://github.com/gollum/gollum/issues/913). Please update!
|
||||
|
||||
# 3.1 / 2014-11-28
|
||||
|
||||
* New features
|
||||
* Drag-and-drop uploading in the editor [@lucas-clemente](https://github.com/lucas-clemente)
|
||||
* Latest changes view [@etienneCharignon](https://github.com/etienneCharignon) (#707)
|
||||
* Option `--no-edit` to disable editing from the web interface [@bambycha](https://github.com/bambycha) (#879)
|
||||
* Option `--mathjax-config` to specify custom mathjax configuration [@hardywu](https://github.com/hardywu) (#842)
|
||||
* Major enhancements
|
||||
* Made the Gollum theme responsive [@rtrvrtg](https://github.com/rtrvrtg) (#831)
|
||||
* Depends on new [gollum-lib](https://github.com/gollum/gollum-lib) `4.0.0`
|
||||
* Allows specifiying [git adapter](https://github.com/gollum/gollum/wiki/Git-adapters) with `--adapter` [@bartkamphorst](https://github.com/bartkamphorst), [@dometto](https://github.com/dometto)
|
||||
* Numerous bugfixes
|
||||
* **NB**: please pass `--h1-title` if you do not want page titles to default to the page's filepath. See [here](https://github.com/gollum/gollum/wiki/Page-titles).
|
||||
|
||||
# 2.4.11 / 2013-01-08
|
||||
|
||||
* Numerous security issues have been fixed. Please update to `2.4.11`
|
||||
|
||||
# 1.4.0 / 2012-04-10
|
||||
|
||||
* Minor
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque vulputate tincidunt sollicitudin. Quisque sit amet leo sed nunc eleifend rhoncus in consectetur leo. Vivamus posuere semper convallis. Duis malesuada lacus sed erat lobortis tincidunt mattis ligula consectetur. Sed aliquam vulputate eros at euismod. Aenean egestas lorem ligula, quis faucibus turpis. Curabitur a eros in ipsum gravida ornare. Sed elementum enim vel mi scelerisque dapibus. Nulla id libero ligula, quis tempus sem. Morbi nec felis tortor, ac cursus risus. Mauris elementum tortor id lacus eleifend non lobortis tellus pharetra. Etiam posuere cursus vestibulum. $x \lt y$
|
||||
|
||||
Morbi tincidunt dolor vel massa dictum volutpat. Vestibulum quis nibh metus, id tincidunt nisl. Vivamus eget sem ac risus eleifend rhoncus at eu nisl. Nunc elit massa, vulputate ac gravida eget, condimentum quis justo. Integer scelerisque, libero vel consequat ultricies, eros libero sagittis libero, pellentesque bibendum quam massa ut orci. Maecenas sit amet urna eget quam aliquam posuere. Nulla facilisi. Duis imperdiet augue sit amet metus ornare et hendrerit dui feugiat. Aenean a lacus neque. Sed eu enim tincidunt dolor pharetra porttitor. Vestibulum ut felis dui, rutrum iaculis orci. Duis eu bibendum tortor. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Suspendisse mollis sagittis purus sit amet sollicitudin. Phasellus vel interdum erat.
|
||||
@@ -1,589 +1,177 @@
|
||||
gollum -- A wiki built on top of Git
|
||||
gollum -- A git-based Wiki
|
||||
====================================
|
||||
|
||||
[](http://travis-ci.org/github/gollum)
|
||||
[](https://gemnasium.com/github/gollum)
|
||||
[](http://badge.fury.io/rb/gollum)
|
||||
[](https://travis-ci.org/gollum/gollum)
|
||||
[](https://gemnasium.com/gollum/gollum)
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
Gollum is a simple wiki system built on top of Git that powers GitHub Wikis.
|
||||
Gollum is a simple wiki system built on top of Git. A Gollum Wiki is simply a git repository (either bare or regular) of a specific nature:
|
||||
* A Gollum repository's contents are human-editable, unless the repository is bare. Pages are unique text files which may be organized into directories any way you choose. Other content can also be included, for example images, PDFs and headers/footers for your pages.
|
||||
* Gollum pages:
|
||||
* May be written in a variety of [markups](#markups).
|
||||
* Can be edited with your favourite system editor or IDE (changes will be visible after committing) or with the built-in web interface.
|
||||
* Can be displayed in all versions (commits).
|
||||
|
||||
Gollum wikis are simply Git repositories that adhere to a specific format.
|
||||
Gollum pages may be written in a variety of formats and can be edited in a
|
||||
number of ways depending on your needs. You can edit your wiki locally:
|
||||
Gollum can be launched either as a webserver (with the web interface) or in "console mode", where you can use a predefined API to query and manipulate the repository. For more information, see the [Running](#running) and [Configuration](#configuration) sections.
|
||||
|
||||
* With your favorite text editor or IDE (changes will be visible after committing).
|
||||
* With the built-in web interface.
|
||||
* With the Gollum Ruby API.
|
||||
For more information on Gollum's capabilities and pitfalls:
|
||||
|
||||
Gollum follows the rules of [Semantic Versioning](http://semver.org/) and uses
|
||||
[TomDoc](http://tomdoc.org/) for inline documentation.
|
||||
1. [Syntax/capability overview for pages](https://github.com/gollum/gollum/wiki).
|
||||
2. [Known limitations](https://github.com/gollum/gollum/wiki/Known-limitations).
|
||||
3. [Troubleshoot guide](https://github.com/gollum/gollum/wiki/Troubleshoot-guide).
|
||||
4. [Security overview](https://github.com/gollum/gollum/wiki/Security).
|
||||
|
||||
### Videos
|
||||
|
||||
* [Quick impression of gollum](https://www.youtube.com/watch?v=gj1qqK3Oku8)
|
||||
* [Gollum overview and simple markdown tutorial (german with english subtitles)](https://www.youtube.com/watch?v=wfWgDRmcbU4)
|
||||
* [Advanced features in action](https://www.youtube.com/watch?v=EauxgxsLDC4)
|
||||
|
||||
## SYSTEM REQUIREMENTS
|
||||
- Python 2.5+ (2.7.3 recommended)
|
||||
- Ruby 1.8.7+ (1.9.3 recommended)
|
||||
- Unix like operating system (OS X, Ubuntu, Debian, and more)
|
||||
- Will not work on Windows (because of [grit](https://github.com/github/grit))
|
||||
|
||||
| Operating System | Ruby | Adapters | Supported |
|
||||
| ---------------- | -------------- | ------------------ | --------- |
|
||||
| Unix/Linux-like | Ruby 1.9.3+ | all except [RJGit](https://github.com/repotag/rjgit) | yes |
|
||||
| Unix/Linux-like | [JRuby](https://github.com/jruby/jruby) (1.9.3+ compatible) | [RJGit](https://github.com/repotag/rjgit) | yes |
|
||||
| Windows | Ruby 1.9.3+ | all except [RJGit](https://github.com/repotag/rjgit) | no |
|
||||
| Windows | [JRuby](https://github.com/jruby/jruby) (1.9.3+ compatible) | [RJGit](https://github.com/repotag/rjgit) | almost<sup>1</sup> |
|
||||
|
||||
**Notes:**
|
||||
|
||||
1. There are still some bugs and this setup is not ready for production yet. You can track the progress at [Support Windows via JRuby - Meta Issue](https://github.com/gollum/gollum/issues/1044).
|
||||
|
||||
## INSTALLATION
|
||||
|
||||
The best way to install Gollum is with RubyGems:
|
||||
Varies depending on operating system, package manager and Ruby installation. Generally, you should first install Ruby and then Gollum.
|
||||
|
||||
$ [sudo] gem install gollum
|
||||
1. Ruby is best installed either via [RVM](https://rvm.io/) or a package manager of choice.
|
||||
2. Gollum is best installed via RubyGems:
|
||||
```
|
||||
[sudo] gem install gollum
|
||||
```
|
||||
|
||||
If you're installing from source, you can use [Bundler][bundler] to pick up all the
|
||||
gems:
|
||||
Installation examples for individual systems can be seen [here](https://github.com/gollum/gollum/wiki/Installation).
|
||||
|
||||
$ bundle install
|
||||
**Notes:**
|
||||
* Whichever Ruby implementation you're using, Gollum ships with the appropriate default git adapter. So the above installation procedure is common for both MRI and JRuby.
|
||||
* If you're installing from source:
|
||||
* Optionally uninstall any previous versions of Gollum:
|
||||
```
|
||||
[sudo] gem uninstall -aIx gollum
|
||||
```
|
||||
* Install [Bundler](http://bundler.io/).
|
||||
* Navigate to the cloned source of Gollum.
|
||||
* Install dependencies:
|
||||
```
|
||||
[sudo] bundle install
|
||||
```
|
||||
* Build:
|
||||
```
|
||||
rake build
|
||||
```
|
||||
* And install:
|
||||
```
|
||||
[sudo] gem install --no-document pkg/gollum*.gem
|
||||
```
|
||||
|
||||
In order to use the various formats that Gollum supports, you will need to
|
||||
separately install the necessary dependencies for each format. You only need
|
||||
to install the dependencies for the formats that you plan to use.
|
||||
### Markups
|
||||
|
||||
* [ASCIIDoc](http://www.methods.co.nz/asciidoc/) -- `brew install asciidoc` on mac or `apt-get install -y asciidoc` on Ubuntu
|
||||
* [Creole](http://wikicreole.org/) -- `gem install creole`
|
||||
* [Markdown](http://daringfireball.net/projects/markdown/) -- `gem install redcarpet`
|
||||
* [GitHub Flavored Markdown](http://github.github.com/github-flavored-markdown/) -- `gem install github-markdown`
|
||||
* [Org](http://orgmode.org/) -- `gem install org-ruby`
|
||||
* [Pod](http://search.cpan.org/dist/perl/pod/perlpod.pod) -- `Pod::Simple::HTML` comes with Perl >= 5.10. Lower versions should install Pod::Simple from CPAN.
|
||||
Gollum presently ships with support for the following markups:
|
||||
* [Markdown](http://daringfireball.net/projects/markdown/syntax)
|
||||
* [RDoc](http://rdoc.sourceforge.net/)
|
||||
* [ReStructuredText](http://docutils.sourceforge.net/rst.html) -- `easy_install docutils`
|
||||
* [Textile](http://www.textism.com/tools/textile/) -- `gem install RedCloth`
|
||||
* [MediaWiki](http://www.mediawiki.org/wiki/Help:Formatting) -- `gem install wikicloth`
|
||||
|
||||
[bundler]: http://gembundler.com/
|
||||
Since all markups are rendered by the [github-markup](https://github.com/github/markup) gem, you can easily add support for other markups by additional installation:
|
||||
* [AsciiDoc](http://asciidoctor.org/docs/asciidoc-syntax-quick-reference/) -- `[sudo] gem install asciidoctor`
|
||||
* [Creole](http://www.wikicreole.org/wiki/CheatSheet) -- `[sudo] gem install creole`
|
||||
* [MediaWiki](http://www.mediawiki.org/wiki/Help:Formatting) -- `[sudo] gem install wikicloth`
|
||||
* [Org](http://orgmode.org/worg/dev/org-syntax.html) -- `[sudo] gem install org-ruby`
|
||||
* [Pod](http://perldoc.perl.org/perlpod.html) -- requires Perl >= 5.10 (the `perl` command must be available on your command line)
|
||||
* Lower versions should install `Pod::Simple` from CPAN.
|
||||
* [ReStructuredText](http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html) -- requires python >= 2 (the `python2` command must be available on your command line)
|
||||
* Note that Gollum will also need you to install `docutils` for your Python 2. Installation procedure can, again, vary depending on operating system and package manager.
|
||||
* [Textile](http://redcloth.org/hobix.com/textile/quick.html) -- `[sudo] gem install RedCloth`
|
||||
|
||||
By default, Gollum ships with the `kramdown` gem to render Markdown. However, you can use any [Markdown renderer supported by github-markup](https://github.com/github/markup/blob/master/lib/github/markup/markdown.rb). The thing to remember is that the first installed renderer from the list will be used. So, for example, `redcarpet` will NOT be used if `github/markdown` is installed.
|
||||
|
||||
## RUNNING
|
||||
|
||||
To view and edit your Gollum repository locally via the built in web
|
||||
interface, simply install the Gollum gem, navigate to your repository via the
|
||||
command line, and run the executable:
|
||||
Simply:
|
||||
|
||||
$ gollum
|
||||
1. Navigate to your git repository (wiki) via the command line.
|
||||
2. Run: `gollum`.
|
||||
3. Open `http://localhost:4567` in your browser.
|
||||
|
||||
This will start up a web server running the Gollum frontend and you can view
|
||||
and edit your wiki at http://localhost:4567. To get help on the command line
|
||||
utility, you can run it like so:
|
||||
This will start up a web server (WEBrick) running Gollum with a web interface, where you can view and edit your wiki.
|
||||
|
||||
$ gollum --help
|
||||
### Running from source
|
||||
|
||||
Note that the gollum server will not run on Windows because of [an issue](https://github.com/rtomayko/posix-spawn/issues/9) with posix-spawn (which is used by Grit).
|
||||
1. `git clone https://github.com/gollum/gollum`
|
||||
2. `cd gollum`
|
||||
3. `[sudo] bundle install` (may not always be necessary).
|
||||
4. `bundle exec bin/gollum`
|
||||
* Like that, gollum assumes the target wiki (git repository) is the project repository itself. If it's not, execute `bundle exec bin/gollum <path-to-wiki>` instead.
|
||||
5. Open `http://localhost:4567` in your browser.
|
||||
|
||||
## REPO STRUCTURE
|
||||
### Rack
|
||||
|
||||
A Gollum repository's contents are designed to be human editable. Page content
|
||||
is written in `page files` and may be organized into directories any way you
|
||||
choose. Special footers can be created in `footer files`. Other content
|
||||
(images, PDFs, etc) may also be present and organized in the same way.
|
||||
Gollum can also be ran with any [rack-compatible web server](https://github.com/rack/rack#supported-web-servers). More on that [over here](https://github.com/gollum/gollum/wiki/Gollum-via-Rack).
|
||||
|
||||
### Rack, with an authentication server
|
||||
|
||||
## PAGE FILES
|
||||
Gollum can also be ran alongside a CAS (Central Authentication Service) SSO (single sign-on) server. With a bit of tweaking, this adds basic user-support to Gollum. To see an example and an explanation, navigate [over here](https://github.com/gollum/gollum/wiki/Gollum-via-Rack-and-CAS-SSO).
|
||||
|
||||
Page files may be written in any format supported by
|
||||
[GitHub-Markup](http://github.com/github/markup) (except roff). The
|
||||
current list of formats and allowed extensions is:
|
||||
### Docker
|
||||
|
||||
* ASCIIDoc: .asciidoc
|
||||
* Creole: .creole
|
||||
* Markdown: .markdown, .mdown, .mkdn, .mkd, .md
|
||||
* Org Mode: .org
|
||||
* Pod: .pod
|
||||
* RDoc: .rdoc
|
||||
* ReStructuredText: .rest.txt, .rst.txt, .rest, .rst
|
||||
* Textile: .textile
|
||||
* MediaWiki: .mediawiki, .wiki
|
||||
Gollum can also be ran via [Docker](https://www.docker.com/). More on that [over here](https://github.com/gollum/gollum/wiki/Gollum-via-Docker).
|
||||
|
||||
Gollum detects the page file format via the extension, so files must have one
|
||||
of the supported extensions in order to be converted.
|
||||
### Service
|
||||
|
||||
Page file names may contain any printable UTF-8 character except space
|
||||
(U+0020) and forward slash (U+002F). If you commit a page file with any of
|
||||
these characters in the name it will not be accessible via the web interface.
|
||||
Gollum can also be ran as a service. More on that [over here](https://github.com/gollum/gollum/wiki/Gollum-as-a-service).
|
||||
|
||||
Even though page files may be placed in any directory, there is still only a
|
||||
single namespace for page names, so all page files should have globally unique
|
||||
names regardless of where they are located in the repository.
|
||||
## CONFIGURATION
|
||||
|
||||
The special page file `Home.ext` (where the extension is one of the supported
|
||||
formats) will be used as the entrance page to your wiki. If it is missing, an
|
||||
automatically generated table of contents will be shown instead.
|
||||
Gollum comes with the following command line options:
|
||||
|
||||
## SIDEBAR FILES
|
||||
| Option | Arguments | Description |
|
||||
| ----------------- | --------- | ----------- |
|
||||
| --host | [HOST] | Specify the hostname or IP address to listen on. Default: `0.0.0.0`.<sup>1</sup> |
|
||||
| --port | [PORT] | Specify the port to bind Gollum with. Default: `4567`. |
|
||||
| --config | [FILE] | Specify path to Gollum's configuration file. |
|
||||
| --ref | [REF] | Specify the git branch to serve. Default: `master`. |
|
||||
| --adapter | [ADAPTER] | Launch Gollum using a specific git adapter. Default: `grit`.<sup>2</sup> |
|
||||
| --bare | none | Tell Gollum that the git repository should be treated as bare. This is only necessary when using the default grit adapter. |
|
||||
| --base-path | [PATH] | Specify the leading portion of all Gollum URLs (path info). Setting this to `/wiki` will make the wiki accessible under `http://localhost:4567/wiki/`. Default: `/`. |
|
||||
| --page-file-dir | [PATH] | Specify the subdirectory for all pages. If set, Gollum will only serve pages from this directory and its subdirectories. Default: repository root. |
|
||||
| --css | none | Tell Gollum to inject custom CSS into each page. Uses `custom.css` from repository root.<sup>3,5</sup> |
|
||||
| --js | none | Tell Gollum to inject custom JS into each page. Uses `custom.js` from repository root.<sup>3,5</sup> |
|
||||
| --emoji | none | Parse and interpret emoji tags (e.g. :heart:). |
|
||||
| --no-edit | none | Disable the feature of editing pages. |
|
||||
| --live-preview | none | Enable the live preview feature in page editor. |
|
||||
| --no-live-preview | none | Disable the live preview feature in page editor. |
|
||||
| --allow-uploads | [MODE] | Enable file uploads. If set to `dir`, Gollum will store all uploads in the `/uploads/` directory in repository root. If set to `page`, Gollum will store each upload at the currently edited page.<sup>4</sup> |
|
||||
| --mathjax | none | Enables MathJax (renders mathematical equations). By default, uses the `TeX-AMS-MML_HTMLorMML` config with the `autoload-all` extension.<sup>5</sup> |
|
||||
| --irb | none | Launch Gollum in "console mode", with a [predefined API](https://github.com/gollum/gollum-lib/). |
|
||||
| --h1-title | none | Tell Gollum to use the first `<h1>` as page title. |
|
||||
| --show-all | none | Tell Gollum to also show files in the file view. By default, only valid pages are shown. |
|
||||
| --collapse-tree | none | Tell Gollum to collapse the file tree, when the file view is opened. By default, the tree is expanded. |
|
||||
| --user-icons | [MODE] | Tell Gollum to use specific user icons for history view. Can be set to `gravatar`, `identicon` or `none`. Default: `none`. |
|
||||
| --mathjax-config | [FILE] | Specify path to a custom MathJax configuration. If not specified, uses the `mathjax.config.js` file from repository root. |
|
||||
| --template-dir | [PATH] | Specify custom mustache template directory. |
|
||||
| --help | none | Display the list of options on the command line. |
|
||||
| --version | none | Display the current version of Gollum. |
|
||||
|
||||
Sidebar files allow you to add a simple sidebar to your wiki. Sidebar files
|
||||
are named `_Sidebar.ext` where the extension is one of the supported formats.
|
||||
Sidebars affect all pages in their directory and any subdirectories that do not
|
||||
have a sidebar file of their own.
|
||||
**Notes:**
|
||||
|
||||
## HEADER FILES
|
||||
1. The `0.0.0.0` IP address allows remote access. Should you wish for Gollum to turn into a personal Wiki, use `127.0.0.1`.
|
||||
2. Before using `--adapter`, you should probably read [this](https://github.com/gollum/gollum/wiki/Git-adapters) first.
|
||||
3. When `--css` or `--js` is used, respective files must be committed to your git repository or you will get a 302 redirect to the create a page.
|
||||
4. Files can be uploaded simply by dragging and dropping them onto the editor's text area (this is, however exclusive to the default editor, not the live preview editor).
|
||||
5. Read the relevant [Security note](https://github.com/gollum/gollum/wiki/Security#custom-cssjs--mathjax-config) before using these.
|
||||
|
||||
Header files allow you to add a simple header to your wiki. Header files must
|
||||
be named `_Header.ext` where the extension is one of the supported formats.
|
||||
Like sidebars, headers affect all pages in their directory and any
|
||||
subdirectories that do not have a header file of their own.
|
||||
### Config file
|
||||
|
||||
## FOOTER FILES
|
||||
When `--config` option is used, certain inner parts of Gollum can be customized. This is used throughout our wiki for certain user-level alterations, among which [customizing supported markups](https://github.com/gollum/gollum/wiki/Formats-and-extensions) will probably stand out.
|
||||
|
||||
Footer files allow you to add a simple footer to your wiki. Footer files must
|
||||
be named `_Footer.ext` where the extension is one of the supported formats.
|
||||
Like sidebars, footers affect all pages in their directory and any
|
||||
subdirectories that do not have a footer file of their own.
|
||||
|
||||
## HTML SANITIZATION
|
||||
|
||||
For security and compatibility reasons Gollum wikis may not contain custom CSS
|
||||
or JavaScript. These tags will be stripped from the converted HTML. See
|
||||
`docs/sanitization.md` for more details on what tags and attributes are
|
||||
allowed.
|
||||
|
||||
## TITLES
|
||||
|
||||
The first defined `h1` will override the default header on a page. There are two ways to set a page title. The metadata syntax:
|
||||
|
||||
`<!-- --- title: New Title -->`
|
||||
|
||||
The first `h1` tag can be set to always override the page title, without needing to use the metadata syntax. Start gollum with the `--h1-title` flag.
|
||||
## BRACKET TAGS
|
||||
|
||||
A variety of Gollum tags use a double bracket syntax. For example:
|
||||
|
||||
[[Link]]
|
||||
|
||||
Some tags will accept attributes which are separated by pipe symbols. For
|
||||
example:
|
||||
|
||||
[[Link|Page Title]]
|
||||
|
||||
In all cases, the first thing in the link is what is displayed on the page.
|
||||
So, if the tag is an internal wiki link, the first thing in the tag will be
|
||||
the link text displayed on the page. If the tag is an embedded image, the
|
||||
first thing in the tag will be a path to an image file. Use this trick to
|
||||
easily remember which order things should appear in tags.
|
||||
|
||||
Some formats, such as MediaWiki, support the opposite syntax:
|
||||
|
||||
[[Page Title|Link]]
|
||||
|
||||
## PAGE LINKS
|
||||
|
||||
To link to another Gollum wiki page, use the Gollum Page Link Tag.
|
||||
|
||||
[[Frodo Baggins]]
|
||||
|
||||
The above tag will create a link to the corresponding page file named
|
||||
`Frodo-Baggins.ext` where `ext` may be any of the allowed extension types. The
|
||||
conversion is as follows:
|
||||
|
||||
1. Replace any spaces (U+0020) with dashes (U+002D)
|
||||
2. Replace any slashes (U+002F) with dashes (U+002D)
|
||||
|
||||
If you'd like the link text to be something that doesn't map directly to the
|
||||
page name, you can specify the actual page name after a pipe:
|
||||
|
||||
[[Frodo|Frodo Baggins]]
|
||||
|
||||
The above tag will link to `Frodo-Baggins.ext` using "Frodo" as the link text.
|
||||
|
||||
The page file may exist anywhere in the directory structure of the repository.
|
||||
Gollum does a breadth first search and uses the first match that it finds.
|
||||
|
||||
Here are a few more examples:
|
||||
|
||||
[[J. R. R. Tolkien]] -> J.-R.-R.-Tolkien.ext
|
||||
[[Movies / The Hobbit]] -> Movies---The-Hobbit.ext
|
||||
[[モルドール]] -> モルドール.ext
|
||||
|
||||
|
||||
## EXTERNAL LINKS
|
||||
|
||||
As a convenience, simple external links can be placed within brackets and they
|
||||
will be linked to the given URL with the URL as the link text. For example:
|
||||
|
||||
[[http://example.com]]
|
||||
|
||||
External links must begin with either "http://" or "https://". If you need
|
||||
something more flexible, you can resort to the link syntax in the page's
|
||||
underlying markup format.
|
||||
|
||||
|
||||
## ABSOLUTE VS. RELATIVE VS. EXTERNAL PATH
|
||||
|
||||
For Gollum tags that operate on static files (images, PDFs, etc), the paths
|
||||
may be referenced as either relative, absolute, or external. Relative paths
|
||||
point to a static file relative to the page file within the directory
|
||||
structure of the Gollum repo (even though after conversion, all page files
|
||||
appear to be top level). These paths are NOT prefixed with a slash. For
|
||||
example:
|
||||
|
||||
gollum.pdf
|
||||
docs/diagram.png
|
||||
|
||||
Absolute paths point to a static file relative to the Gollum repo's
|
||||
root, regardless of where the page file is stored within the directory
|
||||
structure. These paths ARE prefixed with a slash. For example:
|
||||
|
||||
/pdfs/gollum.pdf
|
||||
/docs/diagram.png
|
||||
|
||||
External paths are full URLs. An external path must begin with either
|
||||
"http://" or "https://". For example:
|
||||
|
||||
http://example.com/pdfs/gollum.pdf
|
||||
http://example.com/images/diagram.png
|
||||
|
||||
All of the examples in this README use relative paths, but you may use
|
||||
whatever works best in your situation.
|
||||
|
||||
|
||||
## FILE LINKS
|
||||
|
||||
To link to static files that are contained in the Gollum repository you should
|
||||
use the Gollum File Link Tag.
|
||||
|
||||
[[Gollum|gollum.pdf]]
|
||||
|
||||
The first part of the tag is the link text. The path to the file appears after
|
||||
the pipe.
|
||||
|
||||
|
||||
## IMAGES
|
||||
|
||||
To display images that are contained in the Gollum repository you should use
|
||||
the Gollum Image Tag. This will display the actual image on the page.
|
||||
|
||||
[[gollum.png]]
|
||||
|
||||
In addition to the simple format, there are a variety of options that you
|
||||
can specify between pipe delimiters.
|
||||
|
||||
To specify alt text, use the `alt=` option. Default is no alt text.
|
||||
|
||||
[[gollum.png|alt=Gollum and his precious wiki]]
|
||||
|
||||
To place the image in a frame, use the `frame` option. When combined with the
|
||||
`alt=` option, the alt text will be used as a caption as well. Default is no
|
||||
frame.
|
||||
|
||||
[[gollum.png|frame|alt=Gollum and his precious wiki]]
|
||||
|
||||
To specify the alignment of the image on the page, use the `align=` option.
|
||||
Possible values are `left`, `center`, and `right`. Default is `left`.
|
||||
|
||||
[[gollum.png|align=center]]
|
||||
|
||||
To float an image so that text flows around it, use the `float` option. When
|
||||
`float` is specified, only `left` and `right` are valid `align` options.
|
||||
Default is not floating. When floating is activated but no alignment is
|
||||
specified, default alignment is `left`.
|
||||
|
||||
[[gollum.png|float]]
|
||||
|
||||
To specify a max-width, use the `width=` option. Units must be specified in
|
||||
either `px` or `em`.
|
||||
|
||||
[[gollum.png|width=400px]]
|
||||
|
||||
To specify a max-height, use the `height=` option. Units must be specified in
|
||||
either `px` or `em`.
|
||||
|
||||
[[gollum.png|height=300px]]
|
||||
|
||||
Any of these options may be composed together by simply separating them with
|
||||
pipes.
|
||||
|
||||
|
||||
## ESCAPING GOLLUM TAGS
|
||||
|
||||
If you need the literal text of a wiki or static link to show up in your final
|
||||
wiki page, simply preface the link with a single quote (like in LISP):
|
||||
|
||||
'[[Page Link]]
|
||||
'[[File Link|file.pdf]]
|
||||
'[[image.jpg]]
|
||||
|
||||
This is useful for writing about the link syntax in your wiki pages.
|
||||
|
||||
## TABLE OF CONTENTS
|
||||
|
||||
Gollum has a special tag to insert a table of contents (new in v2.1)
|
||||
|
||||
[[_TOC_]]
|
||||
|
||||
This tag is case sensitive, use all upper case. The TOC tag can be inserted
|
||||
into the `_Header`, `_Footer` or `_Sidebar` files too.
|
||||
|
||||
There is also a wiki option `:universal_toc` which will display a
|
||||
table of contents at the top of all your wiki pages if it is enabled.
|
||||
The `:universal_toc` is not enabled by default. To set the option,
|
||||
add the option to the `:wiki_options` hash before starting the
|
||||
frontend app:
|
||||
|
||||
Precious::App.set(:wiki_options, {:universal_toc => true})
|
||||
|
||||
## SYNTAX HIGHLIGHTING
|
||||
|
||||
In page files you can get automatic syntax highlighting for a wide range of
|
||||
languages (courtesy of [Pygments](http://pygments.org/) - must install
|
||||
separately) by using the following syntax:
|
||||
|
||||
```ruby
|
||||
def foo
|
||||
puts 'bar'
|
||||
end
|
||||
```
|
||||
|
||||
The block must start with three backticks, at the beginning of a line or
|
||||
indented with any number of spaces or tabs.
|
||||
After that comes the name of the language that is contained by the
|
||||
block. The language must be one of the `short name` lexer strings supported by
|
||||
Pygments. See the [list of lexers](http://pygments.org/docs/lexers/) for valid
|
||||
options.
|
||||
|
||||
The block contents should be indented at the same level than the opening backticks.
|
||||
If the block contents are indented with an additional two spaces or one tab,
|
||||
then that whitespace will be ignored (this makes the blocks easier to read in plaintext).
|
||||
|
||||
The block must end with three backticks indented at the same level than the opening
|
||||
backticks.
|
||||
|
||||
### GITHUB SYNTAX HIGHLIGHTING
|
||||
|
||||
As an extra feature, you can syntax highlight a file from your repository, allowing
|
||||
you keep some of your sample code in the main repository. The code-snippet is
|
||||
updated when the wiki is rebuilt. You include github code like this:
|
||||
|
||||
```html:github/gollum/master/test/file_view/1_file.txt```
|
||||
|
||||
This will make the builder look at the **github user**, in the **gollum project**,
|
||||
in the **master branch**, at path **test/file_view/1_file.txt**. It will be
|
||||
rewritten to:
|
||||
|
||||
```html
|
||||
<ol class="tree">
|
||||
<li class="file"><a href="0">0</a></li>
|
||||
</ol>
|
||||
```
|
||||
|
||||
Which will be parsed as HTML code during the Pygments run, and thereby coloured
|
||||
appropriately.
|
||||
|
||||
## MATHEMATICAL EQUATIONS
|
||||
|
||||
Start gollum with the `--mathjax` flag. Read more about [MathJax](http://docs.mathjax.org/en/latest/index.html) on the web. Gollum uses the `TeX-AMS-MML_HTMLorMML` config with the `autoload-all` extension.
|
||||
|
||||
Inline math:
|
||||
|
||||
- $2^2$
|
||||
- `\\(2^2\\)`
|
||||
|
||||
Display math:
|
||||
|
||||
- $$2^2$$
|
||||
- [2^2]
|
||||
|
||||
## SEQUENCE DIAGRAMS
|
||||
|
||||
You may imbed sequence diagrams into your wiki page (rendered by
|
||||
[WebSequenceDiagrams](http://www.websequencediagrams.com) by using the
|
||||
following syntax:
|
||||
|
||||
{{{{{{ blue-modern
|
||||
alice->bob: Test
|
||||
bob->alice: Test response
|
||||
}}}}}}
|
||||
|
||||
You can replace the string "blue-modern" with any supported style.
|
||||
|
||||
## API DOCUMENTATION
|
||||
|
||||
The Gollum API allows you to retrieve raw or formatted wiki content from a Git
|
||||
repository, write new content to the repository, and collect various meta data
|
||||
about the wiki as a whole.
|
||||
|
||||
Initialize the Gollum::Repo object:
|
||||
|
||||
# Require rubygems if necessary
|
||||
require 'rubygems'
|
||||
|
||||
# Require the Gollum library
|
||||
require 'gollum'
|
||||
|
||||
# Create a new Gollum::Wiki object by initializing it with the path to the
|
||||
# Git repository.
|
||||
wiki = Gollum::Wiki.new("my-gollum-repo.git")
|
||||
# => <Gollum::Wiki>
|
||||
|
||||
By default, internal wiki links are all absolute from the root. To specify a different base path, you can specify the `:base_path` option:
|
||||
|
||||
wiki = Gollum::Wiki.new("my-gollum-repo.git", :base_path => "/wiki")
|
||||
|
||||
Note that base_path just modifies the links. To map gollum to a non-root location:
|
||||
|
||||
- Use the gollum binary: `gollum path/to/wiki --base-path mywiki`
|
||||
- Define config.ru with `map`. See [#532](https://github.com/github/gollum/issues/532) for an example.
|
||||
|
||||
> :base_path - String base path for all Wiki links.
|
||||
>
|
||||
> The String base path to prefix to internal links. For example, when set
|
||||
> to "/wiki", the page "Hobbit" will be linked as "/wiki/Hobbit". Defaults
|
||||
> to "/".
|
||||
|
||||
Get the latest version of the given human or canonical page name:
|
||||
|
||||
page = wiki.page('page-name')
|
||||
# => <Gollum::Page>
|
||||
|
||||
page.raw_data
|
||||
# => "# My wiki page"
|
||||
|
||||
page.formatted_data
|
||||
# => "<h1>My wiki page</h1>"
|
||||
|
||||
page.format
|
||||
# => :markdown
|
||||
|
||||
vsn = page.version
|
||||
# => <Grit::Commit>
|
||||
|
||||
vsn.id
|
||||
# => '3ca43e12377ea1e32ea5c9ce5992ec8bf266e3e5'
|
||||
|
||||
Get the footer (if any) for a given page:
|
||||
|
||||
page.footer
|
||||
# => <Gollum::Page>
|
||||
|
||||
Get the header (if any) for a given page:
|
||||
|
||||
page.header
|
||||
# => <Gollum::Page>
|
||||
|
||||
Get a list of versions for a given page:
|
||||
|
||||
vsns = wiki.page('page-name').versions
|
||||
# => [<Grit::Commit, <Grit::Commit, <Grit::Commit>]
|
||||
|
||||
vsns.first.id
|
||||
# => '3ca43e12377ea1e32ea5c9ce5992ec8bf266e3e5'
|
||||
|
||||
vsns.first.authored_date
|
||||
# => Sun Mar 28 19:11:21 -0700 2010
|
||||
|
||||
Get a specific version of a given canonical page file:
|
||||
|
||||
wiki.page('page-name', '5ec521178e0eec4dc39741a8978a2ba6616d0f0a')
|
||||
|
||||
Get the latest version of a given static file:
|
||||
|
||||
file = wiki.file('asset.js')
|
||||
# => <Gollum::File>
|
||||
|
||||
file.raw_data
|
||||
# => "alert('hello');"
|
||||
|
||||
file.version
|
||||
# => <Grit::Commit>
|
||||
|
||||
Get a specific version of a given static file:
|
||||
|
||||
wiki.file('asset.js', '5ec521178e0eec4dc39741a8978a2ba6616d0f0a')
|
||||
|
||||
Get an in-memory Page preview (useful for generating previews for web
|
||||
interfaces):
|
||||
|
||||
preview = wiki.preview_page("My Page", "# Contents", :markdown)
|
||||
preview.formatted_data
|
||||
# => "<h1>Contents</h1>"
|
||||
|
||||
Methods that write to the repository require a Hash of commit data that takes
|
||||
the following form:
|
||||
|
||||
commit = { :message => 'commit message',
|
||||
:name => 'Tom Preston-Werner',
|
||||
:email => 'tom@github.com' }
|
||||
|
||||
Write a new version of a page (the file will be created if it does not already
|
||||
exist) and commit the change. The file will be written at the repo root.
|
||||
|
||||
wiki.write_page('Page Name', :markdown, 'Page contents', commit)
|
||||
|
||||
Update an existing page. If the format is different than the page's current
|
||||
format, the file name will be changed to reflect the new format.
|
||||
|
||||
page = wiki.page('Page Name')
|
||||
wiki.update_page(page, page.name, page.format, 'Page contents', commit)
|
||||
|
||||
To delete a page and commit the change:
|
||||
|
||||
wiki.delete_page(page, commit)
|
||||
|
||||
### RACK
|
||||
|
||||
You can also run gollum with any rack-compatible server by placing this config.ru
|
||||
file inside your wiki repository. This allows you to utilize any Rack middleware
|
||||
like Rack::Auth, OmniAuth, etc.
|
||||
|
||||
#!/usr/bin/env ruby
|
||||
require 'rubygems'
|
||||
require 'gollum/frontend/app'
|
||||
|
||||
gollum_path = File.expand_path(File.dirname(__FILE__)) # CHANGE THIS TO POINT TO YOUR OWN WIKI REPO
|
||||
Precious::App.set(:gollum_path, gollum_path)
|
||||
Precious::App.set(:default_markup, :markdown) # set your favorite markup language
|
||||
Precious::App.set(:wiki_options, {:universal_toc => false})
|
||||
run Precious::App
|
||||
|
||||
Your Rack middleware can pass author details to Gollum in a Hash in the session under the 'gollum.author' key.
|
||||
|
||||
## WINDOWS FILENAME VALIDATION
|
||||
Note that filenames on windows must not contain any of the following characters `\ / : * ? " < > |`. See [this support article](http://support.microsoft.com/kb/177506) for details.
|
||||
|
||||
## CONFIG FILE
|
||||
|
||||
Gollum optionally takes a `--config file`. See [config.rb](https://github.com/github/gollum/blob/master/config.rb) for an example.
|
||||
|
||||
## CUSTOM CSS
|
||||
|
||||
The `--css` flag will inject `custom.css` from the root of your git repository into each page. `custom.css` must be commited to git or you will get a 302 redirect to the create page. Here's an example of floating the sidebar to the left.
|
||||
|
||||
```css
|
||||
#wiki-rightbar { float: left !important; }
|
||||
```
|
||||
|
||||
## CONTRIBUTE
|
||||
|
||||
If you'd like to hack on Gollum, start by forking my repo on GitHub:
|
||||
|
||||
http://github.com/github/gollum
|
||||
|
||||
To get all of the dependencies, install the gem first. The best way to get
|
||||
your changes merged back into core is as follows:
|
||||
|
||||
1. Clone down your fork
|
||||
1. Create a thoughtfully named topic branch to contain your change
|
||||
1. Hack away
|
||||
1. Add tests and make sure everything still passes by running `rake`
|
||||
1. If you are adding new functionality, document it in the README
|
||||
1. Do not change the version number, I will do that on my end
|
||||
1. If necessary, rebase your commits into logical chunks, without errors
|
||||
1. Push the branch up to GitHub
|
||||
1. Send a pull request to the github/gollum project.
|
||||
|
||||
## RELEASING
|
||||
x.y.z
|
||||
|
||||
For z releases:
|
||||
$ rake bump
|
||||
$ rake release
|
||||
|
||||
For x.y releases:
|
||||
Update VERSION in lib/gollum.rb
|
||||
$ rake gemspec
|
||||
$ rake release
|
||||
|
||||
## BUILDING THE GEM FROM MASTER
|
||||
$ gem uninstall -aIx gollum
|
||||
$ git clone https://github.com/github/gollum.git
|
||||
$ cd gollum
|
||||
gollum$ rake build
|
||||
gollum$ gem install --no-ri --no-rdoc pkg/gollum*.gem
|
||||
**All of the mentioned alterations work both for Gollum's config file (`config.rb`) and Rack's config file (`config.ru`).**
|
||||
|
||||
@@ -107,20 +107,23 @@ end
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
desc 'Create a release build'
|
||||
desc 'Create a release build and push to rubygems'
|
||||
task :release => :build do
|
||||
unless `git branch` =~ /^\* master$/
|
||||
puts "You must be on the master branch to release!"
|
||||
exit!
|
||||
end
|
||||
sh "git commit --allow-empty -a -m 'Release #{version}'"
|
||||
sh "git pull"
|
||||
sh "git pull --rebase origin master"
|
||||
sh "git tag v#{version}"
|
||||
sh "git push origin master"
|
||||
sh "git push origin v#{version}"
|
||||
sh "gem push pkg/#{name}-#{version}.gem"
|
||||
end
|
||||
|
||||
desc 'Publish to rubygems. Same as release'
|
||||
task :publish => :release
|
||||
|
||||
desc 'Build gem'
|
||||
task :build => :gemspec do
|
||||
sh "mkdir -p pkg"
|
||||
@@ -128,6 +131,11 @@ task :build => :gemspec do
|
||||
sh "mv #{gem_file} pkg"
|
||||
end
|
||||
|
||||
desc "Build and install"
|
||||
task :install => :build do
|
||||
sh "gem install --local --no-ri --no-rdoc pkg/#{name}-#{version}.gem"
|
||||
end
|
||||
|
||||
desc 'Update gemspec'
|
||||
task :gemspec => :validate do
|
||||
# read spec file and split out manifest section
|
||||
|
||||
+193
-90
@@ -2,91 +2,169 @@
|
||||
|
||||
$:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
|
||||
|
||||
help = <<HELP
|
||||
Gollum is a multi-format Wiki Engine/API/Frontend.
|
||||
|
||||
Basic Command Line Usage:
|
||||
gollum [OPTIONS] [PATH]
|
||||
|
||||
PATH The path to the Gollum repository (default .).
|
||||
|
||||
Options:
|
||||
HELP
|
||||
|
||||
require 'optparse'
|
||||
require 'rubygems'
|
||||
require 'gollum'
|
||||
require 'cgi'
|
||||
|
||||
exec = {}
|
||||
options = { 'port' => 4567, 'bind' => '0.0.0.0' }
|
||||
wiki_options = {}
|
||||
exec = {}
|
||||
options = {
|
||||
:port => 4567,
|
||||
:bind => '0.0.0.0',
|
||||
}
|
||||
wiki_options = {
|
||||
:live_preview => false,
|
||||
:allow_uploads => false,
|
||||
:allow_editing => true,
|
||||
}
|
||||
|
||||
opts = OptionParser.new do |opts|
|
||||
opts.banner = help
|
||||
|
||||
opts.on("--port [PORT]", "Bind port (default 4567).") do |port|
|
||||
options['port'] = port.to_i
|
||||
# define program name (although this defaults to the name of the file, just in case...)
|
||||
opts.program_name = "gollum"
|
||||
|
||||
# set basic info for the "--help" command (options will be appended automatically from the below definitions)
|
||||
opts.banner = '
|
||||
Gollum is a multi-format Wiki Engine/API/Frontend.
|
||||
|
||||
Usage:
|
||||
gollum [options] [git-repo]
|
||||
|
||||
Arguments:
|
||||
[git-repo] Path to the git repository being served. If not specified, current working directory is used.
|
||||
|
||||
Notes:
|
||||
Paths for all options are relative to <git-repo> unless absolute.
|
||||
This message is only a basic description. For more information, please visit:
|
||||
https://github.com/gollum/gollum
|
||||
|
||||
OPTIONS'
|
||||
|
||||
# define gollum options
|
||||
opts.separator ""
|
||||
opts.separator " Major:"
|
||||
|
||||
opts.on("-h", "--host [HOST]", "Specify the hostname or IP address to listen on. Default: '0.0.0.0'.") do |host|
|
||||
options[:bind] = host
|
||||
end
|
||||
|
||||
opts.on("--host [HOST]", "Hostname or IP address to listen on (default 0.0.0.0).") do |host|
|
||||
options['bind'] = host
|
||||
opts.on("-p", "--port [PORT]", "Specify the port to bind Gollum with. Default: '4567'.") do |port|
|
||||
begin
|
||||
# don't use "port.to_i" here... it doesn't raise errors which might result in a nice confusion later on
|
||||
options[:port] = Integer(port)
|
||||
rescue ArgumentError
|
||||
puts "Error: '#{port}' is not a valid port number."
|
||||
exit 1
|
||||
end
|
||||
end
|
||||
opts.on("-c", "--config [FILE]", "Specify path to the Gollum's configuration file.") do |file|
|
||||
options[:config] = file
|
||||
end
|
||||
opts.on("-r", "--ref [REF]", "Specify the branch to serve. Default: 'master'.") do |ref|
|
||||
wiki_options[:ref] = ref
|
||||
end
|
||||
opts.on("-a", "--adapter [ADAPTER]", "Launch Gollum using a specific git adapter. Default: 'grit'.") do |adapter|
|
||||
Gollum::GIT_ADAPTER = adapter
|
||||
end
|
||||
opts.on("--bare", "Declare '<git-repo>' to be bare. This is only necessary when using the grit adapter.") do
|
||||
wiki_options[:repo_is_bare] = true
|
||||
end
|
||||
opts.on("-b", "--base-path [PATH]", "Specify the leading portion of all Gollum URLs (path info). Default: '/'.",
|
||||
"Example: setting this to '/wiki' will make the wiki accessible under 'http://localhost:4567/wiki/'.") do |base_path|
|
||||
|
||||
# first trim a leading slash, if any
|
||||
base_path.sub!(/^\/+/, '')
|
||||
|
||||
opts.on("--version", "Display current version.") do
|
||||
# make a backup of the option and sanitize it
|
||||
base_path_original = base_path.dup
|
||||
base_path = CGI.escape(base_path)
|
||||
|
||||
# then let the user know if we changed the URL
|
||||
unless base_path_original == base_path
|
||||
puts <<MSG
|
||||
Warning: your base-path has been sanitized:
|
||||
- original: '#{base_path_original}'
|
||||
- sanitized: '#{base_path}'
|
||||
MSG
|
||||
end
|
||||
|
||||
# and finally, let others enjoy our hard work:
|
||||
wiki_options[:base_path] = base_path
|
||||
end
|
||||
opts.on("--page-file-dir [PATH]", "Specify the subdirectory for all pages. Default: repository root.",
|
||||
"Example: setting this to 'pages' will make Gollum serve only pages at '<git-repo>/pages/*'.") do |path|
|
||||
wiki_options[:page_file_dir] = path
|
||||
end
|
||||
opts.on("--css", "Inject custom CSS into each page. The '<git-repo>/custom.css' file is used (must be committed).") do
|
||||
wiki_options[:css] = true
|
||||
end
|
||||
opts.on("--js", "Inject custom JavaScript into each page. The '<git-repo>/custom.js' file is used (must be committed).") do
|
||||
wiki_options[:js] = true
|
||||
end
|
||||
opts.on("--emoji", "Parse and interpret emoji tags (e.g. :heart:).") do
|
||||
wiki_options[:emoji] = true
|
||||
end
|
||||
opts.on("--no-edit", "Disable the feature of editing pages.") do
|
||||
wiki_options[:allow_editing] = false
|
||||
end
|
||||
opts.on("--live-preview", "Enable the live preview feature in page editor.") do
|
||||
wiki_options[:live_preview] = true
|
||||
end
|
||||
opts.on("--no-live-preview", "Disable the live preview feature in page editor.") do
|
||||
wiki_options[:live_preview] = false
|
||||
end
|
||||
opts.on("--allow-uploads [MODE]", [:dir, :page], "Enable file uploads.",
|
||||
"If set to 'dir', Gollum will store all uploads in the '<git-repo>/uploads/' directory.",
|
||||
"If set to 'page', Gollum will store each upload at the currently edited page.") do |mode|
|
||||
wiki_options[:allow_uploads] = true
|
||||
wiki_options[:per_page_uploads] = true if mode == :page
|
||||
end
|
||||
opts.on("--mathjax", "Enable MathJax (renders mathematical equations).",
|
||||
"By default, uses the 'TeX-AMS-MML_HTMLorMML' config with the 'autoload-all' extension.") do
|
||||
wiki_options[:mathjax] = true
|
||||
end
|
||||
opts.on("--irb", "Launch Gollum in 'console mode', with a predefined API.") do
|
||||
options[:irb] = true
|
||||
end
|
||||
|
||||
opts.separator ""
|
||||
opts.separator " Minor:"
|
||||
|
||||
opts.on("--h1-title", "Use the first '<h1>' as page title.") do
|
||||
wiki_options[:h1_title] = true
|
||||
end
|
||||
opts.on("--show-all", "Also show files in the file view. By default, only valid pages are shown.") do
|
||||
wiki_options[:show_all] = true
|
||||
end
|
||||
opts.on("--collapse-tree", "Collapse the tree, when file view is opened. By default, the tree is expanded.") do
|
||||
wiki_options[:collapse_tree] = true
|
||||
end
|
||||
opts.on("--user-icons [MODE]", [:gravatar, :identicon, :none], "Use specific user-icons for history view.",
|
||||
"Can be set to 'gravatar', 'identicon' or 'none'. Default: 'none'.") do |mode|
|
||||
wiki_options[:user_icons] = mode
|
||||
end
|
||||
opts.on("--mathjax-config [FILE]", "Specify path to a custom MathJax configuration.",
|
||||
"If not specified, uses the '<git-repo>/mathjax.config.js' file.") do |file|
|
||||
wiki_options[:mathjax_config] = file || 'mathjax.config.js'
|
||||
end
|
||||
opts.on("--plantuml-url [URL]", "Sets the PlantUML server endpoint.") do |url|
|
||||
wiki_options[:plantuml_url] = url
|
||||
end
|
||||
opts.on("--template-dir [PATH]", "Specify custom mustache template directory.") do |path|
|
||||
wiki_options[:template_dir] = path
|
||||
end
|
||||
|
||||
opts.separator ""
|
||||
opts.separator " Common:"
|
||||
|
||||
opts.on("--help", "Display this message.") do
|
||||
puts opts
|
||||
exit 0
|
||||
end
|
||||
opts.on("--version", "Display the current version of Gollum.") do
|
||||
puts "Gollum " + Gollum::VERSION
|
||||
exit 0
|
||||
end
|
||||
|
||||
opts.on("--config [CONFIG]", "Path to additional configuration file") do |config|
|
||||
options['config'] = config
|
||||
end
|
||||
|
||||
opts.on("--irb", "Start an irb process with gollum loaded for the current wiki.") do
|
||||
options['irb'] = true
|
||||
end
|
||||
|
||||
opts.on("--css", "Inject custom css. Uses custom.css from root repository") do
|
||||
wiki_options[:css] = true
|
||||
end
|
||||
|
||||
opts.on("--page-file-dir [PATH]", "Specify the sub directory for all page files (default: repository root).") do |path|
|
||||
wiki_options[:page_file_dir] = path
|
||||
end
|
||||
|
||||
opts.on("--base-path [PATH]", "Specify the base path.") do |path|
|
||||
wiki_options[:base_path] = path
|
||||
end
|
||||
|
||||
opts.on("--gollum-path [PATH]", "Specify the gollum path.") do |path|
|
||||
wiki_options[:gollum_path] = path
|
||||
end
|
||||
|
||||
opts.on("--ref [REF]", "Specify the repository ref to use (default: master).") do |ref|
|
||||
wiki_options[:ref] = ref
|
||||
end
|
||||
|
||||
opts.on("--no-live-preview", "Disables livepreview.") do
|
||||
wiki_options[:live_preview] = false
|
||||
end
|
||||
|
||||
opts.on("--mathjax", "Enables mathjax.") do
|
||||
wiki_options[:mathjax] = true
|
||||
end
|
||||
|
||||
opts.on("--user-icons [SOURCE]", "Set the history user icons. Valid values: gravatar, identicon, none. Default: none.") do |source|
|
||||
wiki_options[:user_icons] = source
|
||||
end
|
||||
|
||||
opts.on("--show-all", "Shows all files in file view. By default only valid pages are shown.") do
|
||||
wiki_options[:show_all] = true
|
||||
end
|
||||
|
||||
opts.on("--collapse-tree", "Collapse file view tree. By default, expanded tree is shown.") do
|
||||
wiki_options[:collapse_tree] = true
|
||||
end
|
||||
opts.on("--h1-title", "Sets page title to value of first h1") do
|
||||
wiki_options[:h1_title] = true
|
||||
end
|
||||
|
||||
opts.separator ""
|
||||
end
|
||||
|
||||
# Read command line options into `options` hash
|
||||
@@ -99,11 +177,9 @@ rescue OptionParser::InvalidOption
|
||||
end
|
||||
|
||||
# --gollum-path wins over ARGV[0]
|
||||
gollum_path = wiki_options[:gollum_path] ?
|
||||
wiki_options[:gollum_path] :
|
||||
ARGV[0] || Dir.pwd
|
||||
gollum_path = ARGV[0] || Dir.pwd
|
||||
|
||||
if options['irb']
|
||||
if options[:irb]
|
||||
require 'irb'
|
||||
# http://jameskilton.com/2009/04/02/embedding-irb-into-your-ruby-application/
|
||||
module IRB # :nodoc:
|
||||
@@ -129,10 +205,22 @@ if options['irb']
|
||||
end
|
||||
|
||||
begin
|
||||
require 'gollum-lib'
|
||||
wiki = Gollum::Wiki.new(gollum_path, wiki_options)
|
||||
if !wiki.exist? then raise Grit::InvalidGitRepositoryError end
|
||||
puts "Loaded Gollum wiki at #{File.expand_path(gollum_path).inspect}."
|
||||
if !wiki.exist? then
|
||||
raise Gollum::InvalidGitRepositoryError
|
||||
end
|
||||
if wiki_options[:plantuml_url]
|
||||
Gollum::Filter::PlantUML.configure do |config|
|
||||
puts "Using #{wiki_options[:plantuml_url]} as PlantUML endpoint"
|
||||
config.url = wiki_options[:plantuml_url]
|
||||
end
|
||||
end
|
||||
puts
|
||||
puts "Loaded Gollum wiki at:"
|
||||
puts "#{File.expand_path(gollum_path).inspect}"
|
||||
puts
|
||||
puts "Example API calls:"
|
||||
puts %( page = wiki.page('page-name'))
|
||||
puts %( # => <Gollum::Page>)
|
||||
puts
|
||||
@@ -142,41 +230,55 @@ if options['irb']
|
||||
puts %( page.formatted_data)
|
||||
puts %( # => "<h1>My wiki page</h1>")
|
||||
puts
|
||||
puts "Check out the Gollum README for more."
|
||||
puts "Full API documentation at:"
|
||||
puts "https://github.com/gollum/gollum-lib"
|
||||
puts
|
||||
IRB.start_session(binding)
|
||||
rescue Grit::InvalidGitRepositoryError, Grit::NoSuchPathError
|
||||
rescue Gollum::InvalidGitRepositoryError, Gollum::NoSuchPathError
|
||||
puts "Invalid Gollum wiki at #{File.expand_path(gollum_path).inspect}"
|
||||
exit 0
|
||||
end
|
||||
else
|
||||
require 'gollum/frontend/app'
|
||||
require 'gollum/app'
|
||||
Precious::App.set(:gollum_path, gollum_path)
|
||||
Precious::App.set(:wiki_options, wiki_options)
|
||||
Precious::App.settings.mustache[:templates] = wiki_options[:template_dir] if wiki_options[:template_dir]
|
||||
|
||||
if cfg = options['config']
|
||||
if cfg = options[:config]
|
||||
# If the path begins with a '/' it will be considered an absolute path,
|
||||
# otherwise it will be relative to the CWD
|
||||
cfg = File.join(Dir.getwd, cfg) unless cfg.slice(0) == File::SEPARATOR
|
||||
require cfg
|
||||
end
|
||||
|
||||
if wiki_options[:plantuml_url]
|
||||
Gollum::Filter::PlantUML.configure do |config|
|
||||
puts "Using #{wiki_options[:plantuml_url]} as PlantUML endpoint"
|
||||
config.url = wiki_options[:plantuml_url]
|
||||
end
|
||||
end
|
||||
|
||||
base_path = wiki_options[:base_path]
|
||||
|
||||
if wiki_options[:base_path].nil?
|
||||
if base_path.nil?
|
||||
Precious::App.run!(options)
|
||||
else
|
||||
require 'rack'
|
||||
|
||||
class MapGollum
|
||||
def initialize base_path
|
||||
def initialize(base_path)
|
||||
@mg = Rack::Builder.new do
|
||||
map '/' do
|
||||
run Proc.new { [ 302, {'Location'=> "/#{base_path}" }, [] ] }
|
||||
end
|
||||
|
||||
|
||||
map "/#{base_path}" do
|
||||
run Precious::App
|
||||
end
|
||||
map '/' do
|
||||
run Proc.new { [302, { 'Location' => "/#{base_path}" }, []] }
|
||||
end
|
||||
map '/*' do
|
||||
run Proc.new { [302, { 'Location' => "/#{base_path}" }, []] }
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -184,7 +286,8 @@ else
|
||||
@mg.call(env)
|
||||
end
|
||||
end
|
||||
|
||||
# Rack::Handler does not work with Ctrl + C. Use Rack::Server instead.
|
||||
Rack::Server.new(:app => MapGollum.new(base_path), :Port => options['port'], :Host => options['bind']).start
|
||||
Rack::Server.new(:app => MapGollum.new(base_path), :Port => options[:port], :Host => options[:bind]).start
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,28 +1,11 @@
|
||||
# Example gollum config
|
||||
# gollum ../wiki --config config.rb
|
||||
#
|
||||
# or run from source with
|
||||
#
|
||||
# bundle exec bin/gollum ../wiki/ --config config.rb
|
||||
|
||||
# Remove const to avoid
|
||||
# warning: already initialized constant FORMAT_NAMES
|
||||
#
|
||||
# only remove if it's defined.
|
||||
# constant Gollum::Page::FORMAT_NAMES not defined (NameError)
|
||||
Gollum::Page.send :remove_const, :FORMAT_NAMES if defined? Gollum::Page::FORMAT_NAMES
|
||||
# limit to one format
|
||||
Gollum::Page::FORMAT_NAMES = { :markdown => "Markdown" }
|
||||
|
||||
=begin
|
||||
Valid formats are:
|
||||
{ :markdown => "Markdown",
|
||||
:textile => "Textile",
|
||||
:rdoc => "RDoc",
|
||||
:org => "Org-mode",
|
||||
:creole => "Creole",
|
||||
:rest => "reStructuredText",
|
||||
:asciidoc => "AsciiDoc",
|
||||
:mediawiki => "MediaWiki",
|
||||
:pod => "Pod" }
|
||||
This file can be used to (e.g.):
|
||||
- alter certain inner parts of Gollum,
|
||||
- extend it with your stuff.
|
||||
|
||||
It is especially useful for customizing supported formats/markups. For more information and examples:
|
||||
- https://github.com/gollum/gollum#config-file
|
||||
|
||||
=end
|
||||
|
||||
# enter your Ruby code here ...
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
=begin
|
||||
You should use this file, if you wish to:
|
||||
- launch Gollum as a Rack app,
|
||||
- alter certain startup behaviour of Gollum.
|
||||
|
||||
For more information and examples:
|
||||
- https://github.com/gollum/gollum/wiki/Gollum-via-Rack
|
||||
- https://github.com/gollum/gollum#config-file
|
||||
|
||||
=end
|
||||
|
||||
# enter your Ruby code here ...
|
||||
@@ -0,0 +1,3 @@
|
||||
GOLLUM_USER=gollum
|
||||
GOLLUM_BASE=/home/gollum/wiki
|
||||
GOLLUM_OPTS="--config /home/gollum/config.rb"
|
||||
@@ -0,0 +1,36 @@
|
||||
#!/sbin/runscript
|
||||
# Distributed under the terms of the MIT License
|
||||
|
||||
NAME=gollum
|
||||
PID=/var/run/${NAME}.pid
|
||||
EXEC=/usr/local/bin/gollum
|
||||
LOG=/var/log/gollum.log
|
||||
|
||||
depend() {
|
||||
need net
|
||||
}
|
||||
|
||||
start() {
|
||||
# Change log file to be owned by GOLLUM_USER
|
||||
touch "${LOG}"
|
||||
chown "${GOLLUM_USER}" "${LOG}"
|
||||
|
||||
ebegin "Starting Gollum"
|
||||
start-stop-daemon --start \
|
||||
--name "${NAME}" \
|
||||
--user "${GOLLUM_USER}" \
|
||||
--pidfile "${PID}" \
|
||||
--make-pidfile --background \
|
||||
--stderr "${LOG}" \
|
||||
--exec "${EXEC}" -- $GOLLUM_OPTS "$GOLLUM_BASE"
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping Gollum"
|
||||
start-stop-daemon --stop \
|
||||
--name "${NAME}" \
|
||||
--user "${GOLLUM_USER}" \
|
||||
--pidfile "${PID}"
|
||||
eend $?
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
[Unit]
|
||||
Description=Gollum wiki server
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=%i
|
||||
ExecStart=/usr/bin/gollum
|
||||
Restart=on-abort
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Executable
+79
@@ -0,0 +1,79 @@
|
||||
#!/bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: gollum
|
||||
# Required-Start: $local_fs $remote_fs $network $syslog
|
||||
# Required-Stop: $local_fs $remote_fs $network $syslog
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# X-Interactive: true
|
||||
# Short-Description: Start/stop gollum wiki
|
||||
### END INIT INFO
|
||||
|
||||
# Distributed under the terms of the MIT License
|
||||
|
||||
set -e
|
||||
|
||||
# Edit these settings to your liking:
|
||||
GOLLUM_USER=gollum
|
||||
GOLLUM_BASE=/var/lib/gollum/.git
|
||||
GOLLUM_OPTS="--bare"
|
||||
|
||||
NAME=gollum
|
||||
PID=/var/run/${NAME}.pid
|
||||
EXEC=/usr/local/bin/gollum
|
||||
LOG=/var/log/gollum.log
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
start ()
|
||||
{
|
||||
# Change log file to be owned by GOLLUM_USER
|
||||
touch "${LOG}"
|
||||
chown "${GOLLUM_USER}" "${LOG}"
|
||||
|
||||
log_daemon_msg "Starting Gollum"
|
||||
start-stop-daemon --start \
|
||||
--name "${NAME}" \
|
||||
--user "${GOLLUM_USER}" \
|
||||
--chuid "${GOLLUM_USER}" \
|
||||
--pidfile "${PID}" \
|
||||
--make-pidfile --background \
|
||||
--startas /bin/sh -- -c "exec ${EXEC} $GOLLUM_OPTS \"$GOLLUM_BASE\" > \"${LOG}\" 2>&1"
|
||||
log_end_msg $?
|
||||
}
|
||||
|
||||
stop ()
|
||||
{
|
||||
log_daemon_msg "Stopping Gollum"
|
||||
start-stop-daemon --stop \
|
||||
--user "${GOLLUM_USER}" \
|
||||
--signal INT \
|
||||
--pidfile "${PID}" \
|
||||
--retry 10
|
||||
log_end_msg $?
|
||||
}
|
||||
|
||||
status ()
|
||||
{
|
||||
status_of_proc -p $PID $EXEC $NAME
|
||||
}
|
||||
|
||||
case $1 in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
restart)
|
||||
stop
|
||||
start
|
||||
;;
|
||||
status)
|
||||
status
|
||||
;;
|
||||
*)
|
||||
log_success_msg "Usage: $0 {start|stop|restart|status}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -1,32 +0,0 @@
|
||||
Sanitization Rules
|
||||
==================
|
||||
|
||||
Gollum uses the [Sanitize](http://wonko.com/post/sanitize) gem for HTML
|
||||
sanitization.
|
||||
|
||||
See `lib/gollum.rb` for actual settings.
|
||||
|
||||
## ALLOWED TAGS
|
||||
|
||||
a, abbr, acronym, address, area, b, big, blockquote, br, button, caption,
|
||||
center, cite, code, col, colgroup, dd, del, dfn, dir, div, dl, dt, em,
|
||||
fieldset, font, form, h1, h2, h3, h4, h5, h6, hr, i, img, input, ins, kbd,
|
||||
label, legend, li, map, menu, ol, optgroup, option, p, pre, q, s, samp,
|
||||
select, small, span, strike, strong, sub, sup, table, tbody, td, textarea,
|
||||
tfoot, th, thead, tr, tt, u, ul, var
|
||||
|
||||
## ALLOWED ATTRIBUTES
|
||||
|
||||
abbr, accept, accept-charset, accesskey, action, align, alt, axis, border,
|
||||
cellpadding, cellspacing, char, charoff, charset, checked, cite, class, clear,
|
||||
cols, colspan, color, compact, coords, datetime, dir, disabled, enctype, for,
|
||||
frame, headers, height, href, hreflang, hspace, id, ismap, label, lang,
|
||||
longdesc, maxlength, media, method, multiple, name, nohref, noshade, nowrap,
|
||||
prompt, readonly, rel, rev, rows, rowspan, rules, scope, selected, shape,
|
||||
size, span, src, start, summary, tabindex, target, title, type, usemap,
|
||||
valign, value, vspace, width
|
||||
|
||||
## ALLOWED PROTOCOLS
|
||||
|
||||
a href: http, https, mailto
|
||||
img src: http, https
|
||||
+1053
-526
File diff suppressed because it is too large
Load Diff
+6
-17
@@ -5,36 +5,25 @@ require 'digest/sha1'
|
||||
require 'ostruct'
|
||||
|
||||
# external
|
||||
require 'grit'
|
||||
require 'github/markup'
|
||||
require 'sanitize'
|
||||
|
||||
# internal
|
||||
require File.expand_path('../gollum/git_access', __FILE__)
|
||||
require File.expand_path('../gollum/committer', __FILE__)
|
||||
require File.expand_path('../gollum/pagination', __FILE__)
|
||||
require File.expand_path('../gollum/blob_entry', __FILE__)
|
||||
require File.expand_path('../gollum/wiki', __FILE__)
|
||||
require File.expand_path('../gollum/page', __FILE__)
|
||||
require File.expand_path('../gollum/file', __FILE__)
|
||||
require File.expand_path('../gollum/file_view', __FILE__)
|
||||
require File.expand_path('../gollum/markup', __FILE__)
|
||||
require File.expand_path('../gollum/sanitization', __FILE__)
|
||||
require File.expand_path('../gollum/web_sequence_diagram', __FILE__)
|
||||
require File.expand_path('../gollum/frontend/uri_encode_component', __FILE__)
|
||||
require File.expand_path('../gollum/uri_encode_component', __FILE__)
|
||||
|
||||
# Set ruby to UTF-8 mode
|
||||
# This is required for Ruby 1.8.7 which gollum still supports.
|
||||
$KCODE = 'U' if RUBY_VERSION[0,3] == '1.8'
|
||||
$KCODE = 'U' if RUBY_VERSION[0, 3] == '1.8'
|
||||
|
||||
module Gollum
|
||||
VERSION = '2.4.7'
|
||||
VERSION = '4.1.3'
|
||||
|
||||
def self.assets_path
|
||||
::File.expand_path('gollum/frontend/public', ::File.dirname(__FILE__))
|
||||
::File.expand_path('gollum/public', ::File.dirname(__FILE__))
|
||||
end
|
||||
|
||||
class Error < StandardError; end
|
||||
class Error < StandardError;
|
||||
end
|
||||
|
||||
class DuplicatePageError < Error
|
||||
attr_accessor :dir
|
||||
|
||||
@@ -0,0 +1,592 @@
|
||||
# ~*~ encoding: utf-8 ~*~
|
||||
require 'cgi'
|
||||
require 'sinatra'
|
||||
require 'gollum-lib'
|
||||
require 'mustache/sinatra'
|
||||
require 'useragent'
|
||||
require 'stringex'
|
||||
|
||||
require 'gollum'
|
||||
require 'gollum/views/layout'
|
||||
require 'gollum/views/editable'
|
||||
require 'gollum/views/has_page'
|
||||
|
||||
require File.expand_path '../helpers', __FILE__
|
||||
|
||||
#required to upload bigger binary files
|
||||
Gollum::set_git_timeout(120)
|
||||
Gollum::set_git_max_filesize(190 * 10**6)
|
||||
|
||||
# Fix to_url
|
||||
class String
|
||||
alias :upstream_to_url :to_url
|
||||
|
||||
if defined?(Gollum::GIT_ADAPTER) && Gollum::GIT_ADAPTER != 'grit'
|
||||
def to_ascii
|
||||
self # Do not transliterate utf-8 url's unless using Grit
|
||||
end
|
||||
end
|
||||
|
||||
# _Header => header which causes errors
|
||||
def to_url
|
||||
return nil if self.nil?
|
||||
upstream_to_url :exclude => ['_Header', '_Footer', '_Sidebar'], :force_downcase => false
|
||||
end
|
||||
end
|
||||
|
||||
# Run the frontend, based on Sinatra
|
||||
#
|
||||
# There are a number of wiki options that can be set for the frontend
|
||||
#
|
||||
# Example
|
||||
# require 'gollum/app'
|
||||
# Precious::App.set(:wiki_options, {
|
||||
# :universal_toc => false,
|
||||
# }
|
||||
#
|
||||
# See the wiki.rb file for more details on wiki options
|
||||
module Precious
|
||||
class App < Sinatra::Base
|
||||
register Mustache::Sinatra
|
||||
include Precious::Helpers
|
||||
|
||||
dir = File.dirname(File.expand_path(__FILE__))
|
||||
|
||||
# Detect unsupported browsers.
|
||||
Browser = Struct.new(:browser, :version)
|
||||
|
||||
@@min_ua = [
|
||||
Browser.new('Internet Explorer', '10.0'),
|
||||
Browser.new('Chrome', '7.0'),
|
||||
Browser.new('Firefox', '4.0'),
|
||||
Browser.new('Safari', '9.0')
|
||||
]
|
||||
|
||||
def supported_useragent?(user_agent)
|
||||
ua = UserAgent.parse(user_agent)
|
||||
@@min_ua.detect { |min| ua >= min }
|
||||
end
|
||||
|
||||
# We want to serve public assets for now
|
||||
set :public_folder, "#{dir}/public/gollum"
|
||||
set :static, true
|
||||
set :default_markup, :markdown
|
||||
|
||||
set :mustache, {
|
||||
# Tell mustache where the Views constant lives
|
||||
:namespace => Precious,
|
||||
|
||||
# Mustache templates live here
|
||||
:templates => "#{dir}/templates",
|
||||
|
||||
# Tell mustache where the views are
|
||||
:views => "#{dir}/views"
|
||||
}
|
||||
|
||||
# Sinatra error handling
|
||||
configure :development, :staging do
|
||||
enable :show_exceptions, :dump_errors
|
||||
disable :raise_errors, :clean_trace
|
||||
end
|
||||
|
||||
configure :test do
|
||||
enable :logging, :raise_errors, :dump_errors
|
||||
end
|
||||
|
||||
before do
|
||||
settings.wiki_options[:allow_editing] = settings.wiki_options.fetch(:allow_editing, true)
|
||||
@allow_editing = settings.wiki_options[:allow_editing]
|
||||
Precious::App.set(:mustache, {:templates => settings.wiki_options[:template_dir]}) if settings.wiki_options[:template_dir]
|
||||
@base_url = url('/', false).chomp('/')
|
||||
@page_dir = settings.wiki_options[:page_file_dir].to_s
|
||||
# above will detect base_path when it's used with map in a config.ru
|
||||
settings.wiki_options.merge!({ :base_path => @base_url })
|
||||
@css = settings.wiki_options[:css]
|
||||
@js = settings.wiki_options[:js]
|
||||
@mathjax_config = settings.wiki_options[:mathjax_config]
|
||||
end
|
||||
|
||||
get '/' do
|
||||
redirect clean_url(::File.join(@base_url, @page_dir, wiki_new.index_page))
|
||||
end
|
||||
|
||||
# path is set to name if path is nil.
|
||||
# if path is 'a/b' and a and b are dirs, then
|
||||
# path must have a trailing slash 'a/b/' or
|
||||
# extract_path will trim path to 'a'
|
||||
# name, path, version
|
||||
def wiki_page(name, path = nil, version = nil, exact = true)
|
||||
wiki = wiki_new
|
||||
path = name if path.nil?
|
||||
name = extract_name(name) || wiki.index_page
|
||||
path = extract_path(path)
|
||||
path = '/' if exact && path.nil?
|
||||
|
||||
OpenStruct.new(:wiki => wiki, :page => wiki.paged(name, path, exact, version),
|
||||
:name => name, :path => path)
|
||||
end
|
||||
|
||||
def wiki_new
|
||||
Gollum::Wiki.new(settings.gollum_path, settings.wiki_options)
|
||||
end
|
||||
|
||||
get '/emoji/:name' do
|
||||
begin
|
||||
[200, {'Content-Type' => 'image/png'}, emoji(params['name'])]
|
||||
rescue ArgumentError
|
||||
not_found
|
||||
end
|
||||
end
|
||||
|
||||
get '/data/*' do
|
||||
if page = wiki_page(params[:splat].first).page
|
||||
page.raw_data
|
||||
end
|
||||
end
|
||||
|
||||
get '/edit/*' do
|
||||
forbid unless @allow_editing
|
||||
wikip = wiki_page(params[:splat].first)
|
||||
@name = wikip.name
|
||||
@path = wikip.path
|
||||
@upload_dest = find_upload_dest(@path)
|
||||
|
||||
wiki = wikip.wiki
|
||||
@allow_uploads = wiki.allow_uploads
|
||||
if page = wikip.page
|
||||
if wiki.live_preview && page.format.to_s.include?('markdown') && supported_useragent?(request.user_agent)
|
||||
live_preview_url = '/livepreview/?page=' + encodeURIComponent(@name)
|
||||
if @path
|
||||
live_preview_url << '&path=' + encodeURIComponent(@path)
|
||||
end
|
||||
redirect to(live_preview_url)
|
||||
else
|
||||
@page = page
|
||||
@page.version = wiki.repo.log(wiki.ref, @page.path).first
|
||||
@content = page.text_data
|
||||
mustache :edit
|
||||
end
|
||||
else
|
||||
redirect to("/create/#{encodeURIComponent(@name)}")
|
||||
end
|
||||
end
|
||||
|
||||
post '/uploadFile' do
|
||||
forbid unless @allow_editing
|
||||
|
||||
wiki = wiki_new
|
||||
|
||||
unless wiki.allow_uploads
|
||||
@message = "File uploads are disabled"
|
||||
mustache :error
|
||||
return
|
||||
end
|
||||
|
||||
if params[:file]
|
||||
fullname = params[:file][:filename]
|
||||
tempfile = params[:file][:tempfile]
|
||||
end
|
||||
halt 500 unless tempfile.is_a? Tempfile
|
||||
|
||||
# Remove page file dir prefix from upload path if necessary -- committer handles this itself
|
||||
dir = wiki.per_page_uploads ? params[:upload_dest] : ::File.join([wiki.page_file_dir, 'uploads'].compact)
|
||||
ext = ::File.extname(fullname)
|
||||
format = ext.split('.').last || 'txt'
|
||||
filename = ::File.basename(fullname, ext)
|
||||
contents = ::File.read(tempfile)
|
||||
reponame = filename + '.' + format
|
||||
|
||||
head = wiki.repo.head
|
||||
|
||||
options = {
|
||||
:message => "Uploaded file to #{dir}/#{reponame}",
|
||||
:parent => wiki.repo.head.commit,
|
||||
}
|
||||
author = session['gollum.author']
|
||||
unless author.nil?
|
||||
options.merge! author
|
||||
end
|
||||
|
||||
begin
|
||||
committer = Gollum::Committer.new(wiki, options)
|
||||
committer.add_to_index(dir, filename, format, contents)
|
||||
committer.after_commit do |committer, sha|
|
||||
wiki.clear_cache
|
||||
committer.update_working_dir(dir, filename, format)
|
||||
end
|
||||
committer.commit
|
||||
redirect to(request.referer)
|
||||
rescue Gollum::DuplicatePageError => e
|
||||
@message = "Duplicate page: #{e.message}"
|
||||
mustache :error
|
||||
end
|
||||
end
|
||||
|
||||
post '/deleteFile/*' do
|
||||
forbid unless @allow_editing
|
||||
wiki = wiki_new
|
||||
filepath = params[:splat].first
|
||||
unless filepath.nil?
|
||||
commit = commit_message
|
||||
commit[:message] = "Deleted #{filepath}"
|
||||
wiki.delete_file(filepath, commit)
|
||||
end
|
||||
|
||||
redirect to('/fileview')
|
||||
end
|
||||
|
||||
post '/rename/*' do
|
||||
forbid unless @allow_editing
|
||||
|
||||
wikip = wiki_page(params[:splat].first)
|
||||
halt 500 if wikip.nil?
|
||||
wiki = wikip.wiki
|
||||
page = wiki.paged(wikip.name, wikip.path, exact = true)
|
||||
rename = params[:rename]
|
||||
halt 500 if page.nil?
|
||||
halt 500 if rename.nil? or rename.empty?
|
||||
|
||||
# Fixup the rename if it is a relative path
|
||||
# In 1.8.7 rename[0] != rename[0..0]
|
||||
if rename[0..0] != '/'
|
||||
source_dir = ::File.dirname(page.path)
|
||||
source_dir = '' if source_dir == '.'
|
||||
(target_dir, target_name) = ::File.split(rename)
|
||||
target_dir = target_dir == '' ? source_dir : "#{source_dir}/#{target_dir}"
|
||||
rename = "#{target_dir}/#{target_name}"
|
||||
end
|
||||
|
||||
committer = Gollum::Committer.new(wiki, commit_message)
|
||||
commit = { :committer => committer }
|
||||
|
||||
success = wiki.rename_page(page, rename, commit)
|
||||
if !success
|
||||
# This occurs on NOOPs, for example renaming A => A
|
||||
redirect to("/#{page.escaped_url_path}")
|
||||
return
|
||||
end
|
||||
committer.commit
|
||||
|
||||
wikip = wiki_page(rename)
|
||||
page = wiki.paged(wikip.name, wikip.path, exact = true)
|
||||
return if page.nil?
|
||||
redirect to("/#{page.escaped_url_path}")
|
||||
end
|
||||
|
||||
post '/edit/*' do
|
||||
forbid unless @allow_editing
|
||||
|
||||
path = '/' + clean_url(sanitize_empty_params(params[:path])).to_s
|
||||
page_name = CGI.unescape(params[:page])
|
||||
wiki = wiki_new
|
||||
page = wiki.paged(page_name, path, exact = true)
|
||||
return if page.nil?
|
||||
committer = Gollum::Committer.new(wiki, commit_message)
|
||||
commit = { :committer => committer }
|
||||
|
||||
update_wiki_page(wiki, page, params[:content], commit, page.name, params[:format])
|
||||
update_wiki_page(wiki, page.header, params[:header], commit) if params[:header]
|
||||
update_wiki_page(wiki, page.footer, params[:footer], commit) if params[:footer]
|
||||
update_wiki_page(wiki, page.sidebar, params[:sidebar], commit) if params[:sidebar]
|
||||
committer.commit
|
||||
|
||||
redirect to("/#{page.escaped_url_path}") unless page.nil?
|
||||
end
|
||||
|
||||
get '/delete/*' do
|
||||
forbid unless @allow_editing
|
||||
wikip = wiki_page(params[:splat].first)
|
||||
name = wikip.name
|
||||
wiki = wikip.wiki
|
||||
page = wikip.page
|
||||
unless page.nil?
|
||||
commit = commit_message
|
||||
commit[:message] = "Destroyed #{name} (#{page.format})"
|
||||
wiki.delete_page(page, commit)
|
||||
end
|
||||
|
||||
redirect to('/')
|
||||
end
|
||||
|
||||
get '/create/*' do
|
||||
forbid unless @allow_editing
|
||||
wikip = wiki_page(params[:splat].first.gsub('+', '-'))
|
||||
@name = wikip.name.to_url
|
||||
@path = wikip.path
|
||||
@allow_uploads = wikip.wiki.allow_uploads
|
||||
@upload_dest = find_upload_dest(@path)
|
||||
|
||||
page_dir = settings.wiki_options[:page_file_dir].to_s
|
||||
unless page_dir.empty?
|
||||
# --page-file-dir docs
|
||||
# /docs/Home should be created in /Home
|
||||
# not /docs/Home because write_page will append /docs
|
||||
@path = @path.sub(page_dir, '/') if @path.start_with? page_dir
|
||||
end
|
||||
@path = clean_path(@path)
|
||||
|
||||
page = wikip.page
|
||||
if page
|
||||
page_dir = settings.wiki_options[:page_file_dir].to_s
|
||||
redirect to("/#{clean_url(::File.join(page_dir, page.escaped_url_path))}")
|
||||
else
|
||||
mustache :create
|
||||
end
|
||||
end
|
||||
|
||||
post '/create' do
|
||||
forbid unless @allow_editing
|
||||
|
||||
name = params[:page].to_url
|
||||
path = sanitize_empty_params(params[:path]) || ''
|
||||
format = params[:format].intern
|
||||
wiki = wiki_new
|
||||
|
||||
path.gsub!(/^\//, '')
|
||||
|
||||
begin
|
||||
wiki.write_page(name, format, params[:content], commit_message, path)
|
||||
|
||||
page_dir = settings.wiki_options[:page_file_dir].to_s
|
||||
redirect to("/#{clean_url(::File.join(encodeURIComponent(page_dir), encodeURIComponent(path), encodeURIComponent(name)))}")
|
||||
rescue Gollum::DuplicatePageError => e
|
||||
@message = "Duplicate page: #{e.message}"
|
||||
mustache :error
|
||||
end
|
||||
end
|
||||
|
||||
post '/revert/*/:sha1/:sha2' do
|
||||
forbid unless @allow_editing
|
||||
|
||||
wikip = wiki_page(params[:splat].first)
|
||||
@path = wikip.path
|
||||
@name = wikip.name
|
||||
wiki = wikip.wiki
|
||||
@page = wiki.paged(@name, @path)
|
||||
sha1 = params[:sha1]
|
||||
sha2 = params[:sha2]
|
||||
|
||||
commit = commit_message
|
||||
commit[:message] = "Revert commit #{sha1.chars.take(7).join}"
|
||||
if wiki.revert_page(@page, sha1, sha2, commit)
|
||||
redirect to("/#{@page.escaped_url_path}")
|
||||
else
|
||||
sha2, sha1 = sha1, "#{sha1}^" if !sha2
|
||||
@versions = [sha1, sha2]
|
||||
diffs = wiki.repo.diff(@versions.first, @versions.last, @page.path)
|
||||
@diff = diffs.first
|
||||
@message = "The patch does not apply."
|
||||
mustache :compare
|
||||
end
|
||||
end
|
||||
|
||||
post '/preview' do
|
||||
forbid unless @allow_editing
|
||||
|
||||
wiki = wiki_new
|
||||
@name = params[:page] || "Preview"
|
||||
@page = wiki.preview_page(@name, params[:content], params[:format])
|
||||
@content = @page.formatted_data
|
||||
@toc_content = wiki.universal_toc ? @page.toc_data : nil
|
||||
@mathjax = wiki.mathjax
|
||||
@h1_title = wiki.h1_title
|
||||
@editable = false
|
||||
@bar_side = wiki.bar_side
|
||||
@allow_uploads = wiki.allow_uploads
|
||||
mustache :page
|
||||
end
|
||||
|
||||
get '/livepreview/' do
|
||||
wiki = wiki_new
|
||||
@mathjax = wiki.mathjax
|
||||
mustache :livepreview, { :layout => false }
|
||||
end
|
||||
|
||||
get '/history/*' do
|
||||
@page = wiki_page(params[:splat].first).page
|
||||
@page_num = [params[:page].to_i, 1].max
|
||||
unless @page.nil?
|
||||
@versions = @page.versions :page => @page_num
|
||||
mustache :history
|
||||
else
|
||||
redirect to("/")
|
||||
end
|
||||
end
|
||||
|
||||
get '/latest_changes' do
|
||||
@wiki = wiki_new
|
||||
max_count = settings.wiki_options.fetch(:latest_changes_count, 10)
|
||||
@versions = @wiki.latest_changes({:max_count => max_count})
|
||||
mustache :latest_changes
|
||||
end
|
||||
|
||||
post '/compare/*' do
|
||||
@file = encodeURIComponent(params[:splat].first)
|
||||
@versions = params[:versions] || []
|
||||
if @versions.size < 2
|
||||
redirect to("/history/#{@file}")
|
||||
else
|
||||
redirect to("/compare/%s/%s...%s" % [
|
||||
@file,
|
||||
@versions.last,
|
||||
@versions.first]
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
get %r{
|
||||
/compare/ # match any URL beginning with /compare/
|
||||
(.+) # extract the full path (including any directories)
|
||||
/ # match the final slash
|
||||
([^.]+) # match the first SHA1
|
||||
\.{2,3} # match .. or ...
|
||||
(.+) # match the second SHA1
|
||||
}x do |path, start_version, end_version|
|
||||
wikip = wiki_page(path)
|
||||
@path = wikip.path
|
||||
@name = wikip.name
|
||||
@versions = [start_version, end_version]
|
||||
wiki = wikip.wiki
|
||||
@page = wikip.page
|
||||
diffs = wiki.repo.diff(@versions.first, @versions.last, @page.path)
|
||||
@diff = diffs.first
|
||||
mustache :compare
|
||||
end
|
||||
|
||||
get %r{/(.+?)/([0-9a-f]{40})} do
|
||||
file_path = params[:captures][0]
|
||||
version = params[:captures][1]
|
||||
wikip = wiki_page(file_path, file_path, version)
|
||||
name = wikip.name
|
||||
path = wikip.path
|
||||
if page = wikip.page
|
||||
@page = page
|
||||
@name = name
|
||||
@content = page.formatted_data
|
||||
@version = version
|
||||
@bar_side = wikip.wiki.bar_side
|
||||
mustache :page
|
||||
elsif file = wikip.wiki.file("#{file_path}", version, true)
|
||||
show_file(file)
|
||||
else
|
||||
halt 404
|
||||
end
|
||||
end
|
||||
|
||||
get '/search' do
|
||||
@query = params[:q] || ''
|
||||
wiki = wiki_new
|
||||
# Sort wiki search results by count (desc) and then by name (asc)
|
||||
@results = wiki.search(@query).sort { |a, b| (a[:count] <=> b[:count]).nonzero? || b[:name] <=> a[:name] }.reverse
|
||||
@name = @query
|
||||
mustache :search
|
||||
end
|
||||
|
||||
get %r{
|
||||
/pages # match any URL beginning with /pages
|
||||
(?: # begin an optional non-capturing group
|
||||
/(.+) # capture any path after the "/pages" excluding the leading slash
|
||||
)? # end the optional non-capturing group
|
||||
}x do |path|
|
||||
@path = extract_path(path) if path
|
||||
wiki_options = settings.wiki_options.merge({ :page_file_dir => @path })
|
||||
@wiki = Gollum::Wiki.new(settings.gollum_path, wiki_options)
|
||||
@results = @wiki.pages
|
||||
@results += @wiki.files if settings.wiki_options[:show_all]
|
||||
@results = @results.sort_by { |p| p.name.downcase } # Sort Results alphabetically, fixes 922
|
||||
@ref = @wiki.ref
|
||||
mustache :pages
|
||||
end
|
||||
|
||||
get '/fileview' do
|
||||
wiki = wiki_new
|
||||
options = settings.wiki_options
|
||||
content = wiki.pages
|
||||
# if showing all files include wiki.files
|
||||
content += wiki.files if options[:show_all]
|
||||
|
||||
# must pass wiki_options to FileView
|
||||
# --show-all and --collapse-tree can be set.
|
||||
@results = Gollum::FileView.new(content, options).render_files
|
||||
@ref = wiki.ref
|
||||
mustache :file_view, { :layout => false }
|
||||
end
|
||||
|
||||
get '/*' do
|
||||
show_page_or_file(params[:splat].first)
|
||||
end
|
||||
|
||||
def show_page_or_file(fullpath)
|
||||
wiki = wiki_new
|
||||
|
||||
name = extract_name(fullpath) || wiki.index_page
|
||||
path = extract_path(fullpath) || '/'
|
||||
|
||||
if page = wiki.paged(name, path, exact = true)
|
||||
@page = page
|
||||
@name = name
|
||||
@content = page.formatted_data
|
||||
@upload_dest = find_upload_dest(path)
|
||||
|
||||
# Extensions and layout data
|
||||
@editable = true
|
||||
@page_exists = !page.last_version.nil?
|
||||
@toc_content = wiki.universal_toc ? @page.toc_data : nil
|
||||
@mathjax = wiki.mathjax
|
||||
@h1_title = wiki.h1_title
|
||||
@bar_side = wiki.bar_side
|
||||
@allow_uploads = wiki.allow_uploads
|
||||
|
||||
mustache :page
|
||||
elsif file = wiki.file(fullpath, wiki.ref, true)
|
||||
show_file(file)
|
||||
else
|
||||
not_found unless @allow_editing
|
||||
page_path = [path, name].compact.join('/')
|
||||
redirect to("/create/#{clean_url(encodeURIComponent(page_path))}")
|
||||
end
|
||||
end
|
||||
|
||||
def show_file(file)
|
||||
return unless file
|
||||
if file.on_disk?
|
||||
send_file file.on_disk_path, :disposition => 'inline'
|
||||
else
|
||||
content_type file.mime_type
|
||||
file.raw_data
|
||||
end
|
||||
end
|
||||
|
||||
def update_wiki_page(wiki, page, content, commit, name = nil, format = nil)
|
||||
return if !page ||
|
||||
((!content || page.raw_data == content) && page.format == format)
|
||||
name ||= page.name
|
||||
format = (format || page.format).to_sym
|
||||
content ||= page.raw_data
|
||||
wiki.update_page(page, name, format, content.to_s, commit)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
# Options parameter to Gollum::Committer#initialize
|
||||
# :message - The String commit message.
|
||||
# :name - The String author full name.
|
||||
# :email - The String email address.
|
||||
# message is sourced from the incoming request parameters
|
||||
# author details are sourced from the session, to be populated by rack middleware ahead of us
|
||||
def commit_message
|
||||
msg = (params[:message].nil? or params[:message].empty?) ? "[no message]" : params[:message]
|
||||
commit_message = { :message => msg }
|
||||
author_parameters = session['gollum.author']
|
||||
commit_message.merge! author_parameters unless author_parameters.nil?
|
||||
commit_message
|
||||
end
|
||||
|
||||
def find_upload_dest(path)
|
||||
settings.wiki_options[:allow_uploads] ?
|
||||
(settings.wiki_options[:per_page_uploads] ?
|
||||
"#{path}/#{@name}".sub(/^\/\//, '') : 'uploads'
|
||||
) : ''
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,91 +0,0 @@
|
||||
# ~*~ encoding: utf-8 ~*~
|
||||
module Gollum
|
||||
class BlobEntry
|
||||
# Gets the String SHA for this blob.
|
||||
attr_reader :sha
|
||||
|
||||
# Gets the full path String for this blob.
|
||||
attr_reader :path
|
||||
|
||||
# Gets the Fixnum size of this blob.
|
||||
attr_reader :size
|
||||
|
||||
def initialize(sha, path, size = nil)
|
||||
@sha = sha
|
||||
@path = path
|
||||
@size = size
|
||||
@dir = @name = @blob = nil
|
||||
end
|
||||
|
||||
# Gets the normalized directory path String for this blob.
|
||||
def dir
|
||||
@dir ||= self.class.normalize_dir(::File.dirname(@path))
|
||||
end
|
||||
|
||||
# Gets the file base name String for this blob.
|
||||
def name
|
||||
@name ||= ::File.basename(@path)
|
||||
end
|
||||
|
||||
# Gets a Grit::Blob instance for this blob.
|
||||
#
|
||||
# repo - Grit::Repo instance for the Grit::Blob.
|
||||
#
|
||||
# Returns an unbaked Grit::Blob instance.
|
||||
def blob(repo)
|
||||
@blob ||= Grit::Blob.create(repo,
|
||||
:id => @sha, :name => name, :size => @size)
|
||||
end
|
||||
|
||||
# Gets a Page instance for this blob.
|
||||
#
|
||||
# wiki - Gollum::Wiki instance for the Gollum::Page
|
||||
#
|
||||
# Returns a Gollum::Page instance.
|
||||
def page(wiki, commit)
|
||||
blob = self.blob(wiki.repo)
|
||||
page = wiki.page_class.new(wiki).populate(blob, self.dir)
|
||||
page.version = commit
|
||||
page
|
||||
end
|
||||
|
||||
# Gets a File instance for this blob.
|
||||
#
|
||||
# wiki - Gollum::Wiki instance for the Gollum::File
|
||||
#
|
||||
# Returns a Gollum::File instance.
|
||||
def file(wiki, commit)
|
||||
blob = self.blob(wiki.repo)
|
||||
file = wiki.file_class.new(wiki).populate(blob, self.dir)
|
||||
file.version = commit
|
||||
file
|
||||
end
|
||||
|
||||
def inspect
|
||||
%(#<Gollum::BlobEntry #{@sha} #{@path}>)
|
||||
end
|
||||
|
||||
# Normalizes a given directory name for searching through tree paths.
|
||||
# Ensures that a directory begins with a slash, or
|
||||
#
|
||||
# normalize_dir("") # => ""
|
||||
# normalize_dir(".") # => ""
|
||||
# normalize_dir("foo") # => "/foo"
|
||||
# normalize_dir("/foo/") # => "/foo"
|
||||
# normalize_dir("/") # => ""
|
||||
# normalize_dir("c:/") # => ""
|
||||
#
|
||||
# dir - String directory name.
|
||||
#
|
||||
# Returns a normalized String directory name, or nil if no directory
|
||||
# is given.
|
||||
def self.normalize_dir(dir)
|
||||
return '' if dir =~ /^.:\/$/
|
||||
if dir
|
||||
dir = ::File.expand_path(dir, '/')
|
||||
dir = '' if dir == '/'
|
||||
end
|
||||
dir
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,236 +0,0 @@
|
||||
# ~*~ encoding: utf-8 ~*~
|
||||
module Gollum
|
||||
# Responsible for handling the commit process for a Wiki. It sets up the
|
||||
# Git index, provides methods for modifying the tree, and stores callbacks
|
||||
# to be fired after the commit has been made. This is specifically
|
||||
# designed to handle multiple updated pages in a single commit.
|
||||
class Committer
|
||||
# Gets the instance of the Gollum::Wiki that is being updated.
|
||||
attr_reader :wiki
|
||||
|
||||
# Gets a Hash of commit options.
|
||||
attr_reader :options
|
||||
|
||||
# Initializes the Committer.
|
||||
#
|
||||
# wiki - The Gollum::Wiki instance that is being updated.
|
||||
# options - The commit Hash details:
|
||||
# :message - The String commit message.
|
||||
# :name - The String author full name.
|
||||
# :email - The String email address.
|
||||
# :parent - Optional Grit::Commit parent to this update.
|
||||
# :tree - Optional String SHA of the tree to create the
|
||||
# index from.
|
||||
# :committer - Optional Gollum::Committer instance. If provided,
|
||||
# assume that this operation is part of batch of
|
||||
# updates and the commit happens later.
|
||||
#
|
||||
# Returns the Committer instance.
|
||||
def initialize(wiki, options = {})
|
||||
@wiki = wiki
|
||||
@options = options
|
||||
@callbacks = []
|
||||
end
|
||||
|
||||
# Public: References the Git index for this commit.
|
||||
#
|
||||
# Returns a Grit::Index.
|
||||
def index
|
||||
@index ||= begin
|
||||
idx = @wiki.repo.index
|
||||
if tree = options[:tree]
|
||||
idx.read_tree(tree)
|
||||
elsif parent = parents.first
|
||||
idx.read_tree(parent.tree.id)
|
||||
end
|
||||
idx
|
||||
end
|
||||
end
|
||||
|
||||
# Public: The committer for this commit.
|
||||
#
|
||||
# Returns a Grit::Actor.
|
||||
def actor
|
||||
@actor ||= begin
|
||||
@options[:name] = @wiki.default_committer_name if @options[:name].to_s.empty?
|
||||
@options[:email] = @wiki.default_committer_email if @options[:email].to_s.empty?
|
||||
Grit::Actor.new(@options[:name], @options[:email])
|
||||
end
|
||||
end
|
||||
|
||||
# Public: The parent commits to this pending commit.
|
||||
#
|
||||
# Returns an array of Grit::Commit instances.
|
||||
def parents
|
||||
@parents ||= begin
|
||||
arr = [@options[:parent] || @wiki.repo.commit(@wiki.ref)]
|
||||
arr.flatten!
|
||||
arr.compact!
|
||||
arr
|
||||
end
|
||||
end
|
||||
|
||||
# Adds a page to the given Index.
|
||||
#
|
||||
# dir - The String subdirectory of the Gollum::Page without any
|
||||
# prefix or suffix slashes (e.g. "foo/bar").
|
||||
# name - The String Gollum::Page filename_stripped.
|
||||
# format - The Symbol Gollum::Page format.
|
||||
# data - The String wiki data to store in the tree map.
|
||||
# allow_same_ext - A Boolean determining if the tree map allows the same
|
||||
# filename with the same extension.
|
||||
#
|
||||
# Raises Gollum::DuplicatePageError if a matching filename already exists.
|
||||
# This way, pages are not inadvertently overwritten.
|
||||
#
|
||||
# Returns nothing (modifies the Index in place).
|
||||
def add_to_index(dir, name, format, data, allow_same_ext = false)
|
||||
# spaces must be dashes
|
||||
dir.gsub!(' ', '-')
|
||||
name.gsub!(' ', '-')
|
||||
|
||||
path = @wiki.page_file_name(name, format)
|
||||
|
||||
dir = '/' if dir.strip.empty?
|
||||
|
||||
fullpath = ::File.join(*[@wiki.page_file_dir, dir, path].compact)
|
||||
fullpath = fullpath[1..-1] if fullpath =~ /^\//
|
||||
|
||||
if index.current_tree && tree = index.current_tree / (@wiki.page_file_dir || '/')
|
||||
tree = tree / dir unless tree.nil?
|
||||
end
|
||||
|
||||
if tree
|
||||
downpath = path.downcase.sub(/\.\w+$/, '')
|
||||
|
||||
tree.blobs.each do |blob|
|
||||
next if page_path_scheduled_for_deletion?(index.tree, fullpath)
|
||||
|
||||
existing_file = blob.name.downcase.sub(/\.\w+$/, '')
|
||||
existing_file_ext = ::File.extname(blob.name).sub(/^\./, '')
|
||||
|
||||
new_file_ext = ::File.extname(path).sub(/^\./, '')
|
||||
|
||||
if downpath == existing_file && !(allow_same_ext && new_file_ext == existing_file_ext)
|
||||
raise DuplicatePageError.new(dir, blob.name, path)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
fullpath = fullpath.force_encoding('ascii-8bit') if fullpath.respond_to?(:force_encoding)
|
||||
|
||||
index.add(fullpath, @wiki.normalize(data))
|
||||
end
|
||||
|
||||
# Update the given file in the repository's working directory if there
|
||||
# is a working directory present.
|
||||
#
|
||||
# dir - The String directory in which the file lives.
|
||||
# name - The String name of the page or the stripped filename
|
||||
# (should be pre-canonicalized if required).
|
||||
# format - The Symbol format of the page.
|
||||
#
|
||||
# Returns nothing.
|
||||
def update_working_dir(dir, name, format)
|
||||
unless @wiki.repo.bare
|
||||
if @wiki.page_file_dir
|
||||
dir = dir.size.zero? ? @wiki.page_file_dir : ::File.join(dir, @wiki.page_file_dir)
|
||||
end
|
||||
|
||||
path =
|
||||
if dir == ''
|
||||
@wiki.page_file_name(name, format)
|
||||
else
|
||||
::File.join(dir, @wiki.page_file_name(name, format))
|
||||
end
|
||||
|
||||
path = path.force_encoding('ascii-8bit') if path.respond_to?(:force_encoding)
|
||||
|
||||
Dir.chdir(::File.join(@wiki.repo.path, '..')) do
|
||||
if file_path_scheduled_for_deletion?(index.tree, path)
|
||||
@wiki.repo.git.rm({'f' => true}, '--', path)
|
||||
else
|
||||
@wiki.repo.git.checkout({}, 'HEAD', '--', path)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Writes the commit to Git and runs the after_commit callbacks.
|
||||
#
|
||||
# Returns the String SHA1 of the new commit.
|
||||
def commit
|
||||
sha1 = index.commit(@options[:message], parents, actor, nil, @wiki.ref)
|
||||
@callbacks.each do |cb|
|
||||
cb.call(self, sha1)
|
||||
end
|
||||
sha1
|
||||
end
|
||||
|
||||
# Adds a callback to be fired after a commit.
|
||||
#
|
||||
# block - A block that expects this Committer instance and the created
|
||||
# commit's SHA1 as the arguments.
|
||||
#
|
||||
# Returns nothing.
|
||||
def after_commit(&block)
|
||||
@callbacks << block
|
||||
end
|
||||
|
||||
# Determine if a given page (regardless of format) is scheduled to be
|
||||
# deleted in the next commit for the given Index.
|
||||
#
|
||||
# map - The Hash map:
|
||||
# key - The String directory or filename.
|
||||
# val - The Hash submap or the String contents of the file.
|
||||
# path - The String path of the page file. This may include the format
|
||||
# extension in which case it will be ignored.
|
||||
#
|
||||
# Returns the Boolean response.
|
||||
def page_path_scheduled_for_deletion?(map, path)
|
||||
parts = path.split('/')
|
||||
if parts.size == 1
|
||||
deletions = map.keys.select { |k| !map[k] }
|
||||
downfile = parts.first.downcase.sub(/\.\w+$/, '')
|
||||
deletions.any? { |d| d.downcase.sub(/\.\w+$/, '') == downfile }
|
||||
else
|
||||
part = parts.shift
|
||||
if rest = map[part]
|
||||
page_path_scheduled_for_deletion?(rest, parts.join('/'))
|
||||
else
|
||||
false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Determine if a given file is scheduled to be deleted in the next commit
|
||||
# for the given Index.
|
||||
#
|
||||
# map - The Hash map:
|
||||
# key - The String directory or filename.
|
||||
# val - The Hash submap or the String contents of the file.
|
||||
# path - The String path of the file including extension.
|
||||
#
|
||||
# Returns the Boolean response.
|
||||
def file_path_scheduled_for_deletion?(map, path)
|
||||
parts = path.split('/')
|
||||
if parts.size == 1
|
||||
deletions = map.keys.select { |k| !map[k] }
|
||||
deletions.any? { |d| d == parts.first }
|
||||
else
|
||||
part = parts.shift
|
||||
if rest = map[part]
|
||||
file_path_scheduled_for_deletion?(rest, parts.join('/'))
|
||||
else
|
||||
false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Proxies methods t
|
||||
def method_missing(name, *args)
|
||||
args.map! { |item| item.respond_to?(:force_encoding) ? item.force_encoding('ascii-8bit') : item }
|
||||
index.send(name, *args)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,94 +0,0 @@
|
||||
# ~*~ encoding: utf-8 ~*~
|
||||
module Gollum
|
||||
class File
|
||||
Wiki.file_class = self
|
||||
|
||||
# Public: Initialize a file.
|
||||
#
|
||||
# wiki - The Gollum::Wiki in question.
|
||||
#
|
||||
# Returns a newly initialized Gollum::File.
|
||||
def initialize(wiki)
|
||||
@wiki = wiki
|
||||
@blob = nil
|
||||
@path = nil
|
||||
end
|
||||
|
||||
# Public: The url path required to reach this page within the repo.
|
||||
#
|
||||
# Returns the String url_path
|
||||
def url_path
|
||||
path = self.path
|
||||
path = path.sub(/\/[^\/]+$/, '/') if path.include?('/')
|
||||
path
|
||||
end
|
||||
|
||||
# Public: The url_path, but CGI escaped.
|
||||
#
|
||||
# Returns the String url_path
|
||||
def escaped_url_path
|
||||
CGI.escape(self.url_path).gsub('%2F','/')
|
||||
end
|
||||
|
||||
# Public: The on-disk filename of the file.
|
||||
#
|
||||
# Returns the String name.
|
||||
def name
|
||||
@blob && @blob.name
|
||||
end
|
||||
alias filename name
|
||||
|
||||
# Public: The raw contents of the page.
|
||||
#
|
||||
# Returns the String data.
|
||||
def raw_data
|
||||
@blob && @blob.data
|
||||
end
|
||||
|
||||
# Public: The Grit::Commit version of the file.
|
||||
attr_accessor :version
|
||||
|
||||
# Public: The String path of the file.
|
||||
attr_reader :path
|
||||
|
||||
# Public: The String mime type of the file.
|
||||
def mime_type
|
||||
@blob.mime_type
|
||||
end
|
||||
|
||||
# Populate the File with information from the Blob.
|
||||
#
|
||||
# blob - The Grit::Blob that contains the info.
|
||||
# path - The String directory path of the file.
|
||||
#
|
||||
# Returns the populated Gollum::File.
|
||||
def populate(blob, path=nil)
|
||||
@blob = blob
|
||||
@path = "#{path}/#{blob.name}"[1..-1]
|
||||
self
|
||||
end
|
||||
|
||||
#########################################################################
|
||||
#
|
||||
# Internal Methods
|
||||
#
|
||||
#########################################################################
|
||||
|
||||
# Find a file in the given Gollum repo.
|
||||
#
|
||||
# name - The full String path.
|
||||
# version - The String version ID to find.
|
||||
#
|
||||
# Returns a Gollum::File or nil if the file could not be found.
|
||||
def find(name, version)
|
||||
checked = name.downcase
|
||||
map = @wiki.tree_map_for(version)
|
||||
if entry = map.detect { |entry| entry.path.downcase == checked }
|
||||
@path = name
|
||||
@blob = entry.blob(@wiki.repo)
|
||||
@version = version.is_a?(Grit::Commit) ? version : @wiki.commit_for(version)
|
||||
self
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,155 +0,0 @@
|
||||
# ~*~ encoding: utf-8 ~*~
|
||||
module Gollum
|
||||
=begin
|
||||
FileView requires that:
|
||||
- All files in root dir are processed first
|
||||
- Then all the folders are sorted and processed
|
||||
=end
|
||||
class FileView
|
||||
# common use cases:
|
||||
# set pages to wiki.pages and show_all to false
|
||||
# set pages to wiki.pages + wiki.files and show_all to true
|
||||
def initialize pages, options = {}
|
||||
@pages = pages
|
||||
@show_all = options[:show_all] || false
|
||||
@checked = options[:collapse_tree] ? '' : "checked"
|
||||
end
|
||||
|
||||
def enclose_tree string
|
||||
%Q(<ol class="tree">\n) + string + %Q(</ol>)
|
||||
end
|
||||
|
||||
def new_page page
|
||||
name = page.name
|
||||
url = url_for_page page
|
||||
%Q( <li class="file"><a href="#{url}"><span class="icon"></span>#{name}</a></li>)
|
||||
end
|
||||
|
||||
def new_folder folder_path
|
||||
new_sub_folder folder_path
|
||||
end
|
||||
|
||||
def new_sub_folder path
|
||||
<<-HTML
|
||||
<li>
|
||||
<label>#{path}</label> <input type="checkbox" #{@checked} />
|
||||
<ol>
|
||||
HTML
|
||||
end
|
||||
|
||||
def end_folder
|
||||
"</ol></li>\n"
|
||||
end
|
||||
|
||||
def url_for_page page
|
||||
url = ''
|
||||
if @show_all
|
||||
# Remove ext for valid pages.
|
||||
filename = page.filename
|
||||
filename = Page::valid_page_name?(filename) ? filename.chomp(::File.extname(filename)) : filename
|
||||
|
||||
url = ::File.join(::File.dirname(page.path), filename)
|
||||
else
|
||||
url = ::File.join(::File.dirname(page.path), page.filename_stripped)
|
||||
end
|
||||
url = url[2..-1] if url[0,2] == './'
|
||||
url
|
||||
end
|
||||
|
||||
def render_files
|
||||
html = ''
|
||||
count = @pages.size
|
||||
folder_start = -1
|
||||
|
||||
# Process all pages until folders start
|
||||
count.times do | index |
|
||||
page = @pages[ index ]
|
||||
path = page.path
|
||||
|
||||
unless path.include? '/'
|
||||
# Page processed (not contained in a folder)
|
||||
html += new_page page
|
||||
else
|
||||
# Folders start at the next index
|
||||
folder_start = index
|
||||
break # Pages finished, move on to folders
|
||||
end
|
||||
end
|
||||
|
||||
# If there are no folders, then we're done.
|
||||
return enclose_tree(html) if folder_start <= -1
|
||||
|
||||
# Handle special case of only one folder.
|
||||
if (count - folder_start == 1)
|
||||
page = @pages[ folder_start ]
|
||||
html += <<-HTML
|
||||
<li>
|
||||
<label>#{::File.dirname(page.path)}</label> <input type="checkbox" #{@checked} />
|
||||
<ol>
|
||||
#{new_page page}
|
||||
</ol>
|
||||
</li>
|
||||
HTML
|
||||
|
||||
return enclose_tree html
|
||||
end
|
||||
|
||||
sorted_folders = []
|
||||
(folder_start).upto count - 1 do | index |
|
||||
sorted_folders += [[ @pages[ index ].path, index ]]
|
||||
end
|
||||
|
||||
# http://stackoverflow.com/questions/3482814/sorting-list-of-string-paths-in-vb-net
|
||||
sorted_folders.sort! do |first,second|
|
||||
a = first[0]
|
||||
b = second[0]
|
||||
|
||||
# use :: operator because gollum defines its own conflicting File class
|
||||
dir_compare = ::File.dirname(a) <=> ::File.dirname(b)
|
||||
|
||||
# Sort based on directory name unless they're equal (0) in
|
||||
# which case sort based on file name.
|
||||
if dir_compare == 0
|
||||
::File.basename(a) <=> ::File.basename(b)
|
||||
else
|
||||
dir_compare
|
||||
end
|
||||
end
|
||||
|
||||
# keep track of folder depth, 0 = at root.
|
||||
cwd_array = []
|
||||
changed = false
|
||||
|
||||
# process rest of folders
|
||||
(0...sorted_folders.size).each do | index |
|
||||
page = @pages[ sorted_folders[ index ][ 1 ] ]
|
||||
path = page.path
|
||||
folder = ::File.dirname path
|
||||
|
||||
tmp_array = folder.split '/'
|
||||
|
||||
(0...tmp_array.size).each do | index |
|
||||
if cwd_array[ index ].nil? || changed
|
||||
html += new_sub_folder tmp_array[ index ]
|
||||
next
|
||||
end
|
||||
|
||||
if cwd_array[ index ] != tmp_array[ index ]
|
||||
changed = true
|
||||
(cwd_array.size - index).times do
|
||||
html += end_folder
|
||||
end
|
||||
html += new_sub_folder tmp_array[ index ]
|
||||
end
|
||||
end
|
||||
|
||||
html += new_page page
|
||||
cwd_array = tmp_array
|
||||
changed = false
|
||||
end
|
||||
|
||||
# return the completed html
|
||||
enclose_tree html
|
||||
end # end render_files
|
||||
end # end FileView class
|
||||
end # end Gollum module
|
||||
@@ -1,388 +0,0 @@
|
||||
# ~*~ encoding: utf-8 ~*~
|
||||
require 'cgi'
|
||||
require 'sinatra'
|
||||
require 'gollum'
|
||||
require 'mustache/sinatra'
|
||||
require 'useragent'
|
||||
require 'stringex'
|
||||
|
||||
require 'gollum/frontend/views/layout'
|
||||
require 'gollum/frontend/views/editable'
|
||||
require 'gollum/frontend/views/has_page'
|
||||
|
||||
require File.expand_path '../helpers', __FILE__
|
||||
|
||||
# Fix to_url
|
||||
class String
|
||||
alias :upstream_to_url :to_url
|
||||
# _Header => header which causes errors
|
||||
def to_url
|
||||
return nil if self.nil?
|
||||
upstream_to_url :exclude => ['_Header', '_Footer', '_Sidebar']
|
||||
end
|
||||
end
|
||||
|
||||
# Run the frontend, based on Sinatra
|
||||
#
|
||||
# There are a number of wiki options that can be set for the frontend
|
||||
#
|
||||
# Example
|
||||
# require 'gollum/frontend/app'
|
||||
# Precious::App.set(:wiki_options, {
|
||||
# :universal_toc => false,
|
||||
# }
|
||||
#
|
||||
# See the wiki.rb file for more details on wiki options
|
||||
module Precious
|
||||
class App < Sinatra::Base
|
||||
register Mustache::Sinatra
|
||||
include Precious::Helpers
|
||||
|
||||
dir = File.dirname(File.expand_path(__FILE__))
|
||||
|
||||
# Detect unsupported browsers.
|
||||
Browser = Struct.new(:browser, :version)
|
||||
|
||||
@@min_ua = [
|
||||
Browser.new('Internet Explorer', '10.0'),
|
||||
Browser.new('Chrome', '7.0'),
|
||||
Browser.new('Firefox', '4.0'),
|
||||
]
|
||||
|
||||
def supported_useragent?(user_agent)
|
||||
ua = UserAgent.parse(user_agent)
|
||||
@@min_ua.detect {|min| ua >= min }
|
||||
end
|
||||
|
||||
# We want to serve public assets for now
|
||||
set :public_folder, "#{dir}/public/gollum"
|
||||
set :static, true
|
||||
set :default_markup, :markdown
|
||||
|
||||
set :mustache, {
|
||||
# Tell mustache where the Views constant lives
|
||||
:namespace => Precious,
|
||||
|
||||
# Mustache templates live here
|
||||
:templates => "#{dir}/templates",
|
||||
|
||||
# Tell mustache where the views are
|
||||
:views => "#{dir}/views"
|
||||
}
|
||||
|
||||
# Sinatra error handling
|
||||
configure :development, :staging do
|
||||
enable :show_exceptions, :dump_errors
|
||||
disable :raise_errors, :clean_trace
|
||||
end
|
||||
|
||||
configure :test do
|
||||
enable :logging, :raise_errors, :dump_errors
|
||||
end
|
||||
|
||||
before do
|
||||
@base_url = url('/', false).chomp('/')
|
||||
# above will detect base_path when it's used with map in a config.ru
|
||||
settings.wiki_options.merge!({ :base_path => @base_url })
|
||||
@css = settings.wiki_options[:css]
|
||||
end
|
||||
|
||||
get '/' do
|
||||
redirect ::File.join(@base_url, 'Home')
|
||||
end
|
||||
|
||||
# path is set to name if path is nil.
|
||||
# if path is 'a/b' and a and b are dirs, then
|
||||
# path must have a trailing slash 'a/b/' or
|
||||
# extract_path will trim path to 'a'
|
||||
# name, path, version
|
||||
def wiki_page(name, path = nil, version = nil, exact = true)
|
||||
path = name if path.nil?
|
||||
name = extract_name(name)
|
||||
path = extract_path(path)
|
||||
path = '/' if exact && path.nil?
|
||||
|
||||
wiki = wiki_new
|
||||
|
||||
OpenStruct.new(:wiki => wiki, :page => wiki.paged(name, path, exact, version),
|
||||
:name => name, :path => path)
|
||||
end
|
||||
|
||||
def wiki_new
|
||||
Gollum::Wiki.new(settings.gollum_path, settings.wiki_options)
|
||||
end
|
||||
|
||||
get '/data/*' do
|
||||
if page = wiki_page(params[:splat].first).page
|
||||
page.raw_data
|
||||
end
|
||||
end
|
||||
|
||||
get '/edit/*' do
|
||||
wikip = wiki_page(params[:splat].first)
|
||||
@name = wikip.name
|
||||
@path = wikip.path
|
||||
wiki = wikip.wiki
|
||||
if page = wikip.page
|
||||
if wiki.live_preview && page.format.to_s.include?('markdown') && supported_useragent?(request.user_agent)
|
||||
live_preview_url = '/livepreview/index.html?page=' + encodeURIComponent(@name)
|
||||
if @path
|
||||
live_preview_url << '&path=' + encodeURIComponent(@path)
|
||||
end
|
||||
redirect to(live_preview_url)
|
||||
else
|
||||
@page = page
|
||||
@page.version = wiki.repo.log(wiki.ref, @page.path).first
|
||||
raw_data = page.raw_data
|
||||
@content = raw_data.respond_to?(:force_encoding) ? raw_data.force_encoding('UTF-8') : raw_data
|
||||
mustache :edit
|
||||
end
|
||||
else
|
||||
redirect to("/create/#{encodeURIComponent(@name)}")
|
||||
end
|
||||
end
|
||||
|
||||
post '/edit/*' do
|
||||
path = '/' + clean_url(sanitize_empty_params(params[:path])).to_s
|
||||
page_name = CGI.unescape(params[:page])
|
||||
wiki = wiki_new
|
||||
page = wiki.paged(page_name, path, exact = true)
|
||||
return if page.nil?
|
||||
rename = params[:rename].to_url if params[:rename]
|
||||
name = rename || page.name
|
||||
committer = Gollum::Committer.new(wiki, commit_message)
|
||||
commit = {:committer => committer}
|
||||
|
||||
update_wiki_page(wiki, page, params[:content], commit, name, params[:format])
|
||||
update_wiki_page(wiki, page.header, params[:header], commit) if params[:header]
|
||||
update_wiki_page(wiki, page.footer, params[:footer], commit) if params[:footer]
|
||||
update_wiki_page(wiki, page.sidebar, params[:sidebar], commit) if params[:sidebar]
|
||||
committer.commit
|
||||
|
||||
page = wiki.page(rename) if rename
|
||||
|
||||
redirect to("/#{page.escaped_url_path}") unless page.nil?
|
||||
end
|
||||
|
||||
get '/delete/*' do
|
||||
wikip = wiki_page(params[:splat].first)
|
||||
name = wikip.name
|
||||
wiki = wikip.wiki
|
||||
page = wikip.page
|
||||
wiki.delete_page(page, { :message => "Destroyed #{name} (#{page.format})" })
|
||||
|
||||
redirect to('/')
|
||||
end
|
||||
|
||||
get '/create/*' do
|
||||
wikip = wiki_page(params[:splat].first.gsub('+', '-'))
|
||||
@name = wikip.name.to_url
|
||||
@path = wikip.path
|
||||
|
||||
page = wikip.page
|
||||
if page
|
||||
page_dir = settings.wiki_options[:page_file_dir].to_s
|
||||
redirect to("/#{clean_url(::File.join(page_dir, page.escaped_url_path))}")
|
||||
else
|
||||
mustache :create
|
||||
end
|
||||
end
|
||||
|
||||
post '/create' do
|
||||
name = params[:page].to_url
|
||||
path = sanitize_empty_params(params[:path]) || ''
|
||||
format = params[:format].intern
|
||||
wiki = wiki_new
|
||||
|
||||
begin
|
||||
wiki.write_page(name, format, params[:content], commit_message, path)
|
||||
|
||||
page_dir = settings.wiki_options[:page_file_dir].to_s
|
||||
redirect to("/#{clean_url(::File.join(page_dir, path, name))}")
|
||||
rescue Gollum::DuplicatePageError => e
|
||||
@message = "Duplicate page: #{e.message}"
|
||||
mustache :error
|
||||
end
|
||||
end
|
||||
|
||||
post '/revert/:page/*' do
|
||||
wikip = wiki_page(params[:page])
|
||||
@path = wikip.path
|
||||
@name = wikip.name
|
||||
wiki = wikip.wiki
|
||||
@page = wiki.paged(@name,@path)
|
||||
shas = params[:splat].first.split("/")
|
||||
sha1 = shas.shift
|
||||
sha2 = shas.shift
|
||||
|
||||
if wiki.revert_page(@page, sha1, sha2, commit_message)
|
||||
redirect to("/#{@page.escaped_url_path}")
|
||||
else
|
||||
sha2, sha1 = sha1, "#{sha1}^" if !sha2
|
||||
@versions = [sha1, sha2]
|
||||
diffs = wiki.repo.diff(@versions.first, @versions.last, @page.path)
|
||||
@diff = diffs.first
|
||||
@message = "The patch does not apply."
|
||||
mustache :compare
|
||||
end
|
||||
end
|
||||
|
||||
post '/preview' do
|
||||
wiki = wiki_new
|
||||
@name = params[:page] || "Preview"
|
||||
@page = wiki.preview_page(@name, params[:content], params[:format])
|
||||
@content = @page.formatted_data
|
||||
@toc_content = wiki.universal_toc ? @page.toc_data : nil
|
||||
@mathjax = wiki.mathjax
|
||||
@h1_title = wiki.h1_title
|
||||
@editable = false
|
||||
mustache :page
|
||||
end
|
||||
|
||||
get '/history/*' do
|
||||
@page = wiki_page(params[:splat].first).page
|
||||
@page_num = [params[:page].to_i, 1].max
|
||||
@versions = @page.versions :page => @page_num
|
||||
mustache :history
|
||||
end
|
||||
|
||||
post '/compare/*' do
|
||||
@file = params[:splat].first
|
||||
@versions = params[:versions] || []
|
||||
if @versions.size < 2
|
||||
redirect to("/history/#{@file}")
|
||||
else
|
||||
redirect to("/compare/%s/%s...%s" % [
|
||||
@file,
|
||||
@versions.last,
|
||||
@versions.first]
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
get %r{
|
||||
/compare/ # match any URL beginning with /compare/
|
||||
(.+) # extract the full path (including any directories)
|
||||
/ # match the final slash
|
||||
([^.]+) # match the first SHA1
|
||||
\.{2,3} # match .. or ...
|
||||
(.+) # match the second SHA1
|
||||
}x do |path, start_version, end_version|
|
||||
wikip = wiki_page(path)
|
||||
@path = wikip.path
|
||||
@name = wikip.name
|
||||
@versions = [start_version, end_version]
|
||||
wiki = wikip.wiki
|
||||
@page = wikip.page
|
||||
diffs = wiki.repo.diff(@versions.first, @versions.last, @page.path)
|
||||
@diff = diffs.first
|
||||
mustache :compare
|
||||
end
|
||||
|
||||
get %r{/(.+?)/([0-9a-f]{40})} do
|
||||
file_path = params[:captures][0]
|
||||
version = params[:captures][1]
|
||||
wikip = wiki_page(file_path, file_path, version)
|
||||
name = wikip.name
|
||||
path = wikip.path
|
||||
if page = wikip.page
|
||||
@page = page
|
||||
@name = name
|
||||
@content = page.formatted_data
|
||||
@editable = true
|
||||
mustache :page
|
||||
else
|
||||
halt 404
|
||||
end
|
||||
end
|
||||
|
||||
get '/search' do
|
||||
@query = params[:q]
|
||||
wiki = wiki_new
|
||||
# Sort wiki search results by count (desc) and then by name (asc)
|
||||
@results = wiki.search(@query).sort{ |a, b| (a[:count] <=> b[:count]).nonzero? || b[:name] <=> a[:name] }.reverse
|
||||
@name = @query
|
||||
mustache :search
|
||||
end
|
||||
|
||||
get %r{
|
||||
/pages # match any URL beginning with /pages
|
||||
(?: # begin an optional non-capturing group
|
||||
/(.+) # capture any path after the "/pages" excluding the leading slash
|
||||
)? # end the optional non-capturing group
|
||||
}x do |path|
|
||||
@path = extract_path(path) if path
|
||||
wiki_options = settings.wiki_options.merge({ :page_file_dir => @path })
|
||||
wiki = Gollum::Wiki.new(settings.gollum_path, wiki_options)
|
||||
@results = wiki.pages
|
||||
@results += wiki.files if settings.wiki_options[:show_all]
|
||||
@ref = wiki.ref
|
||||
mustache :pages
|
||||
end
|
||||
|
||||
get '/fileview' do
|
||||
wiki = wiki_new
|
||||
options = settings.wiki_options
|
||||
content = wiki.pages
|
||||
# if showing all files include wiki.files
|
||||
content += wiki.files if options[:show_all]
|
||||
|
||||
# must pass wiki_options to FileView
|
||||
# --show-all and --collapse-tree can be set.
|
||||
@results = Gollum::FileView.new(content, options).render_files
|
||||
@ref = wiki.ref
|
||||
mustache :file_view, { :layout => false }
|
||||
end
|
||||
|
||||
get '/*' do
|
||||
show_page_or_file(params[:splat].first)
|
||||
end
|
||||
|
||||
def show_page_or_file(fullpath)
|
||||
name = extract_name(fullpath)
|
||||
path = extract_path(fullpath) || '/'
|
||||
wiki = wiki_new
|
||||
|
||||
if page = wiki.paged(name, path, exact = true)
|
||||
@page = page
|
||||
@name = name
|
||||
@editable = true
|
||||
@content = page.formatted_data
|
||||
@toc_content = wiki.universal_toc ? @page.toc_data : nil
|
||||
@mathjax = wiki.mathjax
|
||||
@h1_title = wiki.h1_title
|
||||
mustache :page
|
||||
elsif file = wiki.file(fullpath)
|
||||
content_type file.mime_type
|
||||
file.raw_data
|
||||
else
|
||||
page_path = [path, name].compact.join('/')
|
||||
redirect to("/create/#{clean_url(encodeURIComponent(page_path))}")
|
||||
end
|
||||
end
|
||||
|
||||
def update_wiki_page(wiki, page, content, commit, name = nil, format = nil)
|
||||
return if !page ||
|
||||
((!content || page.raw_data == content) && page.format == format)
|
||||
name ||= page.name
|
||||
format = (format || page.format).to_sym
|
||||
content ||= page.raw_data
|
||||
wiki.update_page(page, name, format, content.to_s, commit)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
# Options parameter to Gollum::Committer#initialize
|
||||
# :message - The String commit message.
|
||||
# :name - The String author full name.
|
||||
# :email - The String email address.
|
||||
# message is sourced from the incoming request parameters
|
||||
# author details are sourced from the session, to be populated by rack middleware ahead of us
|
||||
def commit_message
|
||||
commit_message = { :message => params[:message] }
|
||||
author_parameters = session['gollum.author']
|
||||
commit_message.merge! author_parameters unless author_parameters.nil?
|
||||
commit_message
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,36 +0,0 @@
|
||||
# ~*~ encoding: utf-8 ~*~
|
||||
module Precious
|
||||
module Helpers
|
||||
# Extract the path string that Gollum::Wiki expects
|
||||
def extract_path(file_path)
|
||||
return nil if file_path.nil?
|
||||
last_slash = file_path.rindex("/")
|
||||
if last_slash
|
||||
file_path[0, last_slash]
|
||||
end
|
||||
end
|
||||
|
||||
# Extract the 'page' name from the file_path
|
||||
def extract_name(file_path)
|
||||
::File.basename(file_path)
|
||||
end
|
||||
|
||||
def sanitize_empty_params(param)
|
||||
[nil,''].include?(param) ? nil : CGI.unescape(param)
|
||||
end
|
||||
|
||||
# Remove all slashes from the start of string.
|
||||
# Remove all double slashes
|
||||
def clean_url url
|
||||
return url if url.nil?
|
||||
url.gsub('%2F','/').gsub(/^\/+/,'').gsub('//','/')
|
||||
end
|
||||
|
||||
def trim_leading_slash url
|
||||
return url if url.nil?
|
||||
url.gsub!('%2F','/')
|
||||
return '/' + url.gsub(/^\/+/,'') if url[0,1] == '/'
|
||||
url
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,368 +0,0 @@
|
||||
.ace_editor {
|
||||
position: absolute;
|
||||
overflow: hidden;
|
||||
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.ace_scroller {
|
||||
position: absolute;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.ace_content {
|
||||
position: absolute;
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
cursor: text;
|
||||
}
|
||||
|
||||
.ace_gutter {
|
||||
position: absolute;
|
||||
overflow : hidden;
|
||||
height: 100%;
|
||||
width: auto;
|
||||
cursor: default;
|
||||
z-index: 4;
|
||||
}
|
||||
|
||||
.ace_gutter-active-line {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.ace_scroller.ace_scroll-left {
|
||||
box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;
|
||||
}
|
||||
|
||||
.ace_gutter-cell {
|
||||
padding-left: 19px;
|
||||
padding-right: 6px;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.ace_gutter-cell.ace_error {
|
||||
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QUM2OEZDQTQ4RTU0MTFFMUEzM0VFRTM2RUY1M0RBMjYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QUM2OEZDQTU4RTU0MTFFMUEzM0VFRTM2RUY1M0RBMjYiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpBQzY4RkNBMjhFNTQxMUUxQTMzRUVFMzZFRjUzREEyNiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpBQzY4RkNBMzhFNTQxMUUxQTMzRUVFMzZFRjUzREEyNiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PkgXxbAAAAJbSURBVHjapFNNaBNBFH4zs5vdZLP5sQmNpT82QY209heh1ioWisaDRcSKF0WKJ0GQnrzrxasHsR6EnlrwD0TagxJabaVEpFYxLWlLSS822tr87m66ccfd2GKyVhA6MMybgfe97/vmPUQphd0sZjto9XIn9OOsvlu2nkqRzVU+6vvlzPf8W6bk8dxQ0NPbxAALgCgg2JkaQuhzQau/El0zbmUA7U0Es8v2CiYmKQJHGO1QICCLoqilMhkmurDAyapKgqItezi/USRdJqEYY4D5jCy03ht2yMkkvL91jTTX10qzyyu2hruPRN7jgbH+EOsXcMLgYiThEgAMhABW85oqy1DXdRIdvP1AHJ2acQXvDIrVHcdQNrEKNYSVMSZGMjEzIIAwDXIo+6G/FxcGnzkC3T2oMhLjre49sBB+RRcHLqdafK6sYdE/GGBwU1VpFNj0aN8pJbe+BkZyevUrvLl6Xmm0W9IuTc0DxrDNAJd5oEvI/KRsNC3bQyNjPO9yQ1YHcfj2QvfQc/5TUhJTBc2iM0U7AWDQtc1nJHvD/cfO2s7jaGkiTEfa/Ep8coLu7zmNmh8+dc5lZDuUeFAGUNA/OY6JVaypQ0vjr7XYjUvJM37vt+j1vuTK5DgVfVUoTjVe+y3/LxMxY2GgU+CSLy4cpfsYorRXuXIOi0Vt40h67uZFTdIo6nLaZcwUJWAzwNS0tBnqqKzQDnjdG/iPyZxo46HaKUpbvYkj8qYRTZsBhge+JHhZyh0x9b95JqjVJkT084kZIPwu/mPWqPgfQ5jXh2+92Ay7HedfAgwA6KDWafb4w3cAAAAASUVORK5CYII=");
|
||||
background-repeat: no-repeat;
|
||||
background-position: 2px center;
|
||||
}
|
||||
|
||||
.ace_gutter-cell.ace_warning {
|
||||
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QUM2OEZDQTg4RTU0MTFFMUEzM0VFRTM2RUY1M0RBMjYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QUM2OEZDQTk4RTU0MTFFMUEzM0VFRTM2RUY1M0RBMjYiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpBQzY4RkNBNjhFNTQxMUUxQTMzRUVFMzZFRjUzREEyNiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpBQzY4RkNBNzhFNTQxMUUxQTMzRUVFMzZFRjUzREEyNiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pgd7PfIAAAGmSURBVHjaYvr//z8DJZiJgUIANoCRkREb9gLiSVAaQx4OQM7AAkwd7XU2/v++/rOttdYGEB9dASEvOMydGKfH8Gv/p4XTkvRBfLxeQAP+1cUhXopyvzhP7P/IoSj7g7Mw09cNKO6J1QQ0L4gICPIv/veg/8W+JdFvQNLHVsW9/nmn9zk7B+cCkDwhL7gt6knSZnx9/LuCEOcvkIAMP+cvto9nfqyZmmUAksfnBUtbM60gX/3/kgyv3/xSFOL5DZT+L8vP+Yfh5cvfPvp/xUHyQHXGyAYwgpwBjZYFT3Y1OEl/OfCH4ffv3wzc4iwMvNIsDJ+f/mH4+vIPAxsb631WW0Yln6ZpQLXdMK/DXGDflh+sIv37EivD5x//Gb7+YWT4y86sl7BCCkSD+Z++/1dkvsFRl+HnD1Rvje4F8whjMXmGj58YGf5zsDMwcnAwfPvKcml62DsQDeaDxN+/Y0qwlpEHqrdB94IRNIDUgfgfKJChGK4OikEW3gTiXUB950ASLFAF54AC94A0G9QAfOnmF9DCDzABFqS08IHYDIScdijOjQABBgC+/9awBH96jwAAAABJRU5ErkJggg==");
|
||||
background-position: 2px center;
|
||||
}
|
||||
|
||||
.ace_gutter-cell.ace_info {
|
||||
background-image: url("data:image/gif;base64,R0lGODlhEAAQAMQAAAAAAEFBQVJSUl5eXmRkZGtra39/f4WFhYmJiZGRkaampry8vMPDw8zMzNXV1dzc3OTk5Orq6vDw8P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABQALAAAAAAQABAAAAUuICWOZGmeaBml5XGwFCQSBGyXRSAwtqQIiRuiwIM5BoYVbEFIyGCQoeJGrVptIQA7");
|
||||
background-position: 2px center;
|
||||
}
|
||||
.ace_dark .ace_gutter-cell.ace_info {
|
||||
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpGRTk5MTVGREIxNDkxMUUxOTc5Q0FFREQyMTNGMjBFQyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpGRTk5MTVGRUIxNDkxMUUxOTc5Q0FFREQyMTNGMjBFQyI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkZFOTkxNUZCQjE0OTExRTE5NzlDQUVERDIxM0YyMEVDIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkZFOTkxNUZDQjE0OTExRTE5NzlDQUVERDIxM0YyMEVDIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+SIDkjAAAAJ1JREFUeNpi/P//PwMlgImBQkB7A6qrq/+DMC55FkIGKCoq4pVnpFkgTp069f/+/fv/r1u37r+tre1/kg0A+ptn9uzZYLaRkRHpLvjw4cNXWVlZhufPnzOcO3eOdAO0tbVPAjHDmzdvGA4fPsxIsgGSkpJmv379Ynj37h2DjIyMCMkG3LhxQ/T27dsMampqDHZ2dq/pH41DxwCAAAMAFdc68dUsFZgAAAAASUVORK5CYII=");
|
||||
}
|
||||
|
||||
.ace_scrollbar {
|
||||
position: absolute;
|
||||
overflow-x: hidden;
|
||||
overflow-y: scroll;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.ace_scrollbar-inner {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.ace_print-margin {
|
||||
position: absolute;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.ace_text-input {
|
||||
position: absolute;
|
||||
z-index: 0;
|
||||
width: 0.5em;
|
||||
height: 1em;
|
||||
opacity: 0;
|
||||
background: transparent;
|
||||
-moz-appearance: none;
|
||||
appearance: none;
|
||||
border: none;
|
||||
resize: none;
|
||||
outline: none;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.ace_text-input.ace_composition {
|
||||
background: #fff;
|
||||
color: #000;
|
||||
z-index: 1000;
|
||||
opacity: 1;
|
||||
border: solid lightgray 1px;
|
||||
margin: -1px
|
||||
}
|
||||
|
||||
.ace_layer {
|
||||
z-index: 1;
|
||||
position: absolute;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
/* setting pointer-events: auto; on node under the mouse, which changes
|
||||
during scroll, will break mouse wheel scrolling in Safari */
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.ace_gutter-layer {
|
||||
position: relative;
|
||||
width: auto;
|
||||
text-align: right;
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
.ace_text-layer {
|
||||
color: black;
|
||||
font: inherit !important;
|
||||
}
|
||||
|
||||
.ace_cjk {
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.ace_cursor-layer {
|
||||
z-index: 4;
|
||||
}
|
||||
|
||||
.ace_cursor {
|
||||
z-index: 4;
|
||||
position: absolute;
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.ace_hidden-cursors .ace_cursor {
|
||||
opacity: 0.2;
|
||||
}
|
||||
|
||||
.ace_smooth-blinking .ace_cursor {
|
||||
-moz-transition: opacity 0.18s;
|
||||
-webkit-transition: opacity 0.18s;
|
||||
-o-transition: opacity 0.18s;
|
||||
-ms-transition: opacity 0.18s;
|
||||
transition: opacity 0.18s;
|
||||
}
|
||||
|
||||
.ace_cursor[style*="opacity: 0"]{
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
|
||||
}
|
||||
|
||||
.ace_editor.ace_multiselect .ace_cursor {
|
||||
border-left-width: 1px;
|
||||
}
|
||||
|
||||
.ace_line {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.ace_marker-layer .ace_step {
|
||||
position: absolute;
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
.ace_marker-layer .ace_selection {
|
||||
position: absolute;
|
||||
z-index: 5;
|
||||
}
|
||||
|
||||
.ace_marker-layer .ace_bracket {
|
||||
position: absolute;
|
||||
z-index: 6;
|
||||
}
|
||||
|
||||
.ace_marker-layer .ace_active-line {
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.ace_marker-layer .ace_selected-word {
|
||||
position: absolute;
|
||||
z-index: 4;
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.ace_line .ace_fold {
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
|
||||
display: inline-block;
|
||||
height: 11px;
|
||||
margin-top: -2px;
|
||||
vertical-align: middle;
|
||||
|
||||
background-image:
|
||||
url("data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%11%00%00%00%09%08%06%00%00%00%D4%E8%C7%0C%00%00%03%1EiCCPICC%20Profile%00%00x%01%85T%DFk%D3P%14%FE%DAe%9D%B0%E1%8B%3Ag%11%09%3Eh%91ndStC%9C%B6kW%BA%CDZ%EA6%B7!H%9B%A6m%5C%9A%C6%24%ED~%B0%07%D9%8Bo%3A%C5w%F1%07%3E%F9%07%0C%D9%83o%7B%92%0D%C6%14a%F8%AC%88%22L%F6%22%B3%9E%9B4M'S%03%B9%F7%BB%DF%F9%EE9'%E7%E4%5E%A0%F9qZ%D3%14%2F%0F%14USO%C5%C2%FC%C4%E4%14%DF%F2%01%5E%1CC%2B%FChM%8B%86%16J%26G%40%0F%D3%B2y%EF%B3%F3%0E%1E%C6lt%EEo%DF%AB%FEc%D5%9A%95%0C%11%F0%1C%20%BE%945%C4%22%E1Y%A0i%5C%D4t%13%E0%D6%89%EF%9D15%C2%CDLsX%A7%04%09%1Fg8oc%81%E1%8C%8D%23%96f45%40%9A%09%C2%07%C5B%3AK%B8%408%98i%E0%F3%0D%D8%CE%81%14%E4'%26%A9%92.%8B%3C%ABER%2F%E5dE%B2%0C%F6%F0%1Fs%83%F2_%B0%A8%94%E9%9B%AD%E7%10%8Dm%9A%19N%D1%7C%8A%DE%1F9%7Dp%8C%E6%00%D5%C1%3F_%18%BDA%B8%9DpX6%E3%A35~B%CD%24%AE%11%26%BD%E7%EEti%98%EDe%9A%97Y)%12%25%1C%24%BCbT%AE3li%E6%0B%03%89%9A%E6%D3%ED%F4P%92%B0%9F4%BF43Y%F3%E3%EDP%95%04%EB1%C5%F5%F6KF%F4%BA%BD%D7%DB%91%93%07%E35%3E%A7)%D6%7F%40%FE%BD%F7%F5r%8A%E5y%92%F0%EB%B4%1E%8D%D5%F4%5B%92%3AV%DB%DB%E4%CD%A6%23%C3%C4wQ%3F%03HB%82%8E%1Cd(%E0%91B%0Ca%9Ac%C4%AA%F8L%16%19%22J%A4%D2itTy%B28%D6%3B(%93%96%ED%1CGx%C9_%0E%B8%5E%16%F5%5B%B2%B8%F6%E0%FB%9E%DD%25%D7%8E%BC%15%85%C5%B7%A3%D8Q%ED%B5%81%E9%BA%B2%13%9A%1B%7Fua%A5%A3n%E17%B9%E5%9B%1Bm%AB%0B%08Q%FE%8A%E5%B1H%5Ee%CAO%82Q%D7u6%E6%90S%97%FCu%0B%CF2%94%EE%25v%12X%0C%BA%AC%F0%5E%F8*l%0AO%85%17%C2%97%BF%D4%C8%CE%DE%AD%11%CB%80q%2C%3E%AB%9ES%CD%C6%EC%25%D2L%D2%EBd%B8%BF%8A%F5B%C6%18%F9%901CZ%9D%BE%24M%9C%8A9%F2%DAP%0B'%06w%82%EB%E6%E2%5C%2F%D7%07%9E%BB%CC%5D%E1%FA%B9%08%AD.r%23%8E%C2%17%F5E%7C!%F0%BE3%BE%3E_%B7o%88a%A7%DB%BE%D3d%EB%A31Z%EB%BB%D3%91%BA%A2%B1z%94%8F%DB'%F6%3D%8E%AA%13%19%B2%B1%BE%B1~V%08%2B%B4%A2cjJ%B3tO%00%03%25mN%97%F3%05%93%EF%11%84%0B%7C%88%AE-%89%8F%ABbW%90O%2B%0Ao%99%0C%5E%97%0CI%AFH%D9.%B0%3B%8F%ED%03%B6S%D6%5D%E6i_s9%F3*p%E9%1B%FD%C3%EB.7U%06%5E%19%C0%D1s.%17%A03u%E4%09%B0%7C%5E%2C%EB%15%DB%1F%3C%9E%B7%80%91%3B%DBc%AD%3Dma%BA%8B%3EV%AB%DBt.%5B%1E%01%BB%0F%AB%D5%9F%CF%AA%D5%DD%E7%E4%7F%0Bx%A3%FC%06%A9%23%0A%D6%C2%A1_2%00%00%00%09pHYs%00%00%0B%13%00%00%0B%13%01%00%9A%9C%18%00%00%00%B5IDAT(%15%A5%91%3D%0E%02!%10%85ac%E1%05%D6%CE%D6%C6%CE%D2%E8%ED%CD%DE%C0%C6%D6N.%E0V%F8%3D%9Ca%891XH%C2%BE%D9y%3F%90!%E6%9C%C3%BFk%E5%011%C6-%F5%C8N%04%DF%BD%FF%89%DFt%83DN%60%3E%F3%AB%A0%DE%1A%5Dg%BE%10Q%97%1B%40%9C%A8o%10%8F%5E%828%B4%1B%60%87%F6%02%26%85%1Ch%1E%C1%2B%5Bk%FF%86%EE%B7j%09%9A%DA%9B%ACe%A3%F9%EC%DA!9%B4%D5%A6%81%86%86%98%CC%3C%5B%40%FA%81%B3%E9%CB%23%94%C16Azo%05%D4%E1%C1%95a%3B%8A'%A0%E8%CC%17%22%85%1D%BA%00%A2%FA%DC%0A%94%D1%D1%8D%8B%3A%84%17B%C7%60%1A%25Z%FC%8D%00%00%00%00IEND%AEB%60%82"),
|
||||
url("data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%05%00%00%007%08%06%00%00%00%C4%DD%80C%00%00%03%1EiCCPICC%20Profile%00%00x%01%85T%DFk%D3P%14%FE%DAe%9D%B0%E1%8B%3Ag%11%09%3Eh%91ndStC%9C%B6kW%BA%CDZ%EA6%B7!H%9B%A6m%5C%9A%C6%24%ED~%B0%07%D9%8Bo%3A%C5w%F1%07%3E%F9%07%0C%D9%83o%7B%92%0D%C6%14a%F8%AC%88%22L%F6%22%B3%9E%9B4M'S%03%B9%F7%BB%DF%F9%EE9'%E7%E4%5E%A0%F9qZ%D3%14%2F%0F%14USO%C5%C2%FC%C4%E4%14%DF%F2%01%5E%1CC%2B%FChM%8B%86%16J%26G%40%0F%D3%B2y%EF%B3%F3%0E%1E%C6lt%EEo%DF%AB%FEc%D5%9A%95%0C%11%F0%1C%20%BE%945%C4%22%E1Y%A0i%5C%D4t%13%E0%D6%89%EF%9D15%C2%CDLsX%A7%04%09%1Fg8oc%81%E1%8C%8D%23%96f45%40%9A%09%C2%07%C5B%3AK%B8%408%98i%E0%F3%0D%D8%CE%81%14%E4'%26%A9%92.%8B%3C%ABER%2F%E5dE%B2%0C%F6%F0%1Fs%83%F2_%B0%A8%94%E9%9B%AD%E7%10%8Dm%9A%19N%D1%7C%8A%DE%1F9%7Dp%8C%E6%00%D5%C1%3F_%18%BDA%B8%9DpX6%E3%A35~B%CD%24%AE%11%26%BD%E7%EEti%98%EDe%9A%97Y)%12%25%1C%24%BCbT%AE3li%E6%0B%03%89%9A%E6%D3%ED%F4P%92%B0%9F4%BF43Y%F3%E3%EDP%95%04%EB1%C5%F5%F6KF%F4%BA%BD%D7%DB%91%93%07%E35%3E%A7)%D6%7F%40%FE%BD%F7%F5r%8A%E5y%92%F0%EB%B4%1E%8D%D5%F4%5B%92%3AV%DB%DB%E4%CD%A6%23%C3%C4wQ%3F%03HB%82%8E%1Cd(%E0%91B%0Ca%9Ac%C4%AA%F8L%16%19%22J%A4%D2itTy%B28%D6%3B(%93%96%ED%1CGx%C9_%0E%B8%5E%16%F5%5B%B2%B8%F6%E0%FB%9E%DD%25%D7%8E%BC%15%85%C5%B7%A3%D8Q%ED%B5%81%E9%BA%B2%13%9A%1B%7Fua%A5%A3n%E17%B9%E5%9B%1Bm%AB%0B%08Q%FE%8A%E5%B1H%5Ee%CAO%82Q%D7u6%E6%90S%97%FCu%0B%CF2%94%EE%25v%12X%0C%BA%AC%F0%5E%F8*l%0AO%85%17%C2%97%BF%D4%C8%CE%DE%AD%11%CB%80q%2C%3E%AB%9ES%CD%C6%EC%25%D2L%D2%EBd%B8%BF%8A%F5B%C6%18%F9%901CZ%9D%BE%24M%9C%8A9%F2%DAP%0B'%06w%82%EB%E6%E2%5C%2F%D7%07%9E%BB%CC%5D%E1%FA%B9%08%AD.r%23%8E%C2%17%F5E%7C!%F0%BE3%BE%3E_%B7o%88a%A7%DB%BE%D3d%EB%A31Z%EB%BB%D3%91%BA%A2%B1z%94%8F%DB'%F6%3D%8E%AA%13%19%B2%B1%BE%B1~V%08%2B%B4%A2cjJ%B3tO%00%03%25mN%97%F3%05%93%EF%11%84%0B%7C%88%AE-%89%8F%ABbW%90O%2B%0Ao%99%0C%5E%97%0CI%AFH%D9.%B0%3B%8F%ED%03%B6S%D6%5D%E6i_s9%F3*p%E9%1B%FD%C3%EB.7U%06%5E%19%C0%D1s.%17%A03u%E4%09%B0%7C%5E%2C%EB%15%DB%1F%3C%9E%B7%80%91%3B%DBc%AD%3Dma%BA%8B%3EV%AB%DBt.%5B%1E%01%BB%0F%AB%D5%9F%CF%AA%D5%DD%E7%E4%7F%0Bx%A3%FC%06%A9%23%0A%D6%C2%A1_2%00%00%00%09pHYs%00%00%0B%13%00%00%0B%13%01%00%9A%9C%18%00%00%00%3AIDAT8%11c%FC%FF%FF%7F%18%03%1A%60%01%F2%3F%A0%891%80%04%FF%11-%F8%17%9BJ%E2%05%B1ZD%81v%26t%E7%80%F8%A3%82h%A12%1A%20%A3%01%02%0F%01%BA%25%06%00%19%C0%0D%AEF%D5%3ES%00%00%00%00IEND%AEB%60%82");
|
||||
background-repeat: no-repeat, repeat-x;
|
||||
background-position: center center, top left;
|
||||
color: transparent;
|
||||
|
||||
border: 1px solid black;
|
||||
-moz-border-radius: 2px;
|
||||
-webkit-border-radius: 2px;
|
||||
border-radius: 2px;
|
||||
|
||||
cursor: pointer;
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
.ace_dark .ace_fold {
|
||||
}
|
||||
|
||||
.ace_fold:hover{
|
||||
background-image:
|
||||
url("data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%11%00%00%00%09%08%06%00%00%00%D4%E8%C7%0C%00%00%03%1EiCCPICC%20Profile%00%00x%01%85T%DFk%D3P%14%FE%DAe%9D%B0%E1%8B%3Ag%11%09%3Eh%91ndStC%9C%B6kW%BA%CDZ%EA6%B7!H%9B%A6m%5C%9A%C6%24%ED~%B0%07%D9%8Bo%3A%C5w%F1%07%3E%F9%07%0C%D9%83o%7B%92%0D%C6%14a%F8%AC%88%22L%F6%22%B3%9E%9B4M'S%03%B9%F7%BB%DF%F9%EE9'%E7%E4%5E%A0%F9qZ%D3%14%2F%0F%14USO%C5%C2%FC%C4%E4%14%DF%F2%01%5E%1CC%2B%FChM%8B%86%16J%26G%40%0F%D3%B2y%EF%B3%F3%0E%1E%C6lt%EEo%DF%AB%FEc%D5%9A%95%0C%11%F0%1C%20%BE%945%C4%22%E1Y%A0i%5C%D4t%13%E0%D6%89%EF%9D15%C2%CDLsX%A7%04%09%1Fg8oc%81%E1%8C%8D%23%96f45%40%9A%09%C2%07%C5B%3AK%B8%408%98i%E0%F3%0D%D8%CE%81%14%E4'%26%A9%92.%8B%3C%ABER%2F%E5dE%B2%0C%F6%F0%1Fs%83%F2_%B0%A8%94%E9%9B%AD%E7%10%8Dm%9A%19N%D1%7C%8A%DE%1F9%7Dp%8C%E6%00%D5%C1%3F_%18%BDA%B8%9DpX6%E3%A35~B%CD%24%AE%11%26%BD%E7%EEti%98%EDe%9A%97Y)%12%25%1C%24%BCbT%AE3li%E6%0B%03%89%9A%E6%D3%ED%F4P%92%B0%9F4%BF43Y%F3%E3%EDP%95%04%EB1%C5%F5%F6KF%F4%BA%BD%D7%DB%91%93%07%E35%3E%A7)%D6%7F%40%FE%BD%F7%F5r%8A%E5y%92%F0%EB%B4%1E%8D%D5%F4%5B%92%3AV%DB%DB%E4%CD%A6%23%C3%C4wQ%3F%03HB%82%8E%1Cd(%E0%91B%0Ca%9Ac%C4%AA%F8L%16%19%22J%A4%D2itTy%B28%D6%3B(%93%96%ED%1CGx%C9_%0E%B8%5E%16%F5%5B%B2%B8%F6%E0%FB%9E%DD%25%D7%8E%BC%15%85%C5%B7%A3%D8Q%ED%B5%81%E9%BA%B2%13%9A%1B%7Fua%A5%A3n%E17%B9%E5%9B%1Bm%AB%0B%08Q%FE%8A%E5%B1H%5Ee%CAO%82Q%D7u6%E6%90S%97%FCu%0B%CF2%94%EE%25v%12X%0C%BA%AC%F0%5E%F8*l%0AO%85%17%C2%97%BF%D4%C8%CE%DE%AD%11%CB%80q%2C%3E%AB%9ES%CD%C6%EC%25%D2L%D2%EBd%B8%BF%8A%F5B%C6%18%F9%901CZ%9D%BE%24M%9C%8A9%F2%DAP%0B'%06w%82%EB%E6%E2%5C%2F%D7%07%9E%BB%CC%5D%E1%FA%B9%08%AD.r%23%8E%C2%17%F5E%7C!%F0%BE3%BE%3E_%B7o%88a%A7%DB%BE%D3d%EB%A31Z%EB%BB%D3%91%BA%A2%B1z%94%8F%DB'%F6%3D%8E%AA%13%19%B2%B1%BE%B1~V%08%2B%B4%A2cjJ%B3tO%00%03%25mN%97%F3%05%93%EF%11%84%0B%7C%88%AE-%89%8F%ABbW%90O%2B%0Ao%99%0C%5E%97%0CI%AFH%D9.%B0%3B%8F%ED%03%B6S%D6%5D%E6i_s9%F3*p%E9%1B%FD%C3%EB.7U%06%5E%19%C0%D1s.%17%A03u%E4%09%B0%7C%5E%2C%EB%15%DB%1F%3C%9E%B7%80%91%3B%DBc%AD%3Dma%BA%8B%3EV%AB%DBt.%5B%1E%01%BB%0F%AB%D5%9F%CF%AA%D5%DD%E7%E4%7F%0Bx%A3%FC%06%A9%23%0A%D6%C2%A1_2%00%00%00%09pHYs%00%00%0B%13%00%00%0B%13%01%00%9A%9C%18%00%00%00%B5IDAT(%15%A5%91%3D%0E%02!%10%85ac%E1%05%D6%CE%D6%C6%CE%D2%E8%ED%CD%DE%C0%C6%D6N.%E0V%F8%3D%9Ca%891XH%C2%BE%D9y%3F%90!%E6%9C%C3%BFk%E5%011%C6-%F5%C8N%04%DF%BD%FF%89%DFt%83DN%60%3E%F3%AB%A0%DE%1A%5Dg%BE%10Q%97%1B%40%9C%A8o%10%8F%5E%828%B4%1B%60%87%F6%02%26%85%1Ch%1E%C1%2B%5Bk%FF%86%EE%B7j%09%9A%DA%9B%ACe%A3%F9%EC%DA!9%B4%D5%A6%81%86%86%98%CC%3C%5B%40%FA%81%B3%E9%CB%23%94%C16Azo%05%D4%E1%C1%95a%3B%8A'%A0%E8%CC%17%22%85%1D%BA%00%A2%FA%DC%0A%94%D1%D1%8D%8B%3A%84%17B%C7%60%1A%25Z%FC%8D%00%00%00%00IEND%AEB%60%82"),
|
||||
url("data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%05%00%00%007%08%06%00%00%00%C4%DD%80C%00%00%03%1EiCCPICC%20Profile%00%00x%01%85T%DFk%D3P%14%FE%DAe%9D%B0%E1%8B%3Ag%11%09%3Eh%91ndStC%9C%B6kW%BA%CDZ%EA6%B7!H%9B%A6m%5C%9A%C6%24%ED~%B0%07%D9%8Bo%3A%C5w%F1%07%3E%F9%07%0C%D9%83o%7B%92%0D%C6%14a%F8%AC%88%22L%F6%22%B3%9E%9B4M'S%03%B9%F7%BB%DF%F9%EE9'%E7%E4%5E%A0%F9qZ%D3%14%2F%0F%14USO%C5%C2%FC%C4%E4%14%DF%F2%01%5E%1CC%2B%FChM%8B%86%16J%26G%40%0F%D3%B2y%EF%B3%F3%0E%1E%C6lt%EEo%DF%AB%FEc%D5%9A%95%0C%11%F0%1C%20%BE%945%C4%22%E1Y%A0i%5C%D4t%13%E0%D6%89%EF%9D15%C2%CDLsX%A7%04%09%1Fg8oc%81%E1%8C%8D%23%96f45%40%9A%09%C2%07%C5B%3AK%B8%408%98i%E0%F3%0D%D8%CE%81%14%E4'%26%A9%92.%8B%3C%ABER%2F%E5dE%B2%0C%F6%F0%1Fs%83%F2_%B0%A8%94%E9%9B%AD%E7%10%8Dm%9A%19N%D1%7C%8A%DE%1F9%7Dp%8C%E6%00%D5%C1%3F_%18%BDA%B8%9DpX6%E3%A35~B%CD%24%AE%11%26%BD%E7%EEti%98%EDe%9A%97Y)%12%25%1C%24%BCbT%AE3li%E6%0B%03%89%9A%E6%D3%ED%F4P%92%B0%9F4%BF43Y%F3%E3%EDP%95%04%EB1%C5%F5%F6KF%F4%BA%BD%D7%DB%91%93%07%E35%3E%A7)%D6%7F%40%FE%BD%F7%F5r%8A%E5y%92%F0%EB%B4%1E%8D%D5%F4%5B%92%3AV%DB%DB%E4%CD%A6%23%C3%C4wQ%3F%03HB%82%8E%1Cd(%E0%91B%0Ca%9Ac%C4%AA%F8L%16%19%22J%A4%D2itTy%B28%D6%3B(%93%96%ED%1CGx%C9_%0E%B8%5E%16%F5%5B%B2%B8%F6%E0%FB%9E%DD%25%D7%8E%BC%15%85%C5%B7%A3%D8Q%ED%B5%81%E9%BA%B2%13%9A%1B%7Fua%A5%A3n%E17%B9%E5%9B%1Bm%AB%0B%08Q%FE%8A%E5%B1H%5Ee%CAO%82Q%D7u6%E6%90S%97%FCu%0B%CF2%94%EE%25v%12X%0C%BA%AC%F0%5E%F8*l%0AO%85%17%C2%97%BF%D4%C8%CE%DE%AD%11%CB%80q%2C%3E%AB%9ES%CD%C6%EC%25%D2L%D2%EBd%B8%BF%8A%F5B%C6%18%F9%901CZ%9D%BE%24M%9C%8A9%F2%DAP%0B'%06w%82%EB%E6%E2%5C%2F%D7%07%9E%BB%CC%5D%E1%FA%B9%08%AD.r%23%8E%C2%17%F5E%7C!%F0%BE3%BE%3E_%B7o%88a%A7%DB%BE%D3d%EB%A31Z%EB%BB%D3%91%BA%A2%B1z%94%8F%DB'%F6%3D%8E%AA%13%19%B2%B1%BE%B1~V%08%2B%B4%A2cjJ%B3tO%00%03%25mN%97%F3%05%93%EF%11%84%0B%7C%88%AE-%89%8F%ABbW%90O%2B%0Ao%99%0C%5E%97%0CI%AFH%D9.%B0%3B%8F%ED%03%B6S%D6%5D%E6i_s9%F3*p%E9%1B%FD%C3%EB.7U%06%5E%19%C0%D1s.%17%A03u%E4%09%B0%7C%5E%2C%EB%15%DB%1F%3C%9E%B7%80%91%3B%DBc%AD%3Dma%BA%8B%3EV%AB%DBt.%5B%1E%01%BB%0F%AB%D5%9F%CF%AA%D5%DD%E7%E4%7F%0Bx%A3%FC%06%A9%23%0A%D6%C2%A1_2%00%00%00%09pHYs%00%00%0B%13%00%00%0B%13%01%00%9A%9C%18%00%00%003IDAT8%11c%FC%FF%FF%7F%3E%03%1A%60%01%F2%3F%A3%891%80%04%FFQ%26%F8w%C0%B43%A1%DB%0C%E2%8F%0A%A2%85%CAh%80%8C%06%08%3C%04%E8%96%18%00%A3S%0D%CD%CF%D8%C1%9D%00%00%00%00IEND%AEB%60%82");
|
||||
background-repeat: no-repeat, repeat-x;
|
||||
background-position: center center, top left;
|
||||
}
|
||||
|
||||
.ace_editor.ace_dragging .ace_content {
|
||||
cursor: move;
|
||||
}
|
||||
|
||||
.ace_gutter-tooltip {
|
||||
background-color: #FFFFD5;
|
||||
border: 1px solid gray;
|
||||
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
|
||||
color: black;
|
||||
display: inline-block;
|
||||
padding: 4px;
|
||||
position: absolute;
|
||||
z-index: 300;
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
cursor: default;
|
||||
white-space: pre-line;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.ace_folding-enabled > .ace_gutter-cell {
|
||||
padding-right: 13px;
|
||||
}
|
||||
|
||||
.ace_fold-widget {
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
|
||||
margin: 0 -12px 0 1px;
|
||||
display: inline-block;
|
||||
width: 11px;
|
||||
vertical-align: top;
|
||||
|
||||
background-image: url("data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%05%00%00%00%05%08%06%00%00%00%8Do%26%E5%00%00%004IDATx%DAe%8A%B1%0D%000%0C%C2%F2%2CK%96%BC%D0%8F9%81%88H%E9%D0%0E%96%C0%10%92%3E%02%80%5E%82%E4%A9*-%EEsw%C8%CC%11%EE%96w%D8%DC%E9*Eh%0C%151(%00%00%00%00IEND%AEB%60%82");
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
|
||||
border-radius: 3px;
|
||||
|
||||
border: 1px solid transparent;
|
||||
}
|
||||
|
||||
.ace_fold-widget.ace_end {
|
||||
background-image: url("data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%05%00%00%00%05%08%06%00%00%00%8Do%26%E5%00%00%004IDATx%DAm%C7%C1%09%000%08C%D1%8C%ECE%C8E(%8E%EC%02)%1EZJ%F1%C1'%04%07I%E1%E5%EE%CAL%F5%A2%99%99%22%E2%D6%1FU%B5%FE0%D9x%A7%26Wz5%0E%D5%00%00%00%00IEND%AEB%60%82");
|
||||
}
|
||||
|
||||
.ace_fold-widget.ace_closed {
|
||||
background-image: url("data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%03%00%00%00%06%08%06%00%00%00%06%E5%24%0C%00%00%009IDATx%DA5%CA%C1%09%000%08%03%C0%AC*(%3E%04%C1%0D%BA%B1%23%A4Uh%E0%20%81%C0%CC%F8%82%81%AA%A2%AArGfr%88%08%11%11%1C%DD%7D%E0%EE%5B%F6%F6%CB%B8%05Q%2F%E9tai%D9%00%00%00%00IEND%AEB%60%82");
|
||||
}
|
||||
|
||||
.ace_fold-widget:hover {
|
||||
border: 1px solid rgba(0, 0, 0, 0.3);
|
||||
background-color: rgba(255, 255, 255, 0.2);
|
||||
-moz-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
|
||||
-webkit-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
|
||||
box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
|
||||
}
|
||||
|
||||
.ace_fold-widget:active {
|
||||
border: 1px solid rgba(0, 0, 0, 0.4);
|
||||
background-color: rgba(0, 0, 0, 0.05);
|
||||
-moz-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
|
||||
-webkit-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
|
||||
box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
|
||||
}
|
||||
/**
|
||||
* Dark version for fold widgets
|
||||
*/
|
||||
.ace_dark .ace_fold-widget {
|
||||
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");
|
||||
}
|
||||
.ace_dark .ace_fold-widget.ace_end {
|
||||
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");
|
||||
}
|
||||
.ace_dark .ace_fold-widget.ace_closed {
|
||||
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");
|
||||
}
|
||||
.ace_dark .ace_fold-widget:hover {
|
||||
box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);
|
||||
background-color: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
.ace_dark .ace_fold-widget:active {
|
||||
-moz-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);
|
||||
-webkit-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);
|
||||
box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
.ace_fold-widget.ace_invalid {
|
||||
background-color: #FFB4B4;
|
||||
border-color: #DE5555;
|
||||
}
|
||||
|
||||
.ace_fade-fold-widgets .ace_fold-widget {
|
||||
-moz-transition: opacity 0.4s ease 0.05s;
|
||||
-webkit-transition: opacity 0.4s ease 0.05s;
|
||||
-o-transition: opacity 0.4s ease 0.05s;
|
||||
-ms-transition: opacity 0.4s ease 0.05s;
|
||||
transition: opacity 0.4s ease 0.05s;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.ace_fade-fold-widgets:hover .ace_fold-widget {
|
||||
-moz-transition: opacity 0.05s ease 0.05s;
|
||||
-webkit-transition: opacity 0.05s ease 0.05s;
|
||||
-o-transition: opacity 0.05s ease 0.05s;
|
||||
-ms-transition: opacity 0.05s ease 0.05s;
|
||||
transition: opacity 0.05s ease 0.05s;
|
||||
opacity:1;
|
||||
}
|
||||
|
||||
.ace_underline {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.ace_bold {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.ace_nobold .ace_bold {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.ace_italic {
|
||||
font-style: italic;
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
.ace_editor {
|
||||
font-family: 'Monaco', 'Menlo', 'Droid Sans Mono', 'Courier New', monospace;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.ace_editor .ace_gutter {
|
||||
width: 25px !important;
|
||||
display: block;
|
||||
float: left;
|
||||
text-align: right;
|
||||
padding: 0 3px 0 0;
|
||||
margin-right: 3px;
|
||||
}
|
||||
|
||||
.ace_line { clear: both; }
|
||||
|
||||
*.ace_gutter-cell {
|
||||
-moz-user-select: -moz-none;
|
||||
-khtml-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
@@ -1,88 +0,0 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Distributed under the BSD license:
|
||||
*
|
||||
* Copyright (c) 2010, Ajax.org B.V.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of Ajax.org B.V. nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var EditSession = require("../edit_session").EditSession;
|
||||
var TextLayer = require("../layer/text").Text;
|
||||
var baseStyles = require("../requirejs/text!./static.css");
|
||||
|
||||
/* Transforms a given input code snippet into HTML using the given mode
|
||||
*
|
||||
* @param {string} input Code snippet
|
||||
* @param {mode} mode Mode loaded from /ace/mode (use 'ServerSideHiglighter.getMode')
|
||||
* @param {string} r Code snippet
|
||||
* @returns {object} An object containing: html, css
|
||||
*/
|
||||
|
||||
exports.render = function(input, mode, theme, lineStart, disableGutter) {
|
||||
lineStart = parseInt(lineStart || 1, 10);
|
||||
|
||||
var session = new EditSession("");
|
||||
session.setMode(mode);
|
||||
session.setUseWorker(false);
|
||||
|
||||
var textLayer = new TextLayer(document.createElement("div"));
|
||||
textLayer.setSession(session);
|
||||
textLayer.config = {
|
||||
characterWidth: 10,
|
||||
lineHeight: 20
|
||||
};
|
||||
|
||||
session.setValue(input);
|
||||
|
||||
var stringBuilder = [];
|
||||
var length = session.getLength();
|
||||
|
||||
for(var ix = 0; ix < length; ix++) {
|
||||
stringBuilder.push("<div class='ace_line'>");
|
||||
if (!disableGutter)
|
||||
stringBuilder.push("<span class='ace_gutter ace_gutter-cell' unselectable='on'>" + (ix + lineStart) + "</span>");
|
||||
textLayer.$renderLine(stringBuilder, ix, true, false);
|
||||
stringBuilder.push("</div>");
|
||||
}
|
||||
|
||||
// let's prepare the whole html
|
||||
var html = "<div class=':cssClass'>\
|
||||
<div class='ace_editor ace_scroller ace_text-layer'>\
|
||||
:code\
|
||||
</div>\
|
||||
</div>".replace(/:cssClass/, theme.cssClass).replace(/:code/, stringBuilder.join(""));
|
||||
|
||||
textLayer.destroy();
|
||||
|
||||
return {
|
||||
css: baseStyles + theme.cssText,
|
||||
html: html
|
||||
};
|
||||
};
|
||||
|
||||
});
|
||||
-76
@@ -1,76 +0,0 @@
|
||||
if (typeof process !== "undefined") {
|
||||
require("amd-loader");
|
||||
require("../test/mockdom");
|
||||
}
|
||||
|
||||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var assert = require("assert");
|
||||
var highlighter = require("./static_highlight");
|
||||
var JavaScriptMode = require("../mode/javascript").Mode;
|
||||
|
||||
// Execution ORDER: test.setUpSuite, setUp, testFn, tearDown, test.tearDownSuite
|
||||
module.exports = {
|
||||
timeout: 10000,
|
||||
|
||||
"test simple snippet": function(next) {
|
||||
var theme = require("../theme/tomorrow");
|
||||
var snippet = "\
|
||||
/** this is a function\n\
|
||||
*\n\
|
||||
*/\n\
|
||||
function hello (a, b, c) {\n\
|
||||
console.log(a * b + c + 'sup?');\n\
|
||||
}";
|
||||
var mode = new JavaScriptMode();
|
||||
|
||||
var result = highlighter.render(snippet, mode, theme);
|
||||
assert.equal(result.html, "<div class='ace-tomorrow'> <div class='ace_editor ace_scroller ace_text-layer'> <div class='ace_line'><span class='ace_gutter ace_gutter-cell' unselectable='on'>1</span><span class='ace_comment ace_doc'>/** this is a function</span></div><div class='ace_line'><span class='ace_gutter ace_gutter-cell' unselectable='on'>2</span><span class='ace_comment ace_doc'>*</span></div><div class='ace_line'><span class='ace_gutter ace_gutter-cell' unselectable='on'>3</span><span class='ace_comment ace_doc'>*/</span></div><div class='ace_line'><span class='ace_gutter ace_gutter-cell' unselectable='on'>4</span><span class='ace_storage ace_type'>function</span> <span class='ace_entity ace_name ace_function'>hello</span> <span class='ace_paren ace_lparen'>(</span><span class='ace_variable ace_parameter'>a</span><span class='ace_punctuation ace_operator'>, </span><span class='ace_variable ace_parameter'>b</span><span class='ace_punctuation ace_operator'>, </span><span class='ace_variable ace_parameter'>c</span><span class='ace_paren ace_rparen'>)</span> <span class='ace_paren ace_lparen'>{</span></div><div class='ace_line'><span class='ace_gutter ace_gutter-cell' unselectable='on'>5</span>    <span class='ace_storage ace_type'>console</span><span class='ace_punctuation ace_operator'>.</span><span class='ace_support ace_function ace_firebug'>log</span><span class='ace_paren ace_lparen'>(</span><span class='ace_identifier'>a</span> <span class='ace_keyword ace_operator'>*</span> <span class='ace_identifier'>b</span> <span class='ace_keyword ace_operator'>+</span> <span class='ace_identifier'>c</span> <span class='ace_keyword ace_operator'>+</span> <span class='ace_string'>'sup?'</span><span class='ace_paren ace_rparen'>)</span><span class='ace_punctuation ace_operator'>;</span></div><div class='ace_line'><span class='ace_gutter ace_gutter-cell' unselectable='on'>6</span><span class='ace_paren ace_rparen'>}</span></div> </div> </div>");
|
||||
assert.ok(!!result.css);
|
||||
next();
|
||||
},
|
||||
|
||||
"test css from theme is used": function(next) {
|
||||
var theme = require("../theme/tomorrow");
|
||||
var snippet = "\
|
||||
/** this is a function\n\
|
||||
*\n\
|
||||
*/\n\
|
||||
function hello (a, b, c) {\n\
|
||||
console.log(a * b + c + 'sup?');\n\
|
||||
}";
|
||||
var mode = new JavaScriptMode();
|
||||
|
||||
var isError = false, result;
|
||||
result = highlighter.render(snippet, mode, theme);
|
||||
|
||||
assert.ok(result.css.indexOf(theme.cssText) !== -1);
|
||||
|
||||
next();
|
||||
},
|
||||
|
||||
"test theme classname should be in output html": function (next) {
|
||||
var theme = require("../theme/tomorrow");
|
||||
var snippet = "\
|
||||
/** this is a function\n\
|
||||
*\n\
|
||||
*/\n\
|
||||
function hello (a, b, c) {\n\
|
||||
console.log(a * b + c + 'sup?');\n\
|
||||
}";
|
||||
var mode = new JavaScriptMode();
|
||||
|
||||
var isError = false, result;
|
||||
result = highlighter.render(snippet, mode, theme);
|
||||
assert.equal(!!result.html.match(/<div class='ace-tomorrow'>/), true);
|
||||
|
||||
next();
|
||||
}
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec();
|
||||
}
|
||||
@@ -1,375 +0,0 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Distributed under the BSD license:
|
||||
*
|
||||
* Copyright (c) 2010, Ajax.org B.V.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of Ajax.org B.V. nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var dom = require("../lib/dom");
|
||||
|
||||
var screenToTextBlockCoordinates = function(pageX, pageY) {
|
||||
var canvasPos = this.scroller.getBoundingClientRect();
|
||||
|
||||
var col = Math.floor(
|
||||
(pageX + this.scrollLeft - canvasPos.left - this.$padding - dom.getPageScrollLeft()) / this.characterWidth
|
||||
);
|
||||
var row = Math.floor(
|
||||
(pageY + this.scrollTop - canvasPos.top - dom.getPageScrollTop()) / this.lineHeight
|
||||
);
|
||||
|
||||
return this.session.screenToDocumentPosition(row, col);
|
||||
};
|
||||
|
||||
var HashHandler = require("./hash_handler").HashHandler;
|
||||
exports.handler = new HashHandler();
|
||||
|
||||
var initialized = false;
|
||||
exports.handler.attach = function(editor) {
|
||||
if (!initialized) {
|
||||
initialized = true;
|
||||
dom.importCssString('\
|
||||
.emacs-mode .ace_cursor{\
|
||||
border: 2px rgba(50,250,50,0.8) solid!important;\
|
||||
-moz-box-sizing: border-box!important;\
|
||||
-webkit-box-sizing: border-box!important;\
|
||||
box-sizing: border-box!important;\
|
||||
background-color: rgba(0,250,0,0.9);\
|
||||
opacity: 0.5;\
|
||||
}\
|
||||
.emacs-mode .ace_cursor.ace_hidden{\
|
||||
opacity: 1;\
|
||||
background-color: transparent;\
|
||||
}\
|
||||
.emacs-mode .ace_overwrite-cursors .ace_cursor {\
|
||||
opacity: 1;\
|
||||
background-color: transparent;\
|
||||
border-width: 0 0 2px 2px !important;\
|
||||
}\
|
||||
.emacs-mode .ace_text-layer {\
|
||||
z-index: 4\
|
||||
}\
|
||||
.emacs-mode .ace_cursor-layer {\
|
||||
z-index: 2\
|
||||
}', 'emacsMode'
|
||||
);
|
||||
}
|
||||
|
||||
editor.renderer.screenToTextCoordinates = screenToTextBlockCoordinates;
|
||||
editor.setStyle("emacs-mode");
|
||||
};
|
||||
|
||||
exports.handler.detach = function(editor) {
|
||||
delete editor.renderer.screenToTextCoordinates;
|
||||
editor.unsetStyle("emacs-mode");
|
||||
};
|
||||
|
||||
|
||||
var keys = require("../lib/keys").KEY_MODS;
|
||||
var eMods = {
|
||||
C: "ctrl", S: "shift", M: "alt"
|
||||
};
|
||||
["S-C-M", "S-C", "S-M", "C-M", "S", "C", "M"].forEach(function(c) {
|
||||
var hashId = 0;
|
||||
c.split("-").forEach(function(c){
|
||||
hashId = hashId | keys[eMods[c]];
|
||||
});
|
||||
eMods[hashId] = c.toLowerCase() + "-";
|
||||
});
|
||||
|
||||
exports.handler.bindKey = function(key, command) {
|
||||
if (!key)
|
||||
return;
|
||||
|
||||
var ckb = this.commmandKeyBinding;
|
||||
key.split("|").forEach(function(keyPart) {
|
||||
keyPart = keyPart.toLowerCase();
|
||||
ckb[keyPart] = command;
|
||||
keyPart = keyPart.split(" ")[0];
|
||||
if (!ckb[keyPart])
|
||||
ckb[keyPart] = "null";
|
||||
}, this);
|
||||
};
|
||||
|
||||
|
||||
exports.handler.handleKeyboard = function(data, hashId, key, keyCode) {
|
||||
if (hashId == -1) {
|
||||
if (data.count) {
|
||||
var str = Array(data.count + 1).join(key);
|
||||
data.count = null;
|
||||
return {command: "insertstring", args: str};
|
||||
}
|
||||
}
|
||||
|
||||
if (key == "\x00")
|
||||
return;
|
||||
|
||||
var modifier = eMods[hashId];
|
||||
if (modifier == "c-" || data.universalArgument) {
|
||||
var count = parseInt(key[key.length - 1]);
|
||||
if (count) {
|
||||
data.count = count;
|
||||
return {command: "null"};
|
||||
}
|
||||
}
|
||||
data.universalArgument = false;
|
||||
|
||||
if (modifier)
|
||||
key = modifier + key;
|
||||
|
||||
if (data.keyChain)
|
||||
key = data.keyChain += " " + key;
|
||||
|
||||
var command = this.commmandKeyBinding[key];
|
||||
data.keyChain = command == "null" ? key : "";
|
||||
|
||||
if (!command)
|
||||
return;
|
||||
|
||||
if (command == "null")
|
||||
return {command: "null"};
|
||||
|
||||
if (command == "universalArgument") {
|
||||
data.universalArgument = true;
|
||||
return {command: "null"};
|
||||
}
|
||||
|
||||
if (typeof command != "string") {
|
||||
var args = command.args;
|
||||
command = command.command;
|
||||
}
|
||||
|
||||
if (typeof command == "string") {
|
||||
command = this.commands[command] || data.editor.commands.commands[command];
|
||||
}
|
||||
|
||||
if (!command.readonly && !command.isYank)
|
||||
data.lastCommand = null;
|
||||
|
||||
if (data.count) {
|
||||
var count = data.count;
|
||||
data.count = 0;
|
||||
return {
|
||||
args: args,
|
||||
command: {
|
||||
exec: function(editor, args) {
|
||||
for (var i = 0; i < count; i++)
|
||||
command.exec(editor, args);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return {command: command, args: args};
|
||||
};
|
||||
|
||||
exports.emacsKeys = {
|
||||
// movement
|
||||
"Up|C-p" : "golineup",
|
||||
"Down|C-n" : "golinedown",
|
||||
"Left|C-b" : "gotoleft",
|
||||
"Right|C-f" : "gotoright",
|
||||
"C-Left|M-b" : "gotowordleft",
|
||||
"C-Right|M-f" : "gotowordright",
|
||||
"Home|C-a" : "gotolinestart",
|
||||
"End|C-e" : "gotolineend",
|
||||
"C-Home|S-M-,": "gotostart",
|
||||
"C-End|S-M-." : "gotoend",
|
||||
|
||||
// selection
|
||||
"S-Up|S-C-p" : "selectup",
|
||||
"S-Down|S-C-n" : "selectdown",
|
||||
"S-Left|S-C-b" : "selectleft",
|
||||
"S-Right|S-C-f" : "selectright",
|
||||
"S-C-Left|S-M-b" : "selectwordleft",
|
||||
"S-C-Right|S-M-f" : "selectwordright",
|
||||
"S-Home|S-C-a" : "selecttolinestart",
|
||||
"S-End|S-C-e" : "selecttolineend",
|
||||
"S-C-Home" : "selecttostart",
|
||||
"S-C-End" : "selecttoend",
|
||||
|
||||
"C-l" : "recenterTopBottom",
|
||||
"M-s" : "centerselection",
|
||||
"M-g": "gotoline",
|
||||
"C-x C-p": "selectall",
|
||||
|
||||
// todo fix these
|
||||
"C-Down": "gotopagedown",
|
||||
"C-Up": "gotopageup",
|
||||
"PageDown|C-v": "gotopagedown",
|
||||
"PageUp|M-v": "gotopageup",
|
||||
"S-C-Down": "selectpagedown",
|
||||
"S-C-Up": "selectpageup",
|
||||
"C-s": "findnext",
|
||||
"C-r": "findprevious",
|
||||
"M-C-s": "findnext",
|
||||
"M-C-r": "findprevious",
|
||||
"S-M-5": "replace",
|
||||
|
||||
// basic editing
|
||||
"Backspace": "backspace",
|
||||
"Delete|C-d": "del",
|
||||
"Return|C-m": {command: "insertstring", args: "\n"}, // "newline"
|
||||
"C-o": "splitline",
|
||||
|
||||
"M-d|C-Delete": {command: "killWord", args: "right"},
|
||||
"C-Backspace|M-Backspace|M-Delete": {command: "killWord", args: "left"},
|
||||
"C-k": "killLine",
|
||||
|
||||
"C-y|S-Delete": "yank",
|
||||
"M-y": "yankRotate",
|
||||
"C-g": "keyboardQuit",
|
||||
|
||||
"C-w": "killRegion",
|
||||
"M-w": "killRingSave",
|
||||
|
||||
"C-Space": "setMark",
|
||||
"C-x C-x": "exchangePointAndMark",
|
||||
|
||||
"C-t": "transposeletters",
|
||||
|
||||
"M-u": "touppercase",
|
||||
"M-l": "tolowercase",
|
||||
"M-/": "autocomplete",
|
||||
"C-u": "universalArgument",
|
||||
"M-;": "togglecomment",
|
||||
|
||||
"C-/|C-x u|S-C--|C-z": "undo",
|
||||
"S-C-/|S-C-x u|C--|S-C-z": "redo", //infinite undo?
|
||||
// vertical editing
|
||||
"C-x r": "selectRectangularRegion"
|
||||
|
||||
// todo
|
||||
// "M-x" "C-x C-t" "M-t" "M-c" "F11" "C-M- "M-q"
|
||||
};
|
||||
|
||||
|
||||
exports.handler.bindKeys(exports.emacsKeys);
|
||||
|
||||
exports.handler.addCommands({
|
||||
recenterTopBottom: function(editor) {
|
||||
var renderer = editor.renderer;
|
||||
var pos = renderer.$cursorLayer.getPixelPosition();
|
||||
var h = renderer.$size.scrollerHeight - renderer.lineHeight;
|
||||
var scrollTop = renderer.scrollTop;
|
||||
if (Math.abs(pos.top - scrollTop) < 2) {
|
||||
scrollTop = pos.top - h;
|
||||
} else if (Math.abs(pos.top - scrollTop - h * 0.5) < 2) {
|
||||
scrollTop = pos.top;
|
||||
} else {
|
||||
scrollTop = pos.top - h * 0.5;
|
||||
}
|
||||
editor.session.setScrollTop(scrollTop);
|
||||
},
|
||||
selectRectangularRegion: function(editor) {
|
||||
editor.multiSelect.toggleBlockSelection();
|
||||
},
|
||||
setMark: function() {
|
||||
},
|
||||
exchangePointAndMark: {
|
||||
exec: function(editor) {
|
||||
var range = editor.selection.getRange();
|
||||
editor.selection.setSelectionRange(range, !editor.selection.isBackwards());
|
||||
},
|
||||
readonly: true,
|
||||
multiselectAction: "forEach"
|
||||
},
|
||||
killWord: {
|
||||
exec: function(editor, dir) {
|
||||
editor.clearSelection();
|
||||
if (dir == "left")
|
||||
editor.selection.selectWordLeft();
|
||||
else
|
||||
editor.selection.selectWordRight();
|
||||
|
||||
var range = editor.getSelectionRange();
|
||||
var text = editor.session.getTextRange(range);
|
||||
exports.killRing.add(text);
|
||||
|
||||
editor.session.remove(range);
|
||||
editor.clearSelection();
|
||||
},
|
||||
multiselectAction: "forEach"
|
||||
},
|
||||
killLine: function(editor) {
|
||||
editor.selection.selectLine();
|
||||
var range = editor.getSelectionRange();
|
||||
var text = editor.session.getTextRange(range);
|
||||
exports.killRing.add(text);
|
||||
|
||||
editor.session.remove(range);
|
||||
editor.clearSelection();
|
||||
},
|
||||
yank: function(editor) {
|
||||
editor.onPaste(exports.killRing.get());
|
||||
editor.keyBinding.$data.lastCommand = "yank";
|
||||
},
|
||||
yankRotate: function(editor) {
|
||||
if (editor.keyBinding.$data.lastCommand != "yank")
|
||||
return;
|
||||
|
||||
editor.undo();
|
||||
editor.onPaste(exports.killRing.rotate());
|
||||
editor.keyBinding.$data.lastCommand = "yank";
|
||||
},
|
||||
killRegion: function(editor) {
|
||||
exports.killRing.add(editor.getCopyText());
|
||||
editor.commands.byName.cut.exec(editor);
|
||||
},
|
||||
killRingSave: function(editor) {
|
||||
exports.killRing.add(editor.getCopyText());
|
||||
}
|
||||
});
|
||||
|
||||
var commands = exports.handler.commands;
|
||||
commands.yank.isYank = true;
|
||||
commands.yankRotate.isYank = true;
|
||||
|
||||
exports.killRing = {
|
||||
$data: [],
|
||||
add: function(str) {
|
||||
str && this.$data.push(str);
|
||||
if (this.$data.length > 30)
|
||||
this.$data.shift();
|
||||
},
|
||||
get: function() {
|
||||
return this.$data[this.$data.length - 1] || "";
|
||||
},
|
||||
pop: function() {
|
||||
if (this.$data.length > 1)
|
||||
this.$data.pop();
|
||||
return this.get();
|
||||
},
|
||||
rotate: function() {
|
||||
this.$data.unshift(this.$data.pop());
|
||||
return this.get();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
});
|
||||
@@ -1,380 +0,0 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Distributed under the BSD license:
|
||||
*
|
||||
* Copyright (c) 2010, Ajax.org B.V.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of Ajax.org B.V. nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var event = require("../lib/event");
|
||||
var useragent = require("../lib/useragent");
|
||||
var dom = require("../lib/dom");
|
||||
|
||||
var TextInput = function(parentNode, host) {
|
||||
var text = dom.createElement("textarea");
|
||||
text.className = "ace_text-input";
|
||||
/*/ debug
|
||||
text.style.opacity = 1
|
||||
text.style.background = "rgba(0, 250, 0, 0.3)"
|
||||
text.style.outline = "rgba(0, 250, 0, 0.8) solid 1px"
|
||||
text.style.outlineOffset = "3px"
|
||||
/**/
|
||||
if (useragent.isTouchPad)
|
||||
text.setAttribute("x-palm-disable-auto-cap", true);
|
||||
|
||||
text.wrap = "off";
|
||||
text.spellcheck = false;
|
||||
|
||||
text.style.top = "-2em";
|
||||
parentNode.insertBefore(text, parentNode.firstChild);
|
||||
|
||||
var PLACEHOLDER = useragent.isIE || useragent.isOpera ? "\x01\x01" : "\x00\x00";
|
||||
|
||||
resetValue();
|
||||
|
||||
if (isFocused())
|
||||
host.onFocus();
|
||||
|
||||
// Somehow fixes problem with firing onpropertychange on first typed char
|
||||
if (useragent.isOldIE) {
|
||||
resetSelection();
|
||||
resetValue();
|
||||
setTimeout(resetSelection);
|
||||
}
|
||||
|
||||
var cut = false
|
||||
var copied = false;
|
||||
var pasted = false;
|
||||
|
||||
var inCompostion = false;
|
||||
|
||||
var resetTimeout = null;
|
||||
|
||||
var tempStyle = '';
|
||||
|
||||
function resetValue() {
|
||||
text.value = PLACEHOLDER;
|
||||
//http://code.google.com/p/chromium/issues/detail?id=76516
|
||||
if (useragent.isWebKit && !resetTimeout)
|
||||
resetTimeout = setTimeout(function(){
|
||||
text.value = PLACEHOLDER;
|
||||
resetSelection();
|
||||
resetTimeout = null;
|
||||
});
|
||||
};
|
||||
|
||||
function resetSelection(isEmpty) {
|
||||
var selectionStart = isEmpty ? 2 : 1;
|
||||
var selectionEnd = 2;
|
||||
// on firefox this throws if textarea is hidden
|
||||
try {
|
||||
if (text.setSelectionRange) {
|
||||
text.setSelectionRange(selectionStart, selectionEnd);
|
||||
}
|
||||
// IE8 does not support setSelectionRange
|
||||
else if (text.createTextRange) {
|
||||
var range = text.createTextRange();
|
||||
range.collapse(true);
|
||||
range.moveEnd('character', selectionEnd);
|
||||
range.moveStart('character', selectionStart);
|
||||
range.select();
|
||||
}
|
||||
} catch(e){}
|
||||
};
|
||||
|
||||
var onSelect = function(e) {
|
||||
if (cut) {
|
||||
cut = false;
|
||||
return;
|
||||
}
|
||||
if (copied) {
|
||||
copied = false;
|
||||
return;
|
||||
}
|
||||
if (text.selectionStart === 0 && text.selectionEnd === text.value.length) {
|
||||
host.selectAll();
|
||||
resetSelection();
|
||||
}
|
||||
};
|
||||
|
||||
var onInput = function(e) {
|
||||
if (inCompostion)
|
||||
return;
|
||||
|
||||
if (pasted) {
|
||||
var data = text.value;
|
||||
resetValue();
|
||||
if (data)
|
||||
host.onPaste(data);
|
||||
pasted = false;
|
||||
return;
|
||||
}
|
||||
|
||||
var data = text.value;
|
||||
if (data.substring(0, 2) == PLACEHOLDER)
|
||||
data = data.substr(2);
|
||||
else
|
||||
data = data.substr(1);
|
||||
|
||||
resetValue();
|
||||
if (data) {
|
||||
// can happen if undo in textarea isn't stopped
|
||||
if (data[data.length - 1] == PLACEHOLDER[0])
|
||||
data = data.slice(0, -1);
|
||||
if (data)
|
||||
host.onTextInput(data);
|
||||
} else
|
||||
host.onDelete();
|
||||
};
|
||||
|
||||
var onCompositionStart = function(e) {
|
||||
inCompostion = true;
|
||||
host.onCompositionStart();
|
||||
setTimeout(onCompositionUpdate, 0);
|
||||
};
|
||||
|
||||
var onCompositionUpdate = function() {
|
||||
if (!inCompostion) return;
|
||||
host.onCompositionUpdate(text.value);
|
||||
};
|
||||
|
||||
var onCompositionEnd = function(e) {
|
||||
inCompostion = false;
|
||||
host.onCompositionEnd();
|
||||
};
|
||||
|
||||
var onCut = function(e) {
|
||||
var data = host.getCopyText();
|
||||
if (!data) {
|
||||
event.preventDefault(e);
|
||||
return;
|
||||
}
|
||||
|
||||
var clipboardData = e.clipboardData || window.clipboardData;
|
||||
|
||||
if (clipboardData) {
|
||||
// Safari 5 has clipboardData object, but does not handle setData()
|
||||
var supported = clipboardData.setData("Text", data);
|
||||
if (supported) {
|
||||
host.onCut();
|
||||
event.preventDefault(e);
|
||||
}
|
||||
}
|
||||
|
||||
if (!supported) {
|
||||
cut = true;
|
||||
text.value = data;
|
||||
text.select();
|
||||
setTimeout(function(){
|
||||
cut = false;
|
||||
resetValue();
|
||||
resetSelection();
|
||||
host.onCut();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var onCopy = function(e) {
|
||||
var data = host.getCopyText();
|
||||
if (!data) {
|
||||
event.preventDefault(e);
|
||||
return;
|
||||
}
|
||||
|
||||
var clipboardData = e.clipboardData || window.clipboardData;
|
||||
|
||||
if (clipboardData) {
|
||||
// Safari 5 has clipboardData object, but does not handle setData()
|
||||
var supported = clipboardData.setData("Text", data);
|
||||
if (supported) {
|
||||
host.onCopy();
|
||||
event.preventDefault(e);
|
||||
}
|
||||
}
|
||||
if (!supported) {
|
||||
copied = true;
|
||||
text.value = data;
|
||||
text.select();
|
||||
setTimeout(function(){
|
||||
copied = false;
|
||||
resetValue();
|
||||
resetSelection();
|
||||
host.onCopy();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
var onPaste = function(e) {
|
||||
var clipboardData = e.clipboardData || window.clipboardData;
|
||||
|
||||
if (clipboardData) {
|
||||
var data = clipboardData.getData("Text");
|
||||
if (data)
|
||||
host.onPaste(data);
|
||||
event.preventDefault(e);
|
||||
}
|
||||
else {
|
||||
text.value = "";
|
||||
pasted = true;
|
||||
}
|
||||
};
|
||||
|
||||
event.addCommandKeyListener(text, host.onCommandKey.bind(host));
|
||||
|
||||
event.addListener(text, "select", onSelect);
|
||||
|
||||
event.addListener(text, "input", onInput);
|
||||
|
||||
event.addListener(text, "cut", onCut);
|
||||
event.addListener(text, "copy", onCopy);
|
||||
event.addListener(text, "paste", onPaste);
|
||||
|
||||
|
||||
// Opera has no clipboard events
|
||||
if (!('oncut' in text) || !('oncopy' in text) || !('onpaste' in text)){
|
||||
event.addListener(parentNode, "keydown", function(e) {
|
||||
if ((useragent.isMac && !e.metaKey) || !e.ctrlKey)
|
||||
return;
|
||||
|
||||
switch (e.keyCode) {
|
||||
case 67:
|
||||
onCopy(e);
|
||||
break;
|
||||
case 86:
|
||||
onPaste(e);
|
||||
break;
|
||||
case 88:
|
||||
onCut(e);
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (useragent.isOldIE) {
|
||||
event.addListener(text, "propertychange", function(e){
|
||||
if (text.value != "" && text.value != PLACEHOLDER)
|
||||
onInput(e);
|
||||
});
|
||||
|
||||
var keytable = { 13:1, 27:1 };
|
||||
event.addListener(text, "keyup", function (e) {
|
||||
if (inCompostion && (!text.value || keytable[e.keyCode]))
|
||||
setTimeout(onCompositionEnd, 0);
|
||||
if ((text.value.charCodeAt(0)|0) < 129) {
|
||||
return;
|
||||
}
|
||||
inCompostion ? onCompositionUpdate() : onCompositionStart();
|
||||
});
|
||||
}
|
||||
|
||||
event.addListener(text, "compositionstart", onCompositionStart);
|
||||
if (useragent.isGecko) {
|
||||
event.addListener(text, "text", onCompositionUpdate);
|
||||
}
|
||||
if (useragent.isWebKit) {
|
||||
event.addListener(text, "keyup", onCompositionUpdate);
|
||||
}
|
||||
event.addListener(text, "compositionend", onCompositionEnd);
|
||||
|
||||
event.addListener(text, "blur", function() {
|
||||
host.onBlur();
|
||||
});
|
||||
|
||||
event.addListener(text, "focus", function() {
|
||||
host.onFocus();
|
||||
resetSelection();
|
||||
});
|
||||
|
||||
this.focus = function() {
|
||||
text.focus();
|
||||
};
|
||||
|
||||
this.blur = function() {
|
||||
text.blur();
|
||||
};
|
||||
|
||||
function isFocused() {
|
||||
return document.activeElement === text;
|
||||
}
|
||||
this.isFocused = isFocused;
|
||||
|
||||
this.getElement = function() {
|
||||
return text;
|
||||
};
|
||||
|
||||
this.onContextMenu = function(e) {
|
||||
if (!tempStyle)
|
||||
tempStyle = text.style.cssText;
|
||||
|
||||
text.style.cssText =
|
||||
"position:fixed; z-index:100000;" +
|
||||
(useragent.isIE ? "background:rgba(0, 0, 0, 0.03); opacity:0.1;" : "") + //"background:rgba(250, 0, 0, 0.3); opacity:1;" +
|
||||
"left:" + (e.clientX - 2) + "px; top:" + (e.clientY - 2) + "px;";
|
||||
|
||||
resetSelection(host.selection.isEmpty());
|
||||
|
||||
if (e.type != "mousedown")
|
||||
return;
|
||||
|
||||
if (host.renderer.$keepTextAreaAtCursor)
|
||||
host.renderer.$keepTextAreaAtCursor = null;
|
||||
|
||||
// on windows context menu is opened after mouseup
|
||||
if (useragent.isWin)
|
||||
event.capture(host.container, function(e) {
|
||||
text.style.left = e.clientX - 2 + "px";
|
||||
text.style.top = e.clientY - 2 + "px";
|
||||
}, onContextMenuClose);
|
||||
};
|
||||
|
||||
function onContextMenuClose() {
|
||||
setTimeout(function () {
|
||||
if (tempStyle) {
|
||||
text.style.cssText = tempStyle;
|
||||
tempStyle = '';
|
||||
}
|
||||
if (host.renderer.$keepTextAreaAtCursor == null) {
|
||||
host.renderer.$keepTextAreaAtCursor = true;
|
||||
host.renderer.$moveTextAreaToCursor();
|
||||
}
|
||||
}, 0);
|
||||
};
|
||||
this.onContextMenuClose = onContextMenuClose;
|
||||
|
||||
// firefox fires contextmenu event after opening it
|
||||
if (!useragent.isGecko)
|
||||
event.addListener(text, "contextmenu", function(e) {
|
||||
host.textInput.onContextMenu(e);
|
||||
onContextMenuClose();
|
||||
});
|
||||
};
|
||||
|
||||
exports.TextInput = TextInput;
|
||||
});
|
||||
@@ -1,149 +0,0 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Distributed under the BSD license:
|
||||
*
|
||||
* Copyright (c) 2010, Ajax.org B.V.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of Ajax.org B.V. nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var cmds = require("./vim/commands");
|
||||
var coreCommands = cmds.coreCommands;
|
||||
var util = require("./vim/maps/util");
|
||||
var useragent = require("../lib/useragent");
|
||||
|
||||
var startCommands = {
|
||||
"i": {
|
||||
command: coreCommands.start
|
||||
},
|
||||
"I": {
|
||||
command: coreCommands.startBeginning
|
||||
},
|
||||
"a": {
|
||||
command: coreCommands.append
|
||||
},
|
||||
"A": {
|
||||
command: coreCommands.appendEnd
|
||||
},
|
||||
"ctrl-f": {
|
||||
command: "gotopagedown"
|
||||
},
|
||||
"ctrl-b": {
|
||||
command: "gotopageup"
|
||||
}
|
||||
};
|
||||
|
||||
exports.handler = {
|
||||
// workaround for j not repeating with `defaults write -g ApplePressAndHoldEnabled -bool true`
|
||||
handleMacRepeat: function(data, hashId, key) {
|
||||
if (hashId == -1) {
|
||||
// record key
|
||||
data.inputChar = key;
|
||||
data.lastEvent = "input";
|
||||
} else if (data.inputChar && data.$lastHash == hashId && data.$lastKey == key) {
|
||||
// check for repeated keypress
|
||||
if (data.lastEvent == "input") {
|
||||
data.lastEvent = "input1";
|
||||
} else if (data.lastEvent == "input1") {
|
||||
// simulate textinput
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
// reset
|
||||
data.$lastHash = hashId;
|
||||
data.$lastKey = key;
|
||||
data.lastEvent = "keypress";
|
||||
}
|
||||
},
|
||||
|
||||
handleKeyboard: function(data, hashId, key, keyCode, e) {
|
||||
// ignore command keys (shift, ctrl etc.)
|
||||
if (hashId != 0 && (key == "" || key == "\x00"))
|
||||
return null;
|
||||
|
||||
if (hashId == 1)
|
||||
key = "ctrl-" + key;
|
||||
|
||||
if ((key == "esc" && hashId == 0) || key == "ctrl-[") {
|
||||
return {command: coreCommands.stop};
|
||||
} else if (data.state == "start") {
|
||||
if (useragent.isMac && this.handleMacRepeat(data, hashId, key)) {
|
||||
hashId = -1;
|
||||
key = data.inputChar;
|
||||
}
|
||||
|
||||
if (hashId == -1 || hashId == 1) {
|
||||
if (cmds.inputBuffer.idle && startCommands[key])
|
||||
return startCommands[key];
|
||||
return {
|
||||
command: {
|
||||
exec: function(editor) {cmds.inputBuffer.push(editor, key);}
|
||||
}
|
||||
};
|
||||
} // if no modifier || shift: wait for input.
|
||||
else if (key.length == 1 && (hashId == 0 || hashId == 4)) {
|
||||
return {command: "null", passEvent: true};
|
||||
} else if (key == "esc" && hashId == 0) {
|
||||
return {command: coreCommands.stop};
|
||||
}
|
||||
} else {
|
||||
if (key == "ctrl-w") {
|
||||
return {command: "removewordleft"};
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
attach: function(editor) {
|
||||
editor.on("click", exports.onCursorMove);
|
||||
if (util.currentMode !== "insert")
|
||||
cmds.coreCommands.stop.exec(editor);
|
||||
editor.$vimModeHandler = this;
|
||||
},
|
||||
|
||||
detach: function(editor) {
|
||||
editor.removeListener("click", exports.onCursorMove);
|
||||
util.noMode(editor);
|
||||
util.currentMode = "normal";
|
||||
},
|
||||
|
||||
actions: cmds.actions,
|
||||
getStatusText: function() {
|
||||
if (util.currentMode == "insert")
|
||||
return "INSERT";
|
||||
if (util.onVisualMode)
|
||||
return (util.onVisualLineMode ? "VISUAL LINE " : "VISUAL ") + cmds.inputBuffer.status;
|
||||
return cmds.inputBuffer.status;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
exports.onCursorMove = function(e) {
|
||||
cmds.onCursorMove(e.editor, e);
|
||||
exports.onCursorMove.scheduled = false;
|
||||
};
|
||||
|
||||
});
|
||||
-561
@@ -1,561 +0,0 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Distributed under the BSD license:
|
||||
*
|
||||
* Copyright (c) 2010, Ajax.org B.V.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of Ajax.org B.V. nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
"never use strict";
|
||||
|
||||
var util = require("./maps/util");
|
||||
var motions = require("./maps/motions");
|
||||
var operators = require("./maps/operators");
|
||||
var alias = require("./maps/aliases");
|
||||
var registers = require("./registers");
|
||||
|
||||
var NUMBER = 1;
|
||||
var OPERATOR = 2;
|
||||
var MOTION = 3;
|
||||
var ACTION = 4;
|
||||
var HMARGIN = 8; // Minimum amount of line separation between margins;
|
||||
|
||||
var repeat = function repeat(fn, count, args) {
|
||||
while (0 < count--)
|
||||
fn.apply(this, args);
|
||||
};
|
||||
|
||||
var ensureScrollMargin = function(editor) {
|
||||
var renderer = editor.renderer;
|
||||
var pos = renderer.$cursorLayer.getPixelPosition();
|
||||
|
||||
var top = pos.top;
|
||||
|
||||
var margin = HMARGIN * renderer.layerConfig.lineHeight;
|
||||
if (2 * margin > renderer.$size.scrollerHeight)
|
||||
margin = renderer.$size.scrollerHeight / 2;
|
||||
|
||||
if (renderer.scrollTop > top - margin) {
|
||||
renderer.session.setScrollTop(top - margin);
|
||||
}
|
||||
|
||||
if (renderer.scrollTop + renderer.$size.scrollerHeight < top + margin + renderer.lineHeight) {
|
||||
renderer.session.setScrollTop(top + margin + renderer.lineHeight - renderer.$size.scrollerHeight);
|
||||
}
|
||||
};
|
||||
|
||||
var actions = exports.actions = {
|
||||
"z": {
|
||||
param: true,
|
||||
fn: function(editor, range, count, param) {
|
||||
switch (param) {
|
||||
case "z":
|
||||
editor.renderer.alignCursor(null, 0.5);
|
||||
break;
|
||||
case "t":
|
||||
editor.renderer.alignCursor(null, 0);
|
||||
break;
|
||||
case "b":
|
||||
editor.renderer.alignCursor(null, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
"r": {
|
||||
param: true,
|
||||
fn: function(editor, range, count, param) {
|
||||
if (param && param.length) {
|
||||
repeat(function() { editor.insert(param); }, count || 1);
|
||||
editor.navigateLeft();
|
||||
}
|
||||
}
|
||||
},
|
||||
"R": {
|
||||
fn: function(editor, range, count, param) {
|
||||
util.insertMode(editor);
|
||||
editor.setOverwrite(true);
|
||||
}
|
||||
},
|
||||
"~": {
|
||||
fn: function(editor, range, count) {
|
||||
repeat(function() {
|
||||
var range = editor.selection.getRange();
|
||||
if (range.isEmpty())
|
||||
range.end.column++;
|
||||
var text = editor.session.getTextRange(range);
|
||||
var toggled = text.toUpperCase();
|
||||
if (toggled == text)
|
||||
editor.navigateRight();
|
||||
else
|
||||
editor.session.replace(range, toggled);
|
||||
}, count || 1);
|
||||
}
|
||||
},
|
||||
"*": {
|
||||
fn: function(editor, range, count, param) {
|
||||
editor.selection.selectWord();
|
||||
editor.findNext();
|
||||
ensureScrollMargin(editor);
|
||||
var r = editor.selection.getRange();
|
||||
editor.selection.setSelectionRange(r, true);
|
||||
}
|
||||
},
|
||||
"#": {
|
||||
fn: function(editor, range, count, param) {
|
||||
editor.selection.selectWord();
|
||||
editor.findPrevious();
|
||||
ensureScrollMargin(editor);
|
||||
var r = editor.selection.getRange();
|
||||
editor.selection.setSelectionRange(r, true);
|
||||
}
|
||||
},
|
||||
"n": {
|
||||
fn: function(editor, range, count, param) {
|
||||
var options = editor.getLastSearchOptions();
|
||||
options.backwards = false;
|
||||
|
||||
editor.selection.moveCursorRight();
|
||||
editor.selection.clearSelection();
|
||||
editor.findNext(options);
|
||||
|
||||
ensureScrollMargin(editor);
|
||||
var r = editor.selection.getRange();
|
||||
r.end.row = r.start.row;
|
||||
r.end.column = r.start.column;
|
||||
editor.selection.setSelectionRange(r, true);
|
||||
}
|
||||
},
|
||||
"N": {
|
||||
fn: function(editor, range, count, param) {
|
||||
var options = editor.getLastSearchOptions();
|
||||
options.backwards = true;
|
||||
|
||||
editor.findPrevious(options);
|
||||
ensureScrollMargin(editor);
|
||||
var r = editor.selection.getRange();
|
||||
r.end.row = r.start.row;
|
||||
r.end.column = r.start.column;
|
||||
editor.selection.setSelectionRange(r, true);
|
||||
}
|
||||
},
|
||||
"v": {
|
||||
fn: function(editor, range, count, param) {
|
||||
editor.selection.selectRight();
|
||||
util.visualMode(editor, false);
|
||||
},
|
||||
acceptsMotion: true
|
||||
},
|
||||
"V": {
|
||||
fn: function(editor, range, count, param) {
|
||||
//editor.selection.selectLine();
|
||||
//editor.selection.selectLeft();
|
||||
var row = editor.getCursorPosition().row;
|
||||
editor.selection.clearSelection();
|
||||
editor.selection.moveCursorTo(row, 0);
|
||||
editor.selection.selectLineEnd();
|
||||
editor.selection.visualLineStart = row;
|
||||
|
||||
util.visualMode(editor, true);
|
||||
},
|
||||
acceptsMotion: true
|
||||
},
|
||||
"Y": {
|
||||
fn: function(editor, range, count, param) {
|
||||
util.copyLine(editor);
|
||||
}
|
||||
},
|
||||
"p": {
|
||||
fn: function(editor, range, count, param) {
|
||||
var defaultReg = registers._default;
|
||||
|
||||
editor.setOverwrite(false);
|
||||
if (defaultReg.isLine) {
|
||||
var pos = editor.getCursorPosition();
|
||||
var lines = defaultReg.text.split("\n");
|
||||
editor.session.getDocument().insertLines(pos.row + 1, lines);
|
||||
editor.moveCursorTo(pos.row + 1, 0);
|
||||
}
|
||||
else {
|
||||
editor.navigateRight();
|
||||
editor.insert(defaultReg.text);
|
||||
editor.navigateLeft();
|
||||
}
|
||||
editor.setOverwrite(true);
|
||||
editor.selection.clearSelection();
|
||||
}
|
||||
},
|
||||
"P": {
|
||||
fn: function(editor, range, count, param) {
|
||||
var defaultReg = registers._default;
|
||||
editor.setOverwrite(false);
|
||||
|
||||
if (defaultReg.isLine) {
|
||||
var pos = editor.getCursorPosition();
|
||||
var lines = defaultReg.text.split("\n");
|
||||
editor.session.getDocument().insertLines(pos.row, lines);
|
||||
editor.moveCursorTo(pos.row, 0);
|
||||
}
|
||||
else {
|
||||
editor.insert(defaultReg.text);
|
||||
}
|
||||
editor.setOverwrite(true);
|
||||
editor.selection.clearSelection();
|
||||
}
|
||||
},
|
||||
"J": {
|
||||
fn: function(editor, range, count, param) {
|
||||
var session = editor.session;
|
||||
range = editor.getSelectionRange();
|
||||
var pos = {row: range.start.row, column: range.start.column};
|
||||
count = count || range.end.row - range.start.row;
|
||||
var maxRow = Math.min(pos.row + (count || 1), session.getLength() - 1);
|
||||
|
||||
range.start.column = session.getLine(pos.row).length;
|
||||
range.end.column = session.getLine(maxRow).length;
|
||||
range.end.row = maxRow;
|
||||
|
||||
var text = "";
|
||||
for (var i = pos.row; i < maxRow; i++) {
|
||||
var nextLine = session.getLine(i + 1);
|
||||
text += " " + /^\s*(.*)$/.exec(nextLine)[1] || "";
|
||||
}
|
||||
|
||||
session.replace(range, text);
|
||||
editor.moveCursorTo(pos.row, pos.column);
|
||||
}
|
||||
},
|
||||
"u": {
|
||||
fn: function(editor, range, count, param) {
|
||||
count = parseInt(count || 1, 10);
|
||||
for (var i = 0; i < count; i++) {
|
||||
editor.undo();
|
||||
}
|
||||
editor.selection.clearSelection();
|
||||
}
|
||||
},
|
||||
"ctrl-r": {
|
||||
fn: function(editor, range, count, param) {
|
||||
count = parseInt(count || 1, 10);
|
||||
for (var i = 0; i < count; i++) {
|
||||
editor.redo();
|
||||
}
|
||||
editor.selection.clearSelection();
|
||||
}
|
||||
},
|
||||
":": {
|
||||
fn: function(editor, range, count, param) {
|
||||
// not implemented
|
||||
}
|
||||
},
|
||||
"/": {
|
||||
fn: function(editor, range, count, param) {
|
||||
// not implemented
|
||||
}
|
||||
},
|
||||
"?": {
|
||||
fn: function(editor, range, count, param) {
|
||||
// not implemented
|
||||
}
|
||||
},
|
||||
".": {
|
||||
fn: function(editor, range, count, param) {
|
||||
util.onInsertReplaySequence = inputBuffer.lastInsertCommands;
|
||||
var previous = inputBuffer.previous;
|
||||
if (previous) // If there is a previous action
|
||||
inputBuffer.exec(editor, previous.action, previous.param);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var inputBuffer = exports.inputBuffer = {
|
||||
accepting: [NUMBER, OPERATOR, MOTION, ACTION],
|
||||
currentCmd: null,
|
||||
//currentMode: 0,
|
||||
currentCount: "",
|
||||
status: "",
|
||||
|
||||
// Types
|
||||
operator: null,
|
||||
motion: null,
|
||||
|
||||
lastInsertCommands: [],
|
||||
|
||||
push: function(editor, ch, keyId) {
|
||||
this.idle = false;
|
||||
var wObj = this.waitingForParam;
|
||||
if (wObj) {
|
||||
this.exec(editor, wObj, ch);
|
||||
}
|
||||
// If input is a number (that doesn't start with 0)
|
||||
else if (!(ch === "0" && !this.currentCount.length) &&
|
||||
(ch.match(/^\d+$/) && this.isAccepting(NUMBER))) {
|
||||
// Assuming that ch is always of type String, and not Number
|
||||
this.currentCount += ch;
|
||||
this.currentCmd = NUMBER;
|
||||
this.accepting = [NUMBER, OPERATOR, MOTION, ACTION];
|
||||
}
|
||||
else if (!this.operator && this.isAccepting(OPERATOR) && operators[ch]) {
|
||||
this.operator = {
|
||||
ch: ch,
|
||||
count: this.getCount()
|
||||
};
|
||||
this.currentCmd = OPERATOR;
|
||||
this.accepting = [NUMBER, MOTION, ACTION];
|
||||
this.exec(editor, { operator: this.operator });
|
||||
}
|
||||
else if (motions[ch] && this.isAccepting(MOTION)) {
|
||||
this.currentCmd = MOTION;
|
||||
|
||||
var ctx = {
|
||||
operator: this.operator,
|
||||
motion: {
|
||||
ch: ch,
|
||||
count: this.getCount()
|
||||
}
|
||||
};
|
||||
|
||||
if (motions[ch].param)
|
||||
this.waitForParam(ctx);
|
||||
else
|
||||
this.exec(editor, ctx);
|
||||
}
|
||||
else if (alias[ch] && this.isAccepting(MOTION)) {
|
||||
alias[ch].operator.count = this.getCount();
|
||||
this.exec(editor, alias[ch]);
|
||||
}
|
||||
else if (actions[ch] && this.isAccepting(ACTION)) {
|
||||
var actionObj = {
|
||||
action: {
|
||||
fn: actions[ch].fn,
|
||||
count: this.getCount()
|
||||
}
|
||||
};
|
||||
|
||||
if (actions[ch].param) {
|
||||
this.waitForParam(actionObj);
|
||||
}
|
||||
else {
|
||||
this.exec(editor, actionObj);
|
||||
}
|
||||
|
||||
if (actions[ch].acceptsMotion)
|
||||
this.idle = false;
|
||||
}
|
||||
else if (this.operator) {
|
||||
this.exec(editor, { operator: this.operator }, ch);
|
||||
}
|
||||
else {
|
||||
this.reset();
|
||||
}
|
||||
|
||||
if (this.waitingForParam || this.motion || this.operator) {
|
||||
this.status += ch;
|
||||
} else if (this.currentCount) {
|
||||
this.status = this.currentCount;
|
||||
} else if (this.status) {
|
||||
this.status = "";
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
editor._emit("changeStatus");
|
||||
},
|
||||
|
||||
waitForParam: function(cmd) {
|
||||
this.waitingForParam = cmd;
|
||||
},
|
||||
|
||||
getCount: function() {
|
||||
var count = this.currentCount;
|
||||
this.currentCount = "";
|
||||
return count && parseInt(count, 10);
|
||||
},
|
||||
|
||||
exec: function(editor, action, param) {
|
||||
var m = action.motion;
|
||||
var o = action.operator;
|
||||
var a = action.action;
|
||||
|
||||
if (!param)
|
||||
param = action.param;
|
||||
|
||||
if (o) {
|
||||
this.previous = {
|
||||
action: action,
|
||||
param: param
|
||||
};
|
||||
}
|
||||
|
||||
if (o && !editor.selection.isEmpty()) {
|
||||
if (operators[o.ch].selFn) {
|
||||
operators[o.ch].selFn(editor, editor.getSelectionRange(), o.count, param);
|
||||
this.reset();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// There is an operator, but no motion or action. We try to pass the
|
||||
// current ch to the operator to see if it responds to it (an example
|
||||
// of this is the 'dd' operator).
|
||||
else if (!m && !a && o && param) {
|
||||
operators[o.ch].fn(editor, null, o.count, param);
|
||||
this.reset();
|
||||
}
|
||||
else if (m) {
|
||||
var run = function(fn) {
|
||||
if (fn && typeof fn === "function") { // There should always be a motion
|
||||
if (m.count && !motionObj.handlesCount)
|
||||
repeat(fn, m.count, [editor, null, m.count, param]);
|
||||
else
|
||||
fn(editor, null, m.count, param);
|
||||
}
|
||||
};
|
||||
|
||||
var motionObj = motions[m.ch];
|
||||
var selectable = motionObj.sel;
|
||||
|
||||
if (!o) {
|
||||
if ((util.onVisualMode || util.onVisualLineMode) && selectable)
|
||||
run(motionObj.sel);
|
||||
else
|
||||
run(motionObj.nav);
|
||||
}
|
||||
else if (selectable) {
|
||||
repeat(function() {
|
||||
run(motionObj.sel);
|
||||
operators[o.ch].fn(editor, editor.getSelectionRange(), o.count, param);
|
||||
}, o.count || 1);
|
||||
}
|
||||
this.reset();
|
||||
}
|
||||
else if (a) {
|
||||
a.fn(editor, editor.getSelectionRange(), a.count, param);
|
||||
this.reset();
|
||||
}
|
||||
handleCursorMove(editor);
|
||||
},
|
||||
|
||||
isAccepting: function(type) {
|
||||
return this.accepting.indexOf(type) !== -1;
|
||||
},
|
||||
|
||||
reset: function() {
|
||||
this.operator = null;
|
||||
this.motion = null;
|
||||
this.currentCount = "";
|
||||
this.status = "";
|
||||
this.accepting = [NUMBER, OPERATOR, MOTION, ACTION];
|
||||
this.idle = true;
|
||||
this.waitingForParam = null;
|
||||
}
|
||||
};
|
||||
|
||||
function setPreviousCommand(fn) {
|
||||
inputBuffer.previous = { action: { action: { fn: fn } } };
|
||||
}
|
||||
|
||||
exports.coreCommands = {
|
||||
start: {
|
||||
exec: function start(editor) {
|
||||
util.insertMode(editor);
|
||||
setPreviousCommand(start);
|
||||
}
|
||||
},
|
||||
startBeginning: {
|
||||
exec: function startBeginning(editor) {
|
||||
editor.navigateLineStart();
|
||||
util.insertMode(editor);
|
||||
setPreviousCommand(startBeginning);
|
||||
}
|
||||
},
|
||||
// Stop Insert mode as soon as possible. Works like typing <Esc> in
|
||||
// insert mode.
|
||||
stop: {
|
||||
exec: function stop(editor) {
|
||||
inputBuffer.reset();
|
||||
util.onVisualMode = false;
|
||||
util.onVisualLineMode = false;
|
||||
inputBuffer.lastInsertCommands = util.normalMode(editor);
|
||||
}
|
||||
},
|
||||
append: {
|
||||
exec: function append(editor) {
|
||||
var pos = editor.getCursorPosition();
|
||||
var lineLen = editor.session.getLine(pos.row).length;
|
||||
if (lineLen)
|
||||
editor.navigateRight();
|
||||
util.insertMode(editor);
|
||||
setPreviousCommand(append);
|
||||
}
|
||||
},
|
||||
appendEnd: {
|
||||
exec: function appendEnd(editor) {
|
||||
editor.navigateLineEnd();
|
||||
util.insertMode(editor);
|
||||
setPreviousCommand(appendEnd);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var handleCursorMove = exports.onCursorMove = function(editor, e) {
|
||||
if (util.currentMode === 'insert' || handleCursorMove.running)
|
||||
return;
|
||||
else if(!editor.selection.isEmpty()) {
|
||||
handleCursorMove.running = true;
|
||||
if (util.onVisualLineMode) {
|
||||
var originRow = editor.selection.visualLineStart;
|
||||
var cursorRow = editor.getCursorPosition().row;
|
||||
if(originRow <= cursorRow) {
|
||||
var endLine = editor.session.getLine(cursorRow);
|
||||
editor.selection.clearSelection();
|
||||
editor.selection.moveCursorTo(originRow, 0);
|
||||
editor.selection.selectTo(cursorRow, endLine.length);
|
||||
} else {
|
||||
var endLine = editor.session.getLine(originRow);
|
||||
editor.selection.clearSelection();
|
||||
editor.selection.moveCursorTo(originRow, endLine.length);
|
||||
editor.selection.selectTo(cursorRow, 0);
|
||||
}
|
||||
}
|
||||
handleCursorMove.running = false;
|
||||
return;
|
||||
}
|
||||
else {
|
||||
if (e && (util.onVisualLineMode || util.onVisualMode)) {
|
||||
editor.selection.clearSelection();
|
||||
util.normalMode(editor);
|
||||
}
|
||||
|
||||
handleCursorMove.running = true;
|
||||
var pos = editor.getCursorPosition();
|
||||
var lineLen = editor.session.getLine(pos.row).length;
|
||||
|
||||
if (lineLen && pos.column === lineLen)
|
||||
editor.navigateLeft();
|
||||
handleCursorMove.running = false;
|
||||
}
|
||||
};
|
||||
});
|
||||
-94
@@ -1,94 +0,0 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Distributed under the BSD license:
|
||||
*
|
||||
* Copyright (c) 2010, Ajax.org B.V.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of Ajax.org B.V. nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
"use strict"
|
||||
|
||||
define(function(require, exports, module) {
|
||||
module.exports = {
|
||||
"x": {
|
||||
operator: {
|
||||
ch: "d",
|
||||
count: 1
|
||||
},
|
||||
motion: {
|
||||
ch: "l",
|
||||
count: 1
|
||||
}
|
||||
},
|
||||
"X": {
|
||||
operator: {
|
||||
ch: "d",
|
||||
count: 1
|
||||
},
|
||||
motion: {
|
||||
ch: "h",
|
||||
count: 1
|
||||
}
|
||||
},
|
||||
"D": {
|
||||
operator: {
|
||||
ch: "d",
|
||||
count: 1
|
||||
},
|
||||
motion: {
|
||||
ch: "$",
|
||||
count: 1
|
||||
}
|
||||
},
|
||||
"C": {
|
||||
operator: {
|
||||
ch: "c",
|
||||
count: 1
|
||||
},
|
||||
motion: {
|
||||
ch: "$",
|
||||
count: 1
|
||||
}
|
||||
},
|
||||
"s": {
|
||||
operator: {
|
||||
ch: "c",
|
||||
count: 1
|
||||
},
|
||||
motion: {
|
||||
ch: "l",
|
||||
count: 1
|
||||
}
|
||||
},
|
||||
"S": {
|
||||
operator: {
|
||||
ch: "c",
|
||||
count: 1
|
||||
},
|
||||
param: "c"
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
-593
@@ -1,593 +0,0 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Distributed under the BSD license:
|
||||
*
|
||||
* Copyright (c) 2010, Ajax.org B.V.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of Ajax.org B.V. nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
|
||||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var util = require("./util");
|
||||
|
||||
var keepScrollPosition = function(editor, fn) {
|
||||
var scrollTopRow = editor.renderer.getScrollTopRow();
|
||||
var initialRow = editor.getCursorPosition().row;
|
||||
var diff = initialRow - scrollTopRow;
|
||||
fn && fn.call(editor);
|
||||
editor.renderer.scrollToRow(editor.getCursorPosition().row - diff);
|
||||
};
|
||||
|
||||
function Motion(m) {
|
||||
if (typeof m == "function") {
|
||||
var getPos = m;
|
||||
m = this;
|
||||
} else {
|
||||
var getPos = m.getPos;
|
||||
}
|
||||
m.nav = function(editor, range, count, param) {
|
||||
var a = getPos(editor, range, count, param, false);
|
||||
if (!a)
|
||||
return;
|
||||
editor.clearSelection();
|
||||
editor.moveCursorTo(a.row, a.column);
|
||||
};
|
||||
m.sel = function(editor, range, count, param) {
|
||||
var a = getPos(editor, range, count, param, true);
|
||||
if (!a)
|
||||
return;
|
||||
editor.selection.selectTo(a.row, a.column);
|
||||
};
|
||||
return m;
|
||||
}
|
||||
|
||||
var nonWordRe = /[\s.\/\\()\"'-:,.;<>~!@#$%^&*|+=\[\]{}`~?]/;
|
||||
var wordSeparatorRe = /[.\/\\()\"'-:,.;<>~!@#$%^&*|+=\[\]{}`~?]/;
|
||||
var whiteRe = /\s/;
|
||||
var StringStream = function(editor, cursor) {
|
||||
var sel = editor.selection;
|
||||
this.range = sel.getRange();
|
||||
cursor = cursor || sel.selectionLead;
|
||||
this.row = cursor.row;
|
||||
this.col = cursor.column;
|
||||
var line = editor.session.getLine(this.row);
|
||||
var maxRow = editor.session.getLength();
|
||||
this.ch = line[this.col] || '\n';
|
||||
this.skippedLines = 0;
|
||||
|
||||
this.next = function() {
|
||||
this.ch = line[++this.col] || this.handleNewLine(1);
|
||||
//this.debug()
|
||||
return this.ch;
|
||||
};
|
||||
this.prev = function() {
|
||||
this.ch = line[--this.col] || this.handleNewLine(-1);
|
||||
//this.debug()
|
||||
return this.ch;
|
||||
};
|
||||
this.peek = function(dir) {
|
||||
var ch = line[this.col + dir];
|
||||
if (ch)
|
||||
return ch;
|
||||
if (dir == -1)
|
||||
return '\n';
|
||||
if (this.col == line.length - 1)
|
||||
return '\n';
|
||||
return editor.session.getLine(this.row + 1)[0] || '\n';
|
||||
};
|
||||
|
||||
this.handleNewLine = function(dir) {
|
||||
if (dir == 1){
|
||||
if (this.col == line.length)
|
||||
return '\n';
|
||||
if (this.row == maxRow - 1)
|
||||
return '';
|
||||
this.col = 0;
|
||||
this.row ++;
|
||||
line = editor.session.getLine(this.row);
|
||||
this.skippedLines++;
|
||||
return line[0] || '\n';
|
||||
}
|
||||
if (dir == -1) {
|
||||
if (this.row === 0)
|
||||
return '';
|
||||
this.row --;
|
||||
line = editor.session.getLine(this.row);
|
||||
this.col = line.length;
|
||||
this.skippedLines--;
|
||||
return '\n';
|
||||
}
|
||||
};
|
||||
this.debug = function() {
|
||||
console.log(line.substring(0, this.col)+'|'+this.ch+'\''+this.col+'\''+line.substr(this.col+1));
|
||||
};
|
||||
};
|
||||
|
||||
var Search = require("../../../search").Search;
|
||||
var search = new Search();
|
||||
|
||||
function find(editor, needle, dir) {
|
||||
search.$options.needle = needle;
|
||||
search.$options.backwards = dir == -1;
|
||||
return search.find(editor.session);
|
||||
}
|
||||
|
||||
var Range = require("../../../range").Range;
|
||||
|
||||
module.exports = {
|
||||
"w": new Motion(function(editor) {
|
||||
var str = new StringStream(editor);
|
||||
|
||||
if (str.ch && wordSeparatorRe.test(str.ch)) {
|
||||
while (str.ch && wordSeparatorRe.test(str.ch))
|
||||
str.next();
|
||||
} else {
|
||||
while (str.ch && !nonWordRe.test(str.ch))
|
||||
str.next();
|
||||
}
|
||||
while (str.ch && whiteRe.test(str.ch) && str.skippedLines < 2)
|
||||
str.next();
|
||||
|
||||
str.skippedLines == 2 && str.prev();
|
||||
return {column: str.col, row: str.row};
|
||||
}),
|
||||
"W": new Motion(function(editor) {
|
||||
var str = new StringStream(editor);
|
||||
while(str.ch && !(whiteRe.test(str.ch) && !whiteRe.test(str.peek(1))) && str.skippedLines < 2)
|
||||
str.next();
|
||||
if (str.skippedLines == 2)
|
||||
str.prev();
|
||||
else
|
||||
str.next();
|
||||
|
||||
return {column: str.col, row: str.row};
|
||||
}),
|
||||
"b": new Motion(function(editor) {
|
||||
var str = new StringStream(editor);
|
||||
|
||||
str.prev();
|
||||
while (str.ch && whiteRe.test(str.ch) && str.skippedLines > -2)
|
||||
str.prev();
|
||||
|
||||
if (str.ch && wordSeparatorRe.test(str.ch)) {
|
||||
while (str.ch && wordSeparatorRe.test(str.ch))
|
||||
str.prev();
|
||||
} else {
|
||||
while (str.ch && !nonWordRe.test(str.ch))
|
||||
str.prev();
|
||||
}
|
||||
str.ch && str.next();
|
||||
return {column: str.col, row: str.row};
|
||||
}),
|
||||
"B": new Motion(function(editor) {
|
||||
var str = new StringStream(editor);
|
||||
str.prev();
|
||||
while(str.ch && !(!whiteRe.test(str.ch) && whiteRe.test(str.peek(-1))) && str.skippedLines > -2)
|
||||
str.prev();
|
||||
|
||||
if (str.skippedLines == -2)
|
||||
str.next();
|
||||
|
||||
return {column: str.col, row: str.row};
|
||||
}),
|
||||
"e": new Motion(function(editor) {
|
||||
var str = new StringStream(editor);
|
||||
|
||||
str.next();
|
||||
while (str.ch && whiteRe.test(str.ch))
|
||||
str.next();
|
||||
|
||||
if (str.ch && wordSeparatorRe.test(str.ch)) {
|
||||
while (str.ch && wordSeparatorRe.test(str.ch))
|
||||
str.next();
|
||||
} else {
|
||||
while (str.ch && !nonWordRe.test(str.ch))
|
||||
str.next();
|
||||
}
|
||||
str.ch && str.prev();
|
||||
return {column: str.col, row: str.row};
|
||||
}),
|
||||
"E": new Motion(function(editor) {
|
||||
var str = new StringStream(editor);
|
||||
str.next();
|
||||
while(str.ch && !(!whiteRe.test(str.ch) && whiteRe.test(str.peek(1))))
|
||||
str.next();
|
||||
|
||||
return {column: str.col, row: str.row};
|
||||
}),
|
||||
|
||||
"l": {
|
||||
nav: function(editor) {
|
||||
editor.navigateRight();
|
||||
},
|
||||
sel: function(editor) {
|
||||
var pos = editor.getCursorPosition();
|
||||
var col = pos.column;
|
||||
var lineLen = editor.session.getLine(pos.row).length;
|
||||
|
||||
// Solving the behavior at the end of the line due to the
|
||||
// different 0 index-based colum positions in ACE.
|
||||
if (lineLen && col !== lineLen) //In selection mode you can select the newline
|
||||
editor.selection.selectRight();
|
||||
}
|
||||
},
|
||||
"h": {
|
||||
nav: function(editor) {
|
||||
var pos = editor.getCursorPosition();
|
||||
if (pos.column > 0)
|
||||
editor.navigateLeft();
|
||||
},
|
||||
sel: function(editor) {
|
||||
var pos = editor.getCursorPosition();
|
||||
if (pos.column > 0)
|
||||
editor.selection.selectLeft();
|
||||
}
|
||||
},
|
||||
"H": {
|
||||
nav: function(editor) {
|
||||
var row = editor.renderer.getScrollTopRow();
|
||||
editor.moveCursorTo(row);
|
||||
},
|
||||
sel: function(editor) {
|
||||
var row = editor.renderer.getScrollTopRow();
|
||||
editor.selection.selectTo(row);
|
||||
}
|
||||
},
|
||||
"M": {
|
||||
nav: function(editor) {
|
||||
var topRow = editor.renderer.getScrollTopRow();
|
||||
var bottomRow = editor.renderer.getScrollBottomRow();
|
||||
var row = topRow + ((bottomRow - topRow) / 2);
|
||||
editor.moveCursorTo(row);
|
||||
},
|
||||
sel: function(editor) {
|
||||
var topRow = editor.renderer.getScrollTopRow();
|
||||
var bottomRow = editor.renderer.getScrollBottomRow();
|
||||
var row = topRow + ((bottomRow - topRow) / 2);
|
||||
editor.selection.selectTo(row);
|
||||
}
|
||||
},
|
||||
"L": {
|
||||
nav: function(editor) {
|
||||
var row = editor.renderer.getScrollBottomRow();
|
||||
editor.moveCursorTo(row);
|
||||
},
|
||||
sel: function(editor) {
|
||||
var row = editor.renderer.getScrollBottomRow();
|
||||
editor.selection.selectTo(row);
|
||||
}
|
||||
},
|
||||
"k": {
|
||||
nav: function(editor) {
|
||||
editor.navigateUp();
|
||||
},
|
||||
sel: function(editor) {
|
||||
editor.selection.selectUp();
|
||||
}
|
||||
},
|
||||
"j": {
|
||||
nav: function(editor) {
|
||||
editor.navigateDown();
|
||||
},
|
||||
sel: function(editor) {
|
||||
editor.selection.selectDown();
|
||||
}
|
||||
},
|
||||
|
||||
"i": {
|
||||
param: true,
|
||||
sel: function(editor, range, count, param) {
|
||||
switch (param) {
|
||||
case "w":
|
||||
editor.selection.selectWord();
|
||||
break;
|
||||
case "W":
|
||||
editor.selection.selectAWord();
|
||||
break;
|
||||
case "(":
|
||||
case "{":
|
||||
case "[":
|
||||
var cursor = editor.getCursorPosition();
|
||||
var end = editor.session.$findClosingBracket(param, cursor, /paren/);
|
||||
if (!end)
|
||||
return;
|
||||
var start = editor.session.$findOpeningBracket(editor.session.$brackets[param], cursor, /paren/);
|
||||
if (!start)
|
||||
return;
|
||||
start.column ++;
|
||||
editor.selection.setSelectionRange(Range.fromPoints(start, end));
|
||||
break;
|
||||
case "'":
|
||||
case '"':
|
||||
case "/":
|
||||
var end = find(editor, param, 1);
|
||||
if (!end)
|
||||
return;
|
||||
var start = find(editor, param, -1);
|
||||
if (!start)
|
||||
return;
|
||||
editor.selection.setSelectionRange(Range.fromPoints(start.end, end.start));
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
"a": {
|
||||
param: true,
|
||||
sel: function(editor, range, count, param) {
|
||||
switch (param) {
|
||||
case "w":
|
||||
editor.selection.selectAWord();
|
||||
break;
|
||||
case "W":
|
||||
editor.selection.selectAWord();
|
||||
break;
|
||||
case "(":
|
||||
case "{":
|
||||
case "[":
|
||||
var cursor = editor.getCursorPosition();
|
||||
var end = editor.session.$findClosingBracket(param, cursor, /paren/);
|
||||
if (!end)
|
||||
return;
|
||||
var start = editor.session.$findOpeningBracket(editor.session.$brackets[param], cursor, /paren/);
|
||||
if (!start)
|
||||
return;
|
||||
end.column ++;
|
||||
editor.selection.setSelectionRange(Range.fromPoints(start, end));
|
||||
break;
|
||||
case "'":
|
||||
case "\"":
|
||||
case "/":
|
||||
var end = find(editor, param, 1);
|
||||
if (!end)
|
||||
return;
|
||||
var start = find(editor, param, -1);
|
||||
if (!start)
|
||||
return;
|
||||
end.column ++;
|
||||
editor.selection.setSelectionRange(Range.fromPoints(start.start, end.end));
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"f": new Motion({
|
||||
param: true,
|
||||
handlesCount: true,
|
||||
getPos: function(editor, range, count, param, isSel) {
|
||||
var cursor = editor.getCursorPosition();
|
||||
var column = util.getRightNthChar(editor, cursor, param, count || 1);
|
||||
|
||||
if (typeof column === "number") {
|
||||
cursor.column += column + (isSel ? 2 : 1);
|
||||
return cursor;
|
||||
}
|
||||
}
|
||||
}),
|
||||
"F": new Motion({
|
||||
param: true,
|
||||
handlesCount: true,
|
||||
getPos: function(editor, range, count, param, isSel) {
|
||||
var cursor = editor.getCursorPosition();
|
||||
var column = util.getLeftNthChar(editor, cursor, param, count || 1);
|
||||
|
||||
if (typeof column === "number") {
|
||||
cursor.column -= column + 1;
|
||||
return cursor;
|
||||
}
|
||||
}
|
||||
}),
|
||||
"t": new Motion({
|
||||
param: true,
|
||||
handlesCount: true,
|
||||
getPos: function(editor, range, count, param, isSel) {
|
||||
var cursor = editor.getCursorPosition();
|
||||
var column = util.getRightNthChar(editor, cursor, param, count || 1);
|
||||
|
||||
if (typeof column === "number") {
|
||||
cursor.column += column + (isSel ? 1 : 0);
|
||||
return cursor;
|
||||
}
|
||||
}
|
||||
}),
|
||||
"T": new Motion({
|
||||
param: true,
|
||||
handlesCount: true,
|
||||
getPos: function(editor, range, count, param, isSel) {
|
||||
var cursor = editor.getCursorPosition();
|
||||
var column = util.getLeftNthChar(editor, cursor, param, count || 1);
|
||||
|
||||
if (typeof column === "number") {
|
||||
cursor.column -= column;
|
||||
return cursor;
|
||||
}
|
||||
}
|
||||
}),
|
||||
|
||||
"^": {
|
||||
nav: function(editor) {
|
||||
editor.navigateLineStart();
|
||||
},
|
||||
sel: function(editor) {
|
||||
editor.selection.selectLineStart();
|
||||
}
|
||||
},
|
||||
"$": {
|
||||
nav: function(editor) {
|
||||
editor.navigateLineEnd();
|
||||
},
|
||||
sel: function(editor) {
|
||||
editor.selection.selectLineEnd();
|
||||
}
|
||||
},
|
||||
"0": new Motion(function(ed) {
|
||||
return {row: ed.selection.lead.row, column: 0};
|
||||
}),
|
||||
"G": {
|
||||
nav: function(editor, range, count, param) {
|
||||
if (!count && count !== 0) { // Stupid JS
|
||||
count = editor.session.getLength();
|
||||
}
|
||||
editor.gotoLine(count);
|
||||
},
|
||||
sel: function(editor, range, count, param) {
|
||||
if (!count && count !== 0) { // Stupid JS
|
||||
count = editor.session.getLength();
|
||||
}
|
||||
editor.selection.selectTo(count, 0);
|
||||
}
|
||||
},
|
||||
"g": {
|
||||
param: true,
|
||||
nav: function(editor, range, count, param) {
|
||||
switch(param) {
|
||||
case "m":
|
||||
console.log("Middle line");
|
||||
break;
|
||||
case "e":
|
||||
console.log("End of prev word");
|
||||
break;
|
||||
case "g":
|
||||
editor.gotoLine(count || 0);
|
||||
case "u":
|
||||
editor.gotoLine(count || 0);
|
||||
case "U":
|
||||
editor.gotoLine(count || 0);
|
||||
}
|
||||
},
|
||||
sel: function(editor, range, count, param) {
|
||||
switch(param) {
|
||||
case "m":
|
||||
console.log("Middle line");
|
||||
break;
|
||||
case "e":
|
||||
console.log("End of prev word");
|
||||
break;
|
||||
case "g":
|
||||
editor.selection.selectTo(count || 0, 0);
|
||||
}
|
||||
}
|
||||
},
|
||||
"o": {
|
||||
nav: function(editor, range, count, param) {
|
||||
count = count || 1;
|
||||
var content = "";
|
||||
while (0 < count--)
|
||||
content += "\n";
|
||||
|
||||
if (content.length) {
|
||||
editor.navigateLineEnd()
|
||||
editor.insert(content);
|
||||
util.insertMode(editor);
|
||||
}
|
||||
}
|
||||
},
|
||||
"O": {
|
||||
nav: function(editor, range, count, param) {
|
||||
var row = editor.getCursorPosition().row;
|
||||
count = count || 1;
|
||||
var content = "";
|
||||
while (0 < count--)
|
||||
content += "\n";
|
||||
|
||||
if (content.length) {
|
||||
if(row > 0) {
|
||||
editor.navigateUp();
|
||||
editor.navigateLineEnd()
|
||||
editor.insert(content);
|
||||
} else {
|
||||
editor.session.insert({row: 0, column: 0}, content);
|
||||
editor.navigateUp();
|
||||
}
|
||||
util.insertMode(editor);
|
||||
}
|
||||
}
|
||||
},
|
||||
"%": new Motion(function(editor){
|
||||
var brRe = /[\[\]{}()]/g;
|
||||
var cursor = editor.getCursorPosition();
|
||||
var ch = editor.session.getLine(cursor.row)[cursor.column];
|
||||
if (!brRe.test(ch)) {
|
||||
var range = find(editor, brRe);
|
||||
if (!range)
|
||||
return;
|
||||
cursor = range.start;
|
||||
}
|
||||
var match = editor.session.findMatchingBracket({
|
||||
row: cursor.row,
|
||||
column: cursor.column + 1
|
||||
});
|
||||
|
||||
return match;
|
||||
}),
|
||||
"{": new Motion(function(ed) {
|
||||
var session = ed.session;
|
||||
var row = session.selection.lead.row;
|
||||
while(row > 0 && !/\S/.test(session.getLine(row)))
|
||||
row--;
|
||||
while(/\S/.test(session.getLine(row)))
|
||||
row--;
|
||||
return {column: 0, row: row};
|
||||
}),
|
||||
"}": new Motion(function(ed) {
|
||||
var session = ed.session;
|
||||
var l = session.getLength();
|
||||
var row = session.selection.lead.row;
|
||||
while(row < l && !/\S/.test(session.getLine(row)))
|
||||
row++;
|
||||
while(/\S/.test(session.getLine(row)))
|
||||
row++;
|
||||
return {column: 0, row: row};
|
||||
}),
|
||||
"ctrl-d": {
|
||||
nav: function(editor, range, count, param) {
|
||||
editor.selection.clearSelection();
|
||||
keepScrollPosition(editor, editor.gotoPageDown);
|
||||
},
|
||||
sel: function(editor, range, count, param) {
|
||||
keepScrollPosition(editor, editor.selectPageDown);
|
||||
}
|
||||
},
|
||||
"ctrl-u": {
|
||||
nav: function(editor, range, count, param) {
|
||||
editor.selection.clearSelection();
|
||||
keepScrollPosition(editor, editor.gotoPageUp);
|
||||
|
||||
},
|
||||
sel: function(editor, range, count, param) {
|
||||
keepScrollPosition(editor, editor.selectPageUp);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
module.exports.backspace = module.exports.left = module.exports.h;
|
||||
module.exports.right = module.exports.l;
|
||||
module.exports.up = module.exports.k;
|
||||
module.exports.down = module.exports.j;
|
||||
module.exports.pagedown = module.exports["ctrl-d"];
|
||||
module.exports.pageup = module.exports["ctrl-u"];
|
||||
|
||||
});
|
||||
-196
@@ -1,196 +0,0 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Distributed under the BSD license:
|
||||
*
|
||||
* Copyright (c) 2010, Ajax.org B.V.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of Ajax.org B.V. nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
"never use strict";
|
||||
|
||||
var util = require("./util");
|
||||
var registers = require("../registers");
|
||||
|
||||
module.exports = {
|
||||
"d": {
|
||||
selFn: function(editor, range, count, param) {
|
||||
registers._default.text = editor.getCopyText();
|
||||
registers._default.isLine = util.onVisualLineMode;
|
||||
if(util.onVisualLineMode)
|
||||
editor.removeLines();
|
||||
else
|
||||
editor.session.remove(range);
|
||||
util.normalMode(editor);
|
||||
},
|
||||
fn: function(editor, range, count, param) {
|
||||
count = count || 1;
|
||||
switch (param) {
|
||||
case "d":
|
||||
registers._default.text = "";
|
||||
registers._default.isLine = true;
|
||||
for (var i = 0; i < count; i++) {
|
||||
editor.selection.selectLine();
|
||||
registers._default.text += editor.getCopyText();
|
||||
var selRange = editor.getSelectionRange();
|
||||
// check if end of the document was reached
|
||||
if (!selRange.isMultiLine()) {
|
||||
lastLineReached = true
|
||||
var row = selRange.start.row - 1;
|
||||
var col = editor.session.getLine(row).length
|
||||
selRange.setStart(row, col);
|
||||
editor.session.remove(selRange);
|
||||
editor.selection.clearSelection();
|
||||
break;
|
||||
}
|
||||
editor.session.remove(selRange);
|
||||
editor.selection.clearSelection();
|
||||
}
|
||||
registers._default.text = registers._default.text.replace(/\n$/, "");
|
||||
break;
|
||||
default:
|
||||
if (range) {
|
||||
editor.selection.setSelectionRange(range);
|
||||
registers._default.text = editor.getCopyText();
|
||||
registers._default.isLine = false;
|
||||
editor.session.remove(range);
|
||||
editor.selection.clearSelection();
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"c": {
|
||||
selFn: function(editor, range, count, param) {
|
||||
editor.session.remove(range);
|
||||
util.insertMode(editor);
|
||||
},
|
||||
fn: function(editor, range, count, param) {
|
||||
count = count || 1;
|
||||
switch (param) {
|
||||
case "c":
|
||||
for (var i = 0; i < count; i++) {
|
||||
editor.removeLines();
|
||||
util.insertMode(editor);
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
if (range) {
|
||||
|
||||
// range.end.column ++;
|
||||
editor.session.remove(range);
|
||||
util.insertMode(editor);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"y": {
|
||||
selFn: function(editor, range, count, param) {
|
||||
registers._default.text = editor.getCopyText();
|
||||
registers._default.isLine = util.onVisualLineMode;
|
||||
editor.selection.clearSelection();
|
||||
util.normalMode(editor);
|
||||
},
|
||||
fn: function(editor, range, count, param) {
|
||||
count = count || 1;
|
||||
switch (param) {
|
||||
case "y":
|
||||
var pos = editor.getCursorPosition();
|
||||
editor.selection.selectLine();
|
||||
for (var i = 0; i < count - 1; i++) {
|
||||
editor.selection.moveCursorDown();
|
||||
}
|
||||
registers._default.text = editor.getCopyText().replace(/\n$/, "");
|
||||
editor.selection.clearSelection();
|
||||
registers._default.isLine = true;
|
||||
editor.moveCursorToPosition(pos);
|
||||
break;
|
||||
default:
|
||||
if (range) {
|
||||
var pos = editor.getCursorPosition();
|
||||
editor.selection.setSelectionRange(range);
|
||||
registers._default.text = editor.getCopyText();
|
||||
registers._default.isLine = false;
|
||||
editor.selection.clearSelection();
|
||||
editor.moveCursorTo(pos.row, pos.column);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
">": {
|
||||
selFn: function(editor, range, count, param) {
|
||||
count = count || 1;
|
||||
for (var i = 0; i < count; i++) {
|
||||
editor.indent();
|
||||
}
|
||||
util.normalMode(editor);
|
||||
},
|
||||
fn: function(editor, range, count, param) {
|
||||
count = parseInt(count || 1, 10);
|
||||
switch (param) {
|
||||
case ">":
|
||||
var pos = editor.getCursorPosition();
|
||||
editor.selection.selectLine();
|
||||
for (var i = 0; i < count - 1; i++) {
|
||||
editor.selection.moveCursorDown();
|
||||
}
|
||||
editor.indent();
|
||||
editor.selection.clearSelection();
|
||||
editor.moveCursorToPosition(pos);
|
||||
editor.navigateLineEnd();
|
||||
editor.navigateLineStart();
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
"<": {
|
||||
selFn: function(editor, range, count, param) {
|
||||
count = count || 1;
|
||||
for (var i = 0; i < count; i++) {
|
||||
editor.blockOutdent();
|
||||
}
|
||||
util.normalMode(editor);
|
||||
},
|
||||
fn: function(editor, range, count, param) {
|
||||
count = count || 1;
|
||||
switch (param) {
|
||||
case "<":
|
||||
var pos = editor.getCursorPosition();
|
||||
editor.selection.selectLine();
|
||||
for (var i = 0; i < count - 1; i++) {
|
||||
editor.selection.moveCursorDown();
|
||||
}
|
||||
editor.blockOutdent();
|
||||
editor.selection.clearSelection();
|
||||
editor.moveCursorToPosition(pos);
|
||||
editor.navigateLineEnd();
|
||||
editor.navigateLineStart();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
-134
@@ -1,134 +0,0 @@
|
||||
define(function(require, exports, module) {
|
||||
var registers = require("../registers");
|
||||
|
||||
var dom = require("../../../lib/dom");
|
||||
dom.importCssString('.insert-mode .ace_cursor{\
|
||||
border-left: 2px solid #333333;\
|
||||
}\
|
||||
.ace_dark.insert-mode .ace_cursor{\
|
||||
border-left: 2px solid #eeeeee;\
|
||||
}\
|
||||
.normal-mode .ace_cursor{\
|
||||
border: 0!important;\
|
||||
background-color: red;\
|
||||
opacity: 0.5;\
|
||||
}', 'vimMode');
|
||||
|
||||
module.exports = {
|
||||
onVisualMode: false,
|
||||
onVisualLineMode: false,
|
||||
currentMode: 'normal',
|
||||
noMode: function(editor) {
|
||||
editor.unsetStyle('insert-mode');
|
||||
editor.unsetStyle('normal-mode');
|
||||
if (editor.commands.recording)
|
||||
editor.commands.toggleRecording(editor);
|
||||
editor.setOverwrite(false);
|
||||
},
|
||||
insertMode: function(editor) {
|
||||
this.currentMode = 'insert';
|
||||
// Switch editor to insert mode
|
||||
editor.setStyle('insert-mode');
|
||||
editor.unsetStyle('normal-mode');
|
||||
|
||||
editor.setOverwrite(false);
|
||||
editor.keyBinding.$data.buffer = "";
|
||||
editor.keyBinding.$data.state = "insertMode";
|
||||
this.onVisualMode = false;
|
||||
this.onVisualLineMode = false;
|
||||
if(this.onInsertReplaySequence) {
|
||||
// Ok, we're apparently replaying ("."), so let's do it
|
||||
editor.commands.macro = this.onInsertReplaySequence;
|
||||
editor.commands.replay(editor);
|
||||
this.onInsertReplaySequence = null;
|
||||
this.normalMode(editor);
|
||||
} else {
|
||||
editor._emit("changeStatus");
|
||||
// Record any movements, insertions in insert mode
|
||||
if(!editor.commands.recording)
|
||||
editor.commands.toggleRecording(editor);
|
||||
}
|
||||
},
|
||||
normalMode: function(editor) {
|
||||
// Switch editor to normal mode
|
||||
this.currentMode = 'normal';
|
||||
|
||||
editor.unsetStyle('insert-mode');
|
||||
editor.setStyle('normal-mode');
|
||||
editor.clearSelection();
|
||||
|
||||
var pos;
|
||||
if (!editor.getOverwrite()) {
|
||||
pos = editor.getCursorPosition();
|
||||
if (pos.column > 0)
|
||||
editor.navigateLeft();
|
||||
}
|
||||
|
||||
editor.setOverwrite(true);
|
||||
editor.keyBinding.$data.buffer = "";
|
||||
editor.keyBinding.$data.state = "start";
|
||||
this.onVisualMode = false;
|
||||
this.onVisualLineMode = false;
|
||||
editor._emit("changeStatus");
|
||||
// Save recorded keystrokes
|
||||
if (editor.commands.recording) {
|
||||
editor.commands.toggleRecording(editor);
|
||||
return editor.commands.macro;
|
||||
}
|
||||
else {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
visualMode: function(editor, lineMode) {
|
||||
if (
|
||||
(this.onVisualLineMode && lineMode)
|
||||
|| (this.onVisualMode && !lineMode)
|
||||
) {
|
||||
this.normalMode(editor);
|
||||
return;
|
||||
}
|
||||
|
||||
editor.setStyle('insert-mode');
|
||||
editor.unsetStyle('normal-mode');
|
||||
|
||||
editor._emit("changeStatus");
|
||||
if (lineMode) {
|
||||
this.onVisualLineMode = true;
|
||||
} else {
|
||||
this.onVisualMode = true;
|
||||
this.onVisualLineMode = false;
|
||||
}
|
||||
},
|
||||
getRightNthChar: function(editor, cursor, ch, n) {
|
||||
var line = editor.getSession().getLine(cursor.row);
|
||||
var matches = line.substr(cursor.column + 1).split(ch);
|
||||
|
||||
return n < matches.length ? matches.slice(0, n).join(ch).length : null;
|
||||
},
|
||||
getLeftNthChar: function(editor, cursor, ch, n) {
|
||||
var line = editor.getSession().getLine(cursor.row);
|
||||
var matches = line.substr(0, cursor.column).split(ch);
|
||||
|
||||
return n < matches.length ? matches.slice(-1 * n).join(ch).length : null;
|
||||
},
|
||||
toRealChar: function(ch) {
|
||||
if (ch.length === 1)
|
||||
return ch;
|
||||
|
||||
if (/^shift-./.test(ch))
|
||||
return ch[ch.length - 1].toUpperCase();
|
||||
else
|
||||
return "";
|
||||
},
|
||||
copyLine: function(editor) {
|
||||
var pos = editor.getCursorPosition();
|
||||
editor.selection.clearSelection();
|
||||
editor.moveCursorTo(pos.row, pos.column);
|
||||
editor.selection.selectLine();
|
||||
registers._default.isLine = true;
|
||||
registers._default.text = editor.getCopyText().replace(/\n$/, "");
|
||||
editor.selection.clearSelection();
|
||||
editor.moveCursorTo(pos.row, pos.column);
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -1,95 +0,0 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Distributed under the BSD license:
|
||||
*
|
||||
* Copyright (c) 2010, Ajax.org B.V.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of Ajax.org B.V. nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var oop = require("./oop");
|
||||
var event = require("./event");
|
||||
var EventEmitter = require("./event_emitter").EventEmitter;
|
||||
|
||||
/*
|
||||
* This class keeps track of the focus state of the given window.
|
||||
* Focus changes for example when the user switches a browser tab,
|
||||
* goes to the location bar or switches to another application.
|
||||
*/
|
||||
var BrowserFocus = function(win) {
|
||||
win = win || window;
|
||||
|
||||
this.lastFocus = new Date().getTime();
|
||||
this._isFocused = true;
|
||||
|
||||
var _self = this;
|
||||
|
||||
// IE < 9 supports focusin and focusout events
|
||||
if ("onfocusin" in win.document) {
|
||||
event.addListener(win.document, "focusin", function(e) {
|
||||
_self._setFocused(true);
|
||||
});
|
||||
|
||||
event.addListener(win.document, "focusout", function(e) {
|
||||
_self._setFocused(!!e.toElement);
|
||||
});
|
||||
}
|
||||
else {
|
||||
event.addListener(win, "blur", function(e) {
|
||||
_self._setFocused(false);
|
||||
});
|
||||
|
||||
event.addListener(win, "focus", function(e) {
|
||||
_self._setFocused(true);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
(function(){
|
||||
|
||||
oop.implement(this, EventEmitter);
|
||||
|
||||
this.isFocused = function() {
|
||||
return this._isFocused;
|
||||
};
|
||||
|
||||
this._setFocused = function(isFocused) {
|
||||
if (this._isFocused == isFocused)
|
||||
return;
|
||||
|
||||
if (isFocused)
|
||||
this.lastFocus = new Date().getTime();
|
||||
|
||||
this._isFocused = isFocused;
|
||||
this._emit("changeFocus");
|
||||
};
|
||||
|
||||
}).call(BrowserFocus.prototype);
|
||||
|
||||
|
||||
exports.BrowserFocus = BrowserFocus;
|
||||
});
|
||||
@@ -1,69 +0,0 @@
|
||||
/*
|
||||
* based on code from:
|
||||
*
|
||||
* @license RequireJS text 0.25.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
|
||||
* Available via the MIT or new BSD license.
|
||||
* see: http://github.com/jrburke/requirejs for details
|
||||
*/
|
||||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var useragent = require("./useragent");
|
||||
|
||||
exports.get = function (url, callback) {
|
||||
var xhr = exports.createXhr();
|
||||
xhr.open('GET', url, true);
|
||||
xhr.onreadystatechange = function (evt) {
|
||||
//Do not explicitly handle errors, those should be
|
||||
//visible via console output in the browser.
|
||||
if (xhr.readyState === 4) {
|
||||
callback(xhr.responseText);
|
||||
}
|
||||
};
|
||||
xhr.send(null);
|
||||
};
|
||||
|
||||
var progIds = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0'];
|
||||
|
||||
exports.createXhr = function() {
|
||||
//Would love to dump the ActiveX crap in here. Need IE 6 to die first.
|
||||
var xhr, i, progId;
|
||||
if (typeof XMLHttpRequest !== "undefined") {
|
||||
return new XMLHttpRequest();
|
||||
} else {
|
||||
for (i = 0; i < 3; i++) {
|
||||
progId = progIds[i];
|
||||
try {
|
||||
xhr = new ActiveXObject(progId);
|
||||
} catch (e) {}
|
||||
|
||||
if (xhr) {
|
||||
progIds = [progId]; // so faster next time
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!xhr) {
|
||||
throw new Error("createXhr(): XMLHttpRequest not available");
|
||||
}
|
||||
|
||||
return xhr;
|
||||
};
|
||||
|
||||
exports.loadScript = function(path, callback) {
|
||||
var head = document.getElementsByTagName('head')[0];
|
||||
var s = document.createElement('script');
|
||||
|
||||
s.src = path;
|
||||
head.appendChild(s);
|
||||
|
||||
if (useragent.isOldIE)
|
||||
s.onreadystatechange = function () {
|
||||
this.readyState == 'loaded' && callback();
|
||||
};
|
||||
else
|
||||
s.onload = callback;
|
||||
};
|
||||
|
||||
});
|
||||
-144
@@ -1,144 +0,0 @@
|
||||
var fs = require("fs");
|
||||
if (!fs.existsSync)
|
||||
fs.existsSync = require("path").existsSync;
|
||||
|
||||
require("amd-loader");
|
||||
|
||||
var cwd = __dirname + "/";
|
||||
|
||||
function generateTestData() {
|
||||
var root = Array(5).join("../") + "/demo/kitchen-sink/docs";
|
||||
var docs = fs.readdirSync(cwd + root);
|
||||
var specialDocs = fs.readdirSync(cwd);
|
||||
var modes = fs.readdirSync(cwd + "../").filter(function(x){
|
||||
return /^\w+_highlight_rules.js$/.test(x);
|
||||
}).map(function(x) {
|
||||
return x.replace(/_highlight_rules.js$/, "");
|
||||
});
|
||||
|
||||
console.log("Docs:", docs);
|
||||
console.log("Modes:", modes);
|
||||
|
||||
docs.forEach(function(docName) {
|
||||
var p = docName.toLowerCase().split(".");
|
||||
if (!p[1])
|
||||
return;
|
||||
var modeName;
|
||||
if (modes.indexOf(p[0]) != -1)
|
||||
modeName = p[0];
|
||||
else if (modes.indexOf(p[1]) != -1)
|
||||
modeName = p[1];
|
||||
else
|
||||
modeName = {"txt": "text", cpp: "c_cpp"}[p[1]];
|
||||
|
||||
var filePath = "text_" + modeName + ".txt";
|
||||
if (specialDocs.indexOf(filePath) == -1) {
|
||||
filePath = root + "/" + docName;
|
||||
}
|
||||
|
||||
var text = fs.readFileSync(cwd + filePath, "utf8");
|
||||
try {
|
||||
var Mode = require("../" + modeName).Mode;
|
||||
} catch(e) {
|
||||
console.warn("Can't load mode :" + modeName, e);
|
||||
return;
|
||||
}
|
||||
var tokenizer = new Mode().getTokenizer();
|
||||
|
||||
var state = "start";
|
||||
var data = text.split(/\n|\r|\r\n/).map(function(line) {
|
||||
var tokens = tokenizer.getLineTokens(line, state);
|
||||
state = tokens.state;
|
||||
tokens = tokens.tokens;
|
||||
return {
|
||||
state: state,
|
||||
data: tokens.map(function(x) {return [x.type, x.value]})
|
||||
};
|
||||
});
|
||||
var jsonStr = JSON.stringify(data, null, 1);
|
||||
jsonStr = jsonStr.replace(/\n {4}/g, " ").replace(/\n {3}]/g, " ]");
|
||||
fs.writeFileSync(cwd + "tokens_" + modeName + ".json", jsonStr, "utf8");
|
||||
});
|
||||
}
|
||||
|
||||
function test(startAt) {
|
||||
var docs = fs.readdirSync(cwd).filter(function(x) {
|
||||
return /^tokens_\w+.json$/.test(x);
|
||||
});
|
||||
if (startAt && startAt > 1)
|
||||
docs = docs.slice(startAt - 1);
|
||||
docs.forEach(function(x, i) {
|
||||
var modeName = x.match(/tokens_(.*).json/)[1];
|
||||
|
||||
console.log(padNumber(i+1, 3) + ") testing: \u001b[33m" + modeName + "\u001b[0m");
|
||||
|
||||
var text = fs.readFileSync(cwd + x, "utf8");
|
||||
var data = JSON.parse(text);
|
||||
var Mode = require("../" + modeName).Mode;
|
||||
var tokenizer = new Mode().getTokenizer();
|
||||
|
||||
var state = "start";
|
||||
data.forEach(function(lineData) {
|
||||
lineData.values = [];
|
||||
lineData.types = [];
|
||||
lineData.data.forEach(function(x) {
|
||||
lineData.types.push(x[0]);
|
||||
lineData.values.push(x[1]);
|
||||
});
|
||||
|
||||
var line = lineData.values.join("");
|
||||
|
||||
var tokens = tokenizer.getLineTokens(line, state);
|
||||
var values = tokens.tokens.map(function(x) {return x.value;});
|
||||
var types = tokens.tokens.map(function(x) {return x.type;});
|
||||
|
||||
var success = true;
|
||||
testEqual([
|
||||
lineData.state, tokens.state,
|
||||
lineData.types, types,
|
||||
lineData.values, values]);
|
||||
|
||||
state = lineData.state;
|
||||
});
|
||||
});
|
||||
|
||||
console.log("\u001b[32m" + "all ok" + "\u001b[0m");
|
||||
|
||||
function testEqual(a) {
|
||||
var err;
|
||||
if (a[0] !== a[1]) {
|
||||
console.log(a[0],a[1]);
|
||||
err = 1;
|
||||
}
|
||||
|
||||
if ( a[2] + "" !== a[3] + "" || a[4] + "" !== a[5] + "") {
|
||||
arrayDiff(a[2],a[3]);
|
||||
arrayDiff(a[4],a[5]);
|
||||
err = 1;
|
||||
}
|
||||
if (err) {
|
||||
throw "error";
|
||||
}
|
||||
}
|
||||
|
||||
function arrayDiff(a1, a2) {
|
||||
var l = Math.max(a1.length, a2.length);
|
||||
var out = [];
|
||||
for (var i = 0; i < l; i++) {
|
||||
out.push("\n", padNumber(i+1, 3), ") ");
|
||||
if (a1[i] !== a2[i])
|
||||
out.push("\u001b[31m", a1[i], " != ", a2[i], "\u001b[0m");
|
||||
else
|
||||
out.push(a1[i]);
|
||||
}
|
||||
console.log(out.join(""));
|
||||
}
|
||||
function padNumber(num, digits) {
|
||||
return (" " + num).slice(-digits);
|
||||
}
|
||||
}
|
||||
|
||||
if (process.argv[2] == "gen")
|
||||
generateTestData(process.argv.splice(3));
|
||||
else
|
||||
test(parseInt(process.argv[2],10) || 0);
|
||||
-175
@@ -1,175 +0,0 @@
|
||||
[
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "Searching for 'var' in /workspace/configs" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "string", "configs/default.js" ],
|
||||
[ "text", ":" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "c9searchresults.constant.numeric", " 1" ],
|
||||
[ "c9searchresults.text", ": " ],
|
||||
[ "c9searchresults.text", "var fs = require(\"fs\");" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "c9searchresults.constant.numeric", "\t2" ],
|
||||
[ "c9searchresults.text", ": " ],
|
||||
[ "c9searchresults.text", "var argv = require('optimist').argv;" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "c9searchresults.constant.numeric", "\t3" ],
|
||||
[ "c9searchresults.text", ": " ],
|
||||
[ "c9searchresults.text", "var path = require(\"path\");" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "c9searchresults.constant.numeric", "\t5" ],
|
||||
[ "c9searchresults.text", ": " ],
|
||||
[ "c9searchresults.text", "var clientExtensions = {};" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "c9searchresults.constant.numeric", "\t6" ],
|
||||
[ "c9searchresults.text", ": " ],
|
||||
[ "c9searchresults.text", "var clientDirs = fs.readdirSync(__dirname + \"/../plugins-client\");" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "c9searchresults.constant.numeric", "\t7" ],
|
||||
[ "c9searchresults.text", ": " ],
|
||||
[ "c9searchresults.text", "for (var i = 0; i < clientDirs.length; i++) {" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "c9searchresults.constant.numeric", "\t8" ],
|
||||
[ "c9searchresults.text", ": " ],
|
||||
[ "c9searchresults.text", "var dir = clientDirs[i];" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "c9searchresults.constant.numeric", "\t12" ],
|
||||
[ "c9searchresults.text", ": " ],
|
||||
[ "c9searchresults.text", "var name = dir.split(\".\")[1];" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "c9searchresults.constant.numeric", "\t16" ],
|
||||
[ "c9searchresults.text", ": " ],
|
||||
[ "c9searchresults.text", "var projectDir = (argv.w && path.resolve(process.cwd(), argv.w)) || process.cwd();" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "c9searchresults.constant.numeric", "\t17" ],
|
||||
[ "c9searchresults.text", ": " ],
|
||||
[ "c9searchresults.text", "var fsUrl = \"/workspace\";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "c9searchresults.constant.numeric", "\t19" ],
|
||||
[ "c9searchresults.text", ": " ],
|
||||
[ "c9searchresults.text", "var port = argv.p || process.env.PORT || 3131;" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "c9searchresults.constant.numeric", "\t20" ],
|
||||
[ "c9searchresults.text", ": " ],
|
||||
[ "c9searchresults.text", "var host = argv.l || \"localhost\";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "c9searchresults.constant.numeric", "\t22" ],
|
||||
[ "c9searchresults.text", ": " ],
|
||||
[ "c9searchresults.text", "var config = {" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "string", "configs/local.js" ],
|
||||
[ "text", ":" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "c9searchresults.constant.numeric", "\t2" ],
|
||||
[ "c9searchresults.text", ": " ],
|
||||
[ "c9searchresults.text", "var config = require(\"./default\");" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "string", "configs/packed.js" ],
|
||||
[ "text", ":" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "c9searchresults.constant.numeric", "\t1" ],
|
||||
[ "c9searchresults.text", ": " ],
|
||||
[ "c9searchresults.text", "var config = require(\"./default\");" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "Found 15 matches in 3 files" ]
|
||||
]
|
||||
}
|
||||
]
|
||||
-124
@@ -1,124 +0,0 @@
|
||||
[
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "// compound assignment operators" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "#include" ],
|
||||
[ "text", " " ],
|
||||
[ "constant", "<iostream>" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword.control", "using" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "namespace" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "std" ],
|
||||
[ "punctuation.operator", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "storage.type", "int" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.name.function", "main" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "paren.rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "storage.type", "int" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "a" ],
|
||||
[ "punctuation.operator", "," ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "b" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "constant.numeric", "3" ],
|
||||
[ "punctuation.operator", ";" ],
|
||||
[ "text", " " ],
|
||||
[ "comment", "/*" ],
|
||||
[ "comment", " foobar */" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "a" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "b" ],
|
||||
[ "punctuation.operator", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "a" ],
|
||||
[ "keyword.operator", "+" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "constant.numeric", "2" ],
|
||||
[ "punctuation.operator", ";" ],
|
||||
[ "text", " " ],
|
||||
[ "comment", "// equivalent to a=a+2" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "cout" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "<" ],
|
||||
[ "keyword.operator", "<" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "a" ],
|
||||
[ "punctuation.operator", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword.control", "return" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "0" ],
|
||||
[ "punctuation.operator", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
}
|
||||
]
|
||||
-248
@@ -1,248 +0,0 @@
|
||||
[
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "(" ],
|
||||
[ "support.function", "defn" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "parting" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "string", "\"returns a String parting in a given language" ],
|
||||
[ "string", "\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "(" ],
|
||||
[ "keyword", "[" ],
|
||||
[ "keyword", "]" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "(" ],
|
||||
[ "identifier", "parting" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\"World" ],
|
||||
[ "string", "\"" ],
|
||||
[ "keyword", ")" ],
|
||||
[ "keyword", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "(" ],
|
||||
[ "keyword", "[" ],
|
||||
[ "support.function", "name" ],
|
||||
[ "keyword", "]" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "(" ],
|
||||
[ "identifier", "parting" ],
|
||||
[ "text", " " ],
|
||||
[ "support.function", "name" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\"en" ],
|
||||
[ "string", "\"" ],
|
||||
[ "keyword", ")" ],
|
||||
[ "keyword", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "(" ],
|
||||
[ "keyword", "[" ],
|
||||
[ "support.function", "name" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "language" ],
|
||||
[ "keyword", "]" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "comment", "; condp is similar to a case statement in other languages." ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "comment", "; It is described in more detail later." ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "comment", "; It is used here to take different actions based on whether the" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "comment", "; parameter \"language\" is set to \"en\", \"es\" or something else." ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "(" ],
|
||||
[ "support.function", "condp" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.language", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "language" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "string", "\"en" ],
|
||||
[ "string", "\"" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "(" ],
|
||||
[ "support.function", "str" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\"Goodbye, " ],
|
||||
[ "string", "\"" ],
|
||||
[ "text", " " ],
|
||||
[ "support.function", "name" ],
|
||||
[ "keyword", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "string", "\"es" ],
|
||||
[ "string", "\"" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "(" ],
|
||||
[ "support.function", "str" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\"Adios, " ],
|
||||
[ "string", "\"" ],
|
||||
[ "text", " " ],
|
||||
[ "support.function", "name" ],
|
||||
[ "keyword", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "(" ],
|
||||
[ "keyword", "throw" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "(" ],
|
||||
[ "identifier", "IllegalArgumentException" ],
|
||||
[ "text", "." ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "(" ],
|
||||
[ "support.function", "str" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\"unsupported language " ],
|
||||
[ "string", "\"" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "language" ],
|
||||
[ "keyword", ")" ],
|
||||
[ "keyword", ")" ],
|
||||
[ "keyword", ")" ],
|
||||
[ "keyword", ")" ],
|
||||
[ "keyword", ")" ],
|
||||
[ "keyword", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "(" ],
|
||||
[ "support.function", "println" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "(" ],
|
||||
[ "identifier", "parting" ],
|
||||
[ "keyword", ")" ],
|
||||
[ "keyword", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "comment", "; -> Goodbye, World" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "(" ],
|
||||
[ "support.function", "println" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "(" ],
|
||||
[ "identifier", "parting" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\"Mark" ],
|
||||
[ "string", "\"" ],
|
||||
[ "keyword", ")" ],
|
||||
[ "keyword", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "comment", "; -> Goodbye, Mark" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "(" ],
|
||||
[ "support.function", "println" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "(" ],
|
||||
[ "identifier", "parting" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\"Mark" ],
|
||||
[ "string", "\"" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\"es" ],
|
||||
[ "string", "\"" ],
|
||||
[ "keyword", ")" ],
|
||||
[ "keyword", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "comment", "; -> Adios, Mark" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "(" ],
|
||||
[ "support.function", "println" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "(" ],
|
||||
[ "identifier", "parting" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\"Mark" ],
|
||||
[ "string", "\"" ],
|
||||
[ "text", ", " ],
|
||||
[ "string", "\"xy" ],
|
||||
[ "string", "\"" ],
|
||||
[ "keyword", ")" ],
|
||||
[ "keyword", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "comment", "; -> java.lang.IllegalArgumentException: unsupported language xy" ]
|
||||
]
|
||||
}
|
||||
]
|
||||
-188
@@ -1,188 +0,0 @@
|
||||
[
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "#!/usr/bin/env coffee" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "try" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "throw" ],
|
||||
[ "text", " " ],
|
||||
[ "language.support.class", "URIError" ],
|
||||
[ "text", " " ],
|
||||
[ "language.support.function", "decodeURI" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "constant.numeric", "0xC0ffee" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "*" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "123456.7e-8" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "/" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", ".9" ],
|
||||
[ "paren.rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "catch" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "e" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "qdoc",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "console" ],
|
||||
[ "identifier", ".log" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "'qstring'" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "+" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\"qqstring\"" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "+" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "'''" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "qdoc",
|
||||
"data": [
|
||||
[ "string", " qdoc" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "qqdoc",
|
||||
"data": [
|
||||
[ "string", " '''" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "+" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\"\"\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "qqdoc",
|
||||
"data": [
|
||||
[ "string", " qqdoc" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "string", " \"\"\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "do" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "->" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "comment",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "comment", "###" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "comment",
|
||||
"data": [
|
||||
[ "comment", " herecomment" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", " ###" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "heregex",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "re" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "string.regex", "/regex/imgy" ],
|
||||
[ "identifier", ".test" ],
|
||||
[ "text", " " ],
|
||||
[ "string.regex", "///" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "heregex",
|
||||
"data": [
|
||||
[ "comment.regex", " " ],
|
||||
[ "string.regex", "heregex" ],
|
||||
[ "comment.regex", " # comment" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "string.regex", " ///imgy" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "this" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "isnt" ],
|
||||
[ "punctuation.operator", ":" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "`just JavaScript`" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "constant.language", "undefined" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "identifier", "sentence" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\"#{ 22 / 7 } is a decent approximation of π\"" ]
|
||||
]
|
||||
}
|
||||
]
|
||||
-41
@@ -1,41 +0,0 @@
|
||||
[
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "<!--" ],
|
||||
[ "comment", "- hello world --->" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "cfset" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "welcome" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"Hello World!\"" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "cfoutput" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", "#welcome#" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "cfoutput" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
}
|
||||
]
|
||||
-42
@@ -1,42 +0,0 @@
|
||||
[
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "public" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "void" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "HelloWorld" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "comment", "//Say Hello!" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "Console" ],
|
||||
[ "punctuation.operator", "." ],
|
||||
[ "identifier", "WriteLine" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "string", "\"Hello World\"" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "punctuation.operator", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
}
|
||||
]
|
||||
-231
@@ -1,231 +0,0 @@
|
||||
[
|
||||
{
|
||||
"state": "ruleset",
|
||||
"data": [
|
||||
[ "variable", ".text-layer" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "ruleset",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "support.type", "font-family" ],
|
||||
[ "text", ": Monaco, " ],
|
||||
[ "string", "\"Courier New\"" ],
|
||||
[ "text", ", " ],
|
||||
[ "support.constant.fonts", "monospace" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "ruleset",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "support.type", "font-size" ],
|
||||
[ "text", ": " ],
|
||||
[ "constant.numeric", "12" ],
|
||||
[ "keyword", "px" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "ruleset",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "support.type", "cursor" ],
|
||||
[ "text", ": " ],
|
||||
[ "support.constant", "text" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "ruleset",
|
||||
"data": [
|
||||
[ "variable", ".blinker" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "ruleset",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "support.type", "animation-duration" ],
|
||||
[ "text", ": " ],
|
||||
[ "constant.numeric", "1" ],
|
||||
[ "keyword", "s" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "ruleset",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "support.type", "animation-name" ],
|
||||
[ "text", ": blink;" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "ruleset",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "support.type", "animation-iteration-count" ],
|
||||
[ "text", ": infinite;" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "ruleset",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "support.type", "animation-direction" ],
|
||||
[ "text", ": alternate;" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "ruleset",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "support.type", "animation-timing-function" ],
|
||||
[ "text", ": " ],
|
||||
[ "support.constant", "linear" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "media",
|
||||
"data": [
|
||||
[ "string", "@keyframes blink {" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "media_ruleset",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "constant", "0" ],
|
||||
[ "text", "% " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "media_ruleset",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "support.type", "opacity" ],
|
||||
[ "text", ": " ],
|
||||
[ "constant.numeric", "0" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "media",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "media_ruleset",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "constant", "40" ],
|
||||
[ "text", "% " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "media_ruleset",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "support.type", "opacity" ],
|
||||
[ "text", ": " ],
|
||||
[ "constant.numeric", "0" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "media",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "media_ruleset",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "constant", "40" ],
|
||||
[ "variable", ".5" ],
|
||||
[ "text", "% " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "media_ruleset",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "support.type", "opacity" ],
|
||||
[ "text", ": " ],
|
||||
[ "constant.numeric", "1" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "media",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "media_ruleset",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "constant", "100" ],
|
||||
[ "text", "% " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "media_ruleset",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "support.type", "opacity" ],
|
||||
[ "text", ": " ],
|
||||
[ "constant.numeric", "1" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "media",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "string", "}" ]
|
||||
]
|
||||
}
|
||||
]
|
||||
-732
@@ -1,732 +0,0 @@
|
||||
[
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "variable", "diff" ],
|
||||
[ "variable", " --git" ],
|
||||
[ "keyword", " a/lib/ace/edit_session.js" ],
|
||||
[ "variable", " b/lib/ace/edit_session.js" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "variable", "index 23fc3fc..ed3b273 100644" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "constant.numeric", "---" ],
|
||||
[ "meta.tag", " a/lib/ace/edit_session.js" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "constant.numeric", "+++" ],
|
||||
[ "meta.tag", " b/lib/ace/edit_session.js" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "constant", "@@" ],
|
||||
[ "constant.numeric", " -51,6 +51,7 " ],
|
||||
[ "constant", "@@" ],
|
||||
[ "comment.doc.tag", " var TextMode = require(\"./mode/text\").Mode;" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "invisible", " var Range = require(\"./range\").Range;" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "invisible", " var Document = require(\"./document\").Document;" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "invisible", " var BackgroundTokenizer = require(\"./background_tokenizer\").BackgroundTokenizer;" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "support.constant", "+" ],
|
||||
[ "text", "var SearchHighlight = require(\"./search_highlight\").SearchHighlight;" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "invisible", " /**" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "invisible", " * class EditSession" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "constant", "@@" ],
|
||||
[ "constant.numeric", " -307,6 +308,13 " ],
|
||||
[ "constant", "@@" ],
|
||||
[ "comment.doc.tag", " var EditSession = function(text, mode) {" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "invisible", " return token;" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "invisible", " };" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "support.constant", "+" ],
|
||||
[ "text", " this.highlight = function(re) {" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "support.constant", "+" ],
|
||||
[ "text", " if (!this.$searchHighlight) {" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "support.constant", "+" ],
|
||||
[ "text", " var highlight = new SearchHighlight(null, \"ace_selected-word\", \"text\");" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "support.constant", "+" ],
|
||||
[ "text", " this.$searchHighlight = this.addDynamicMarker(highlight);" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "support.constant", "+" ],
|
||||
[ "text", " }" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "support.constant", "+" ],
|
||||
[ "text", " this.$searchHighlight.setRegexp(re);" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "support.constant", "+" ],
|
||||
[ "text", " }" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "invisible", " /**" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "invisible", " * EditSession.setUndoManager(undoManager)" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "invisible", " * - undoManager (UndoManager): The new undo manager" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "constant", "@@" ],
|
||||
[ "constant.numeric", " -556,7 +564,8 " ],
|
||||
[ "constant", "@@" ],
|
||||
[ "comment.doc.tag", " var EditSession = function(text, mode) {" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "invisible", " type : type || \"line\"," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "invisible", " renderer: typeof type == \"function\" ? type : null," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "invisible", " clazz : clazz," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "support.function", "-" ],
|
||||
[ "string", " inFront: !!inFront" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "support.constant", "+" ],
|
||||
[ "text", " inFront: !!inFront," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "support.constant", "+" ],
|
||||
[ "text", " id: id" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "invisible", " }" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "invisible", " if (inFront) {" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "variable", "diff" ],
|
||||
[ "variable", " --git" ],
|
||||
[ "keyword", " a/lib/ace/editor.js" ],
|
||||
[ "variable", " b/lib/ace/editor.js" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "variable", "index 834e603..b27ec73 100644" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "constant.numeric", "---" ],
|
||||
[ "meta.tag", " a/lib/ace/editor.js" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "constant.numeric", "+++" ],
|
||||
[ "meta.tag", " b/lib/ace/editor.js" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "constant", "@@" ],
|
||||
[ "constant.numeric", " -494,7 +494,7 " ],
|
||||
[ "constant", "@@" ],
|
||||
[ "comment.doc.tag", " var Editor = function(renderer, session) {" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "invisible", " * Emitted when a selection has changed." ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "invisible", " **/" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "invisible", " this.onSelectionChange = function(e) {" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "support.function", "-" ],
|
||||
[ "string", " var session = this.getSession();" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "support.constant", "+" ],
|
||||
[ "text", " var session = this.session;" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "invisible", " if (session.$selectionMarker) {" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "invisible", " session.removeMarker(session.$selectionMarker);" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "constant", "@@" ],
|
||||
[ "constant.numeric", " -509,12 +509,40 " ],
|
||||
[ "constant", "@@" ],
|
||||
[ "comment.doc.tag", " var Editor = function(renderer, session) {" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "invisible", " this.$updateHighlightActiveLine();" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "invisible", " }" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "support.function", "-" ],
|
||||
[ "string", " var self = this;" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "support.function", "-" ],
|
||||
[ "string", " if (this.$highlightSelectedWord && !this.$wordHighlightTimer)" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "support.function", "-" ],
|
||||
[ "string", " this.$wordHighlightTimer = setTimeout(function() {" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "support.function", "-" ],
|
||||
[ "string", " self.session.$mode.highlightSelection(self);" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "support.function", "-" ],
|
||||
[ "string", " self.$wordHighlightTimer = null;" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "support.function", "-" ],
|
||||
[ "string", " }, 30, this);" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "support.constant", "+" ],
|
||||
[ "text", " var re = this.$highlightSelectedWord && this.$getSelectionHighLightRegexp()" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "invisible", " };" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "variable", "diff" ],
|
||||
[ "variable", " --git" ],
|
||||
[ "keyword", " a/lib/ace/search_highlight.js" ],
|
||||
[ "variable", " b/lib/ace/search_highlight.js" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "invisible", "new file mode 100644" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "variable", "index 0000000..b2df779" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "constant.numeric", "---" ],
|
||||
[ "meta.tag", " /dev/null" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "constant.numeric", "+++" ],
|
||||
[ "meta.tag", " b/lib/ace/search_highlight.js" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "constant", "@@" ],
|
||||
[ "constant.numeric", " -0,0 +1,3 " ],
|
||||
[ "constant", "@@" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "support.constant", "+" ],
|
||||
[ "text", "new" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "support.constant", "+" ],
|
||||
[ "text", "empty file" ]
|
||||
]
|
||||
}
|
||||
]
|
||||
-185
@@ -1,185 +0,0 @@
|
||||
[
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "uniform" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "float" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "amplitude" ],
|
||||
[ "punctuation.operator", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "attribute" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "float" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "displacement" ],
|
||||
[ "punctuation.operator", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "varying" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "vec3" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "vNormal" ],
|
||||
[ "punctuation.operator", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "void" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.name.function", "main" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "vNormal" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "normal" ],
|
||||
[ "punctuation.operator", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "comment", "// multiply our displacement by the" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "comment", "// amplitude. The amp will get animated" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "comment", "// so we'll have animated displacement" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "vec3" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "newPosition" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "position" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "+" ],
|
||||
[ "text", " " ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "normal" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "*" ],
|
||||
[ "text", " " ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "vec3" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "displacement" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "*" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "amplitude" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "punctuation.operator", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "constant.language", "gl_Position" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "projectionMatrix" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "*" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "modelViewMatrix" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "*" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "vec4" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "newPosition" ],
|
||||
[ "punctuation.operator", "," ],
|
||||
[ "constant.numeric", "1.0" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "punctuation.operator", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
}
|
||||
]
|
||||
-362
@@ -1,362 +0,0 @@
|
||||
[
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "// Concurrent computation of pi." ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "// See http://goo.gl/ZuTZM." ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "//" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "// This demonstrates Go's ability to handle" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "// large numbers of concurrent processes." ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "// It is an unreasonable way to calculate pi." ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "package" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "main" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "import" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "(" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "string", "\"fmt\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "string", "\"math\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "paren.rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "func" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "main" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "fmt" ],
|
||||
[ "punctuation.operator", "." ],
|
||||
[ "identifier", "Println" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "pi" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "constant.numeric", "5000" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "paren.rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "// pi launches n goroutines to compute an" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "// approximation of pi." ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "func" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "pi" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "n" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "int" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "float64" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "ch" ],
|
||||
[ "text", " " ],
|
||||
[ "punctuation.operator", ":" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "make" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "keyword", "chan" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "float64" ],
|
||||
[ "paren.rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "for" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "k" ],
|
||||
[ "text", " " ],
|
||||
[ "punctuation.operator", ":" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "0" ],
|
||||
[ "punctuation.operator", ";" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "k" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "<=" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "n" ],
|
||||
[ "punctuation.operator", ";" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "k" ],
|
||||
[ "keyword.operator", "++" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "go" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "term" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "ch" ],
|
||||
[ "punctuation.operator", "," ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "float64" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "k" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "paren.rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "f" ],
|
||||
[ "text", " " ],
|
||||
[ "punctuation.operator", ":" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "0.0" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "for" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "k" ],
|
||||
[ "text", " " ],
|
||||
[ "punctuation.operator", ":" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "0" ],
|
||||
[ "punctuation.operator", ";" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "k" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "<=" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "n" ],
|
||||
[ "punctuation.operator", ";" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "k" ],
|
||||
[ "keyword.operator", "++" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "f" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "+" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "<" ],
|
||||
[ "keyword.operator", "-" ],
|
||||
[ "identifier", "ch" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "return" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "f" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "func" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "term" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "ch" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "chan" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "float64" ],
|
||||
[ "punctuation.operator", "," ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "k" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "float64" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "ch" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "<" ],
|
||||
[ "keyword.operator", "-" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "4" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "*" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "math" ],
|
||||
[ "punctuation.operator", "." ],
|
||||
[ "identifier", "Pow" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "constant.numeric", "-1" ],
|
||||
[ "punctuation.operator", "," ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "k" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", " / " ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "constant.numeric", "2" ],
|
||||
[ "keyword.operator", "*" ],
|
||||
[ "identifier", "k" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "+" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "1" ],
|
||||
[ "paren.rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
}
|
||||
]
|
||||
-529
@@ -1,529 +0,0 @@
|
||||
[
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "//http://groovy.codehaus.org/Martin+Fowler%27s+closure+examples+in+Groovy" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "class" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "Employee" ],
|
||||
[ "text", " " ],
|
||||
[ "lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "def" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "name" ],
|
||||
[ "text", ", " ],
|
||||
[ "identifier", "salary" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "boolean" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "manager" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "support.function", "String" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "toString" ],
|
||||
[ "lparen", "(" ],
|
||||
[ "rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "lparen", "{" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "return" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "name" ],
|
||||
[ "text", " " ],
|
||||
[ "rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "def" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "emps" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "lparen", "[" ],
|
||||
[ "keyword", "new" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "Employee" ],
|
||||
[ "lparen", "(" ],
|
||||
[ "identifier", "name" ],
|
||||
[ "text", ":" ],
|
||||
[ "string", "'Guillaume'" ],
|
||||
[ "text", ", " ],
|
||||
[ "identifier", "manager" ],
|
||||
[ "text", ":" ],
|
||||
[ "constant.language.boolean", "true" ],
|
||||
[ "text", ", " ],
|
||||
[ "identifier", "salary" ],
|
||||
[ "text", ":" ],
|
||||
[ "constant.numeric", "200" ],
|
||||
[ "rparen", ")" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "new" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "Employee" ],
|
||||
[ "lparen", "(" ],
|
||||
[ "identifier", "name" ],
|
||||
[ "text", ":" ],
|
||||
[ "string", "'Graeme'" ],
|
||||
[ "text", ", " ],
|
||||
[ "identifier", "manager" ],
|
||||
[ "text", ":" ],
|
||||
[ "constant.language.boolean", "true" ],
|
||||
[ "text", ", " ],
|
||||
[ "identifier", "salary" ],
|
||||
[ "text", ":" ],
|
||||
[ "constant.numeric", "200" ],
|
||||
[ "rparen", ")" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "new" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "Employee" ],
|
||||
[ "lparen", "(" ],
|
||||
[ "identifier", "name" ],
|
||||
[ "text", ":" ],
|
||||
[ "string", "'Dierk'" ],
|
||||
[ "text", ", " ],
|
||||
[ "identifier", "manager" ],
|
||||
[ "text", ":" ],
|
||||
[ "constant.language.boolean", "false" ],
|
||||
[ "text", ", " ],
|
||||
[ "identifier", "salary" ],
|
||||
[ "text", ":" ],
|
||||
[ "constant.numeric", "151" ],
|
||||
[ "rparen", ")" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "new" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "Employee" ],
|
||||
[ "lparen", "(" ],
|
||||
[ "identifier", "name" ],
|
||||
[ "text", ":" ],
|
||||
[ "string", "'Bernd'" ],
|
||||
[ "text", ", " ],
|
||||
[ "identifier", "manager" ],
|
||||
[ "text", ":" ],
|
||||
[ "constant.language.boolean", "false" ],
|
||||
[ "text", ", " ],
|
||||
[ "identifier", "salary" ],
|
||||
[ "text", ":" ],
|
||||
[ "constant.numeric", "50" ],
|
||||
[ "rparen", ")" ],
|
||||
[ "rparen", "]" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "def" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "managers" ],
|
||||
[ "lparen", "(" ],
|
||||
[ "identifier", "emps" ],
|
||||
[ "rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "emps" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "findAll" ],
|
||||
[ "text", " " ],
|
||||
[ "lparen", "{" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "e" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "-" ],
|
||||
[ "keyword.operator", ">" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "e" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "isManager" ],
|
||||
[ "lparen", "(" ],
|
||||
[ "rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "assert" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "emps" ],
|
||||
[ "lparen", "[" ],
|
||||
[ "constant.numeric", "0" ],
|
||||
[ "text", ".." ],
|
||||
[ "constant.numeric", "1" ],
|
||||
[ "rparen", "]" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "==" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "managers" ],
|
||||
[ "lparen", "(" ],
|
||||
[ "identifier", "emps" ],
|
||||
[ "rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "comment", "// [Guillaume, Graeme]" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "def" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "highPaid" ],
|
||||
[ "lparen", "(" ],
|
||||
[ "identifier", "emps" ],
|
||||
[ "rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "threshold" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "150" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "emps" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "findAll" ],
|
||||
[ "text", " " ],
|
||||
[ "lparen", "{" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "e" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "-" ],
|
||||
[ "keyword.operator", ">" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "e" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "salary" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", ">" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "threshold" ],
|
||||
[ "text", " " ],
|
||||
[ "rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "assert" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "emps" ],
|
||||
[ "lparen", "[" ],
|
||||
[ "constant.numeric", "0" ],
|
||||
[ "text", ".." ],
|
||||
[ "constant.numeric", "2" ],
|
||||
[ "rparen", "]" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "==" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "highPaid" ],
|
||||
[ "lparen", "(" ],
|
||||
[ "identifier", "emps" ],
|
||||
[ "rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "comment", "// [Guillaume, Graeme, Dierk]" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "def" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "paidMore" ],
|
||||
[ "lparen", "(" ],
|
||||
[ "identifier", "amount" ],
|
||||
[ "rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "lparen", "{" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "e" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "-" ],
|
||||
[ "keyword.operator", ">" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "e" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "salary" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", ">" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "amount" ],
|
||||
[ "rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "def" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "highPaid" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "paidMore" ],
|
||||
[ "lparen", "(" ],
|
||||
[ "constant.numeric", "150" ],
|
||||
[ "rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "assert" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "highPaid" ],
|
||||
[ "lparen", "(" ],
|
||||
[ "identifier", "emps" ],
|
||||
[ "lparen", "[" ],
|
||||
[ "constant.numeric", "0" ],
|
||||
[ "rparen", "]" ],
|
||||
[ "rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "comment", "// true" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "assert" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "emps" ],
|
||||
[ "lparen", "[" ],
|
||||
[ "constant.numeric", "0" ],
|
||||
[ "text", ".." ],
|
||||
[ "constant.numeric", "2" ],
|
||||
[ "rparen", "]" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "==" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "emps" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "findAll" ],
|
||||
[ "lparen", "(" ],
|
||||
[ "identifier", "highPaid" ],
|
||||
[ "rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "def" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "filename" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "'test.txt'" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "new" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "File" ],
|
||||
[ "lparen", "(" ],
|
||||
[ "identifier", "filename" ],
|
||||
[ "rparen", ")" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "withReader" ],
|
||||
[ "lparen", "{" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "reader" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "-" ],
|
||||
[ "keyword.operator", ">" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "doSomethingWith" ],
|
||||
[ "lparen", "(" ],
|
||||
[ "identifier", "reader" ],
|
||||
[ "rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "def" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "readersText" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "def" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "doSomethingWith" ],
|
||||
[ "lparen", "(" ],
|
||||
[ "identifier", "reader" ],
|
||||
[ "rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "lparen", "{" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "readersText" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "reader" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "text" ],
|
||||
[ "text", " " ],
|
||||
[ "rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "assert" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "new" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "File" ],
|
||||
[ "lparen", "(" ],
|
||||
[ "identifier", "filename" ],
|
||||
[ "rparen", ")" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "text" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "==" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "readersText" ]
|
||||
]
|
||||
}
|
||||
]
|
||||
-195
@@ -1,195 +0,0 @@
|
||||
[
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "class" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "Haxe" ],
|
||||
[ "text", " " ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "public" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "static" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "function" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "main" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", " " ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "comment", "// Say Hello!" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "var" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "greeting" ],
|
||||
[ "punctuation.operator", ":" ],
|
||||
[ "keyword", "String" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\"Hello World\"" ],
|
||||
[ "punctuation.operator", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "trace" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "greeting" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "punctuation.operator", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "var" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "targets" ],
|
||||
[ "punctuation.operator", ":" ],
|
||||
[ "keyword", "Array" ],
|
||||
[ "keyword.operator", "<" ],
|
||||
[ "keyword", "String" ],
|
||||
[ "keyword.operator", ">" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "[" ],
|
||||
[ "string", "\"Flash\"" ],
|
||||
[ "punctuation.operator", "," ],
|
||||
[ "string", "\"Javascript\"" ],
|
||||
[ "punctuation.operator", "," ],
|
||||
[ "string", "\"PHP\"" ],
|
||||
[ "punctuation.operator", "," ],
|
||||
[ "string", "\"Neko\"" ],
|
||||
[ "punctuation.operator", "," ],
|
||||
[ "string", "\"C++\"" ],
|
||||
[ "punctuation.operator", "," ],
|
||||
[ "string", "\"iOS\"" ],
|
||||
[ "punctuation.operator", "," ],
|
||||
[ "string", "\"Android\"" ],
|
||||
[ "punctuation.operator", "," ],
|
||||
[ "string", "\"webOS\"" ],
|
||||
[ "paren.rparen", "]" ],
|
||||
[ "punctuation.operator", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "trace" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "string", "\"Haxe is a great language that can target:\"" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "punctuation.operator", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "for" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "target" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "in" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "targets" ],
|
||||
[ "paren.rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "trace" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "string", "\" - \"" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "+" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "target" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "punctuation.operator", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "trace" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "string", "\"And many more!\"" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "punctuation.operator", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
}
|
||||
]
|
||||
-150
@@ -1,150 +0,0 @@
|
||||
[
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "html" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "head" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "css-start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name.style", "style" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "type" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"text/css\"" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "css-ruleset",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", ".text-layer" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "css-ruleset",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "support.type", "font-family" ],
|
||||
[ "text", ": Monaco, " ],
|
||||
[ "string", "\"Courier New\"" ],
|
||||
[ "text", ", " ],
|
||||
[ "support.constant.fonts", "monospace" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "css-ruleset",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "support.type", "font-size" ],
|
||||
[ "text", ": " ],
|
||||
[ "constant.numeric", "12" ],
|
||||
[ "keyword", "px" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "css-ruleset",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "support.type", "cursor" ],
|
||||
[ "text", ": " ],
|
||||
[ "support.constant", "text" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "css-start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name.style", "style" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "head" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "body" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "h1" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "style" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"color:red\"" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", "Juhu Kinners" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "h1" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "body" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "html" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
}
|
||||
]
|
||||
-139
@@ -1,139 +0,0 @@
|
||||
[
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "public" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "class" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "InfiniteLoop" ],
|
||||
[ "text", " " ],
|
||||
[ "lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "comment",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "comment", "/*" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "comment",
|
||||
"data": [
|
||||
[ "comment", " * This will cause the program to hang..." ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "comment",
|
||||
"data": [
|
||||
[ "comment", " *" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "comment",
|
||||
"data": [
|
||||
[ "comment", " * Taken from:" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "comment",
|
||||
"data": [
|
||||
[ "comment", " * http://www.exploringbinary.com/java-hangs-when-converting-2-2250738585072012e-308/" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", " */" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "public" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "static" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "void" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "main" ],
|
||||
[ "lparen", "(" ],
|
||||
[ "support.function", "String" ],
|
||||
[ "lparen", "[" ],
|
||||
[ "rparen", "]" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "args" ],
|
||||
[ "rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "double" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "d" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "support.function", "Double" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "parseDouble" ],
|
||||
[ "lparen", "(" ],
|
||||
[ "string", "\"2.2250738585072012e-308\"" ],
|
||||
[ "rparen", ")" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "comment", "// unreachable code" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "support.function", "System" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "out" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "println" ],
|
||||
[ "lparen", "(" ],
|
||||
[ "string", "\"Value: \"" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "+" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "d" ],
|
||||
[ "rparen", ")" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "rparen", "}" ]
|
||||
]
|
||||
}
|
||||
]
|
||||
-555
@@ -1,555 +0,0 @@
|
||||
[
|
||||
{
|
||||
"state": "regex_allowed",
|
||||
"data": [
|
||||
[ "storage.type", "function" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.name.function", "foo" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "variable.parameter", "items" ],
|
||||
[ "punctuation.operator", ", " ],
|
||||
[ "variable.parameter", "nada" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "regex_allowed",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "for" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "storage.type", "var" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "i" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "constant.numeric", "0" ],
|
||||
[ "punctuation.operator", ";" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "i" ],
|
||||
[ "keyword.operator", "<" ],
|
||||
[ "identifier", "items" ],
|
||||
[ "punctuation.operator", "." ],
|
||||
[ "support.constant", "length" ],
|
||||
[ "punctuation.operator", ";" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "i" ],
|
||||
[ "keyword.operator", "++" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "regex_allowed",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "alert" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "items" ],
|
||||
[ "paren.lparen", "[" ],
|
||||
[ "identifier", "i" ],
|
||||
[ "paren.rparen", "]" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "+" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\"juhu" ],
|
||||
[ "constant.language.escape", "\\n" ],
|
||||
[ "string", "\"" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "punctuation.operator", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "paren.rparen", "}" ],
|
||||
[ "text", "\t" ],
|
||||
[ "comment", "// Real Tab." ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "identifier", "regexp" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "string.regexp", "/p" ],
|
||||
[ "constant.language.escape", "|" ],
|
||||
[ "string.regexp", "p/" ],
|
||||
[ "text", " " ],
|
||||
[ "comment", "// ends here" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "identifier", "r" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "string.regexp", "/d" ],
|
||||
[ "constant.language.escape", "{1,2}" ],
|
||||
[ "constant.language.escape", "?" ],
|
||||
[ "string.regexp", "f{e}" ],
|
||||
[ "invalid", "++" ],
|
||||
[ "string.regexp", "r" ],
|
||||
[ "constant.language.escape", "*?" ],
|
||||
[ "regexp.keyword.operator", "\\d" ],
|
||||
[ "constant.language.escape", "+?[]" ],
|
||||
[ "string.regexp", "r" ],
|
||||
[ "constant.language.escape", "[^" ],
|
||||
[ "string.regexp.charachterclass", "r" ],
|
||||
[ "constant.language.escape", "-" ],
|
||||
[ "string.regexp.charachterclass", "o" ],
|
||||
[ "regexp.keyword.operator", "\\f" ],
|
||||
[ "regexp.keyword.operator", "\\f" ],
|
||||
[ "string.regexp.charachterclass", "[" ],
|
||||
[ "regexp.keyword.operator", "\\f" ],
|
||||
[ "constant.language.escape", "]" ],
|
||||
[ "constant.language.escape", "?" ],
|
||||
[ "string.regexp", "r" ],
|
||||
[ "invalid", "{7}+" ],
|
||||
[ "string.regexp", "r" ],
|
||||
[ "regexp.keyword.operator", "\\{" ],
|
||||
[ "string.regexp", "7}" ],
|
||||
[ "constant.language.escape", "+" ],
|
||||
[ "string.regexp", "rr--rr" ],
|
||||
[ "constant.language.escape", "$" ],
|
||||
[ "constant.language.escape", "^" ],
|
||||
[ "constant.language.escape", "(?:" ],
|
||||
[ "string.regexp", "d" ],
|
||||
[ "constant.language.escape", "|" ],
|
||||
[ "string.regexp", "s" ],
|
||||
[ "constant.language.escape", ")" ],
|
||||
[ "constant.language.escape", "(?=" ],
|
||||
[ "string.regexp", "a" ],
|
||||
[ "constant.language.escape", "|" ],
|
||||
[ "constant.language.escape", ")" ],
|
||||
[ "constant.language.escape", "(?!" ],
|
||||
[ "string.regexp", "y" ],
|
||||
[ "constant.language.escape", ")[]" ],
|
||||
[ "constant.language.escape", "|" ],
|
||||
[ "constant.language.escape", "$" ],
|
||||
[ "constant.language.escape", "?" ],
|
||||
[ "constant.language.escape", "|" ],
|
||||
[ "invalid", "^*" ],
|
||||
[ "string.regexp", "/" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "o" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "identifier", "a" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string.regexp", "/a/" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "jk" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "string.regexp", "/ /" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "/" ],
|
||||
[ "text", " " ],
|
||||
[ "string.regexp", "/ /" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "comment.doc", "/************************************/" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment.doc", "/** total mess, tricky to highlight**/" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "regex_allowed",
|
||||
"data": [
|
||||
[ "storage.type", "function" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "doc-start",
|
||||
"data": [
|
||||
[ "text", "\t" ],
|
||||
[ "comment.doc", "/**" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "doc-start",
|
||||
"data": [
|
||||
[ "comment.doc", "\t * docComment" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment.doc", "\t **/" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t" ],
|
||||
[ "identifier", "r" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "string.regexp", "/u" ],
|
||||
[ "regexp.keyword.operator", "\\t" ],
|
||||
[ "constant.language.escape", "*" ],
|
||||
[ "string.regexp", "/" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t" ],
|
||||
[ "identifier", "g" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "1." ],
|
||||
[ "text", "00" ],
|
||||
[ "identifier", "E" ],
|
||||
[ "text", "^" ],
|
||||
[ "constant.numeric", "1" ],
|
||||
[ "punctuation.operator", "," ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "y" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "1.2" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "+" ],
|
||||
[ "text", " " ],
|
||||
[ "punctuation.operator", "." ],
|
||||
[ "constant.numeric", "2" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "+" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "052" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "+" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "0x25" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t" ],
|
||||
[ "identifier", "t" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "[" ],
|
||||
[ "string", "'d'" ],
|
||||
[ "punctuation.operator", "," ],
|
||||
[ "text", " " ],
|
||||
[ "string", "''" ],
|
||||
[ "paren.rparen", "]" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "regex_allowed",
|
||||
"data": [
|
||||
[ "storage.type", "function" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "regex_allowed",
|
||||
"data": [
|
||||
[ "text", "\t" ],
|
||||
[ "comment", "/* eee */" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "qqstring",
|
||||
"data": [
|
||||
[ "string", "\"s\\" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "string", "s" ],
|
||||
[ "constant.language.escape", "\\u7824" ],
|
||||
[ "string", "sss" ],
|
||||
[ "constant.language.escape", "\\u" ],
|
||||
[ "string", "1\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "qstring",
|
||||
"data": [
|
||||
[ "string", "'\\" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "string", "string'" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "'" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "identifier", "string" ],
|
||||
[ "text", "'" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "string", "\"trailing space" ],
|
||||
[ "constant.language.escape", "\\ " ],
|
||||
[ "string", " " ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "string", "\" \"" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "/" ],
|
||||
[ "identifier", "not" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "a" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "regexp" ],
|
||||
[ "keyword.operator", "/" ],
|
||||
[ "identifier", "g" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "doc-start",
|
||||
"data": [
|
||||
[ "comment.doc", "/**" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "doc-start",
|
||||
"data": [
|
||||
[ "comment.doc", " *doc" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment.doc", " */" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "regex_allowed",
|
||||
"data": [
|
||||
[ "identifier", "a" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "regex_allowed",
|
||||
"data": [
|
||||
[ "text", "\t" ],
|
||||
[ "string", "'a'" ],
|
||||
[ "punctuation.operator", ":" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "b" ],
|
||||
[ "punctuation.operator", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t" ],
|
||||
[ "string", "'g'" ],
|
||||
[ "text", ": " ],
|
||||
[ "storage.type", "function" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "variable.parameter", "t" ],
|
||||
[ "paren.rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t" ],
|
||||
[ "entity.name.function", "gta" ],
|
||||
[ "punctuation.operator", ":" ],
|
||||
[ "storage.type", "function" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "variable.parameter", "a" ],
|
||||
[ "punctuation.operator", "," ],
|
||||
[ "variable.parameter", "b" ],
|
||||
[ "paren.rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "function_arguments",
|
||||
"data": [
|
||||
[ "identifier", "foo" ],
|
||||
[ "punctuation.operator", "." ],
|
||||
[ "storage.type", "protoype" ],
|
||||
[ "punctuation.operator", "." ],
|
||||
[ "entity.name.function", "d" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "storage.type", "function" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "variable.parameter", "a" ],
|
||||
[ "punctuation.operator", ", " ],
|
||||
[ "variable.parameter", "b" ],
|
||||
[ "punctuation.operator", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "punctuation.operator", " " ],
|
||||
[ "variable.parameter", "c" ],
|
||||
[ "punctuation.operator", ", " ],
|
||||
[ "variable.parameter", "d" ],
|
||||
[ "paren.rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "storage.type", "foo" ],
|
||||
[ "punctuation.operator", "." ],
|
||||
[ "entity.name.function", "d" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "storage.type", "function" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "variable.parameter", "a" ],
|
||||
[ "punctuation.operator", ", " ],
|
||||
[ "variable.parameter", "b" ],
|
||||
[ "paren.rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "storage.type", "foo" ],
|
||||
[ "punctuation.operator", "." ],
|
||||
[ "entity.name.function", "d" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "storage.type", "function" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "variable.parameter", "a" ],
|
||||
[ "punctuation.operator", ", " ],
|
||||
[ "comment.doc", "/*****/" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "d" ],
|
||||
[ "string", "\"string\"" ],
|
||||
[ "text", " " ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
}
|
||||
]
|
||||
-611
@@ -1,611 +0,0 @@
|
||||
[
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"query\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"count\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "constant.numeric", "10" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"created\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"2011-06-21T08:10:46Z\"" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"lang\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"en-US\"" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"results\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"photo\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "paren.lparen", "[" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"farm\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"6\"" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"id\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"5855620975\"" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"isfamily\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"0\"" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"isfriend\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"0\"" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"ispublic\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"1\"" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"owner\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"32021554@N04\"" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"secret\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"f1f5e8515d\"" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"server\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"5110\"" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"title\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"7087 bandit cat\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "paren.rparen", "}" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"farm\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"4\"" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"id\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"5856170534\"" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"isfamily\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"0\"" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"isfriend\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"0\"" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"ispublic\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"1\"" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"owner\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"32021554@N04\"" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"secret\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"ff1efb2a6f\"" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"server\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"3217\"" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"title\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"6975 rusty cat\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "paren.rparen", "}" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"farm\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"6\"" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"id\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"5856172972\"" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"isfamily\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"0\"" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"isfriend\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"0\"" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"ispublic\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"1\"" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"owner\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"51249875@N03\"" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"secret\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"6c6887347c\"" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"server\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"5192\"" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"title\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"watermarked-cats\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "paren.rparen", "}" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"farm\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"6\"" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"id\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"5856168328\"" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"isfamily\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"0\"" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"isfriend\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"0\"" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"ispublic\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"1\"" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"owner\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"32021554@N04\"" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"secret\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"0c1cfdf64c\"" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"server\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"5078\"" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"title\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"7020 mandy cat\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "paren.rparen", "}" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"farm\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"3\"" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"id\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"5856171774\"" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"isfamily\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"0\"" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"isfriend\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"0\"" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"ispublic\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"1\"" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"owner\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"32021554@N04\"" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"secret\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"7f5a3180ab\"" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"server\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"2696\"" ],
|
||||
[ "text", "," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "\"title\"" ],
|
||||
[ "text", ": " ],
|
||||
[ "string", "\"7448 bobby cat\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "paren.rparen", "]" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
}
|
||||
]
|
||||
-79
@@ -1,79 +0,0 @@
|
||||
[
|
||||
{
|
||||
"state": "comment",
|
||||
"data": [
|
||||
[ "comment", "/*EXPECTED" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "comment",
|
||||
"data": [
|
||||
[ "comment", "hello world!" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "*/" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "class" ],
|
||||
[ "text", " " ],
|
||||
[ "language.support.class", "Test" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "static" ],
|
||||
[ "text", " " ],
|
||||
[ "storage.type", "function" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.name.function", "run" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "punctuation.operator", ":" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "void" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "comment", "// console.log(\"hello world!\");" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "log" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\"hello world!\"" ],
|
||||
[ "punctuation.operator", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
}
|
||||
]
|
||||
-196
@@ -1,196 +0,0 @@
|
||||
[
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "\\usepackage" ],
|
||||
[ "lparen", "{" ],
|
||||
[ "text", "amsmath" ],
|
||||
[ "rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "\\title" ],
|
||||
[ "lparen", "{" ],
|
||||
[ "keyword", "\\LaTeX" ],
|
||||
[ "rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "\\date" ],
|
||||
[ "lparen", "{" ],
|
||||
[ "rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "\\begin" ],
|
||||
[ "lparen", "{" ],
|
||||
[ "text", "document" ],
|
||||
[ "rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "\\maketitle" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "\\LaTeX" ],
|
||||
[ "lparen", "{" ],
|
||||
[ "rparen", "}" ],
|
||||
[ "text", " is a document preparation system for the " ],
|
||||
[ "keyword", "\\TeX" ],
|
||||
[ "lparen", "{" ],
|
||||
[ "rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " typesetting program. It offers programmable desktop publishing" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " features and extensive facilities for automating most aspects of" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " typesetting and desktop publishing, including numbering and" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " cross-referencing, tables and figures, page layout, bibliographies," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " and much more. " ],
|
||||
[ "keyword", "\\LaTeX" ],
|
||||
[ "lparen", "{" ],
|
||||
[ "rparen", "}" ],
|
||||
[ "text", " was originally written in 1984 by Leslie" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " Lamport and has become the dominant method for using " ],
|
||||
[ "keyword", "\\TeX" ],
|
||||
[ "text", "; few" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " people write in plain " ],
|
||||
[ "keyword", "\\TeX" ],
|
||||
[ "lparen", "{" ],
|
||||
[ "rparen", "}" ],
|
||||
[ "text", " anymore. The current version is" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "\\LaTeXe" ],
|
||||
[ "text", "." ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "comment", "% This is a comment; it will not be shown in the final output." ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "comment", "% The following shows a little of the typesetting power of LaTeX:" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "\\begin" ],
|
||||
[ "lparen", "{" ],
|
||||
[ "text", "align" ],
|
||||
[ "rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " E &= mc^2 " ],
|
||||
[ "keyword", "\\\\" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " m &= " ],
|
||||
[ "keyword", "\\frac" ],
|
||||
[ "lparen", "{" ],
|
||||
[ "text", "m_0" ],
|
||||
[ "rparen", "}" ],
|
||||
[ "lparen", "{" ],
|
||||
[ "keyword", "\\sqrt" ],
|
||||
[ "lparen", "{" ],
|
||||
[ "text", "1-" ],
|
||||
[ "keyword", "\\frac" ],
|
||||
[ "lparen", "{" ],
|
||||
[ "text", "v^2" ],
|
||||
[ "rparen", "}" ],
|
||||
[ "lparen", "{" ],
|
||||
[ "text", "c^2" ],
|
||||
[ "rparen", "}" ],
|
||||
[ "rparen", "}" ],
|
||||
[ "rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "\\end" ],
|
||||
[ "lparen", "{" ],
|
||||
[ "text", "align" ],
|
||||
[ "rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "\\end" ],
|
||||
[ "lparen", "{" ],
|
||||
[ "text", "document" ],
|
||||
[ "rparen", "}" ]
|
||||
]
|
||||
}
|
||||
]
|
||||
-292
@@ -1,292 +0,0 @@
|
||||
[
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "/*" ],
|
||||
[ "comment", " styles.less */" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "variable", "@base" ],
|
||||
[ "text", ": " ],
|
||||
[ "constant.numeric", "#f938ab" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "variable.language", ".box-shadow" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "variable", "@style" ],
|
||||
[ "text", ", " ],
|
||||
[ "variable", "@c" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "when" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "support.function", "iscolor" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "variable", "@c" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " box-shadow: " ],
|
||||
[ "variable", "@style" ],
|
||||
[ "text", " " ],
|
||||
[ "variable", "@c" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " -webkit-box-shadow: " ],
|
||||
[ "variable", "@style" ],
|
||||
[ "text", " " ],
|
||||
[ "variable", "@c" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " -moz-box-shadow: " ],
|
||||
[ "variable", "@style" ],
|
||||
[ "text", " " ],
|
||||
[ "variable", "@c" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "variable.language", ".box-shadow" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "variable", "@style" ],
|
||||
[ "text", ", " ],
|
||||
[ "variable", "@alpha" ],
|
||||
[ "text", ": " ],
|
||||
[ "constant.numeric", "50%" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "when" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "support.function", "isnumber" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "variable", "@alpha" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable.language", ".box-shadow" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "variable", "@style" ],
|
||||
[ "text", ", " ],
|
||||
[ "support.function", "rgba" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "constant.numeric", "0" ],
|
||||
[ "text", ", " ],
|
||||
[ "constant.numeric", "0" ],
|
||||
[ "text", ", " ],
|
||||
[ "constant.numeric", "0" ],
|
||||
[ "text", ", " ],
|
||||
[ "variable", "@alpha" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "// Box styles" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "variable.language", ".box" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ],
|
||||
[ "text", " " ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "support.type", "color" ],
|
||||
[ "text", ": " ],
|
||||
[ "support.function", "saturate" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "variable", "@base" ],
|
||||
[ "text", ", " ],
|
||||
[ "constant.numeric", "5%" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "support.type", "border-color" ],
|
||||
[ "text", ": " ],
|
||||
[ "support.function", "lighten" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "variable", "@base" ],
|
||||
[ "text", ", " ],
|
||||
[ "constant.numeric", "30%" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable.language", "div" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ],
|
||||
[ "text", " " ],
|
||||
[ "variable.language", ".box-shadow" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "constant.numeric", "0" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "0" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "5px" ],
|
||||
[ "text", ", " ],
|
||||
[ "constant.numeric", "30%" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable.language", "a" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "support.type", "color" ],
|
||||
[ "text", ": " ],
|
||||
[ "variable", "@base" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " &" ],
|
||||
[ "variable.language", ":hover" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "support.type", "color" ],
|
||||
[ "text", ": " ],
|
||||
[ "support.function", "lighten" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "variable", "@base" ],
|
||||
[ "text", ", " ],
|
||||
[ "constant.numeric", "50%" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
}
|
||||
]
|
||||
-698
@@ -1,698 +0,0 @@
|
||||
[
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "The following examples can be found in full at http://liquidmarkup.org/" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "Liquid is an extraction from the e-commerce system Shopify." ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "Shopify powers many thousands of e-commerce stores which all call for unique designs." ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "For this we developed Liquid which allows our customers complete design freedom while" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "maintaining the integrity of our servers." ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "Liquid has been in production use since June 2006 and is now used by many other" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "hosted web applications." ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "It was developed for usage in Ruby on Rails web applications and integrates seamlessly" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "as a plugin but it also works excellently as a stand alone library." ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "Here's what it looks like:" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "ul" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "id" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"products\"" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "{%" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "for" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "product" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "in" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "products" ],
|
||||
[ "text", " " ],
|
||||
[ "variable", "%}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "li" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "h2" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "variable", "{{" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "product" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "title" ],
|
||||
[ "text", " " ],
|
||||
[ "variable", "}}" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "h2" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " Only {{ product.price | format_as_money }}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "p" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "variable", "{{" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "product" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "description" ],
|
||||
[ "text", " | " ],
|
||||
[ "identifier", "prettyprint" ],
|
||||
[ "text", " | " ],
|
||||
[ "support.function", "truncate" ],
|
||||
[ "text", ": " ],
|
||||
[ "constant.numeric", "200" ],
|
||||
[ "text", " " ],
|
||||
[ "variable", "}}" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "p" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "li" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "{%" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "endfor" ],
|
||||
[ "text", " " ],
|
||||
[ "variable", "%}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "ul" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "Some more features include:" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "h2" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", "Filters" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "h2" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "p" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", " The word \"tobi\" in uppercase: {{ 'tobi' | upcase }} " ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "p" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "p" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", "The word \"tobi\" has {{ 'tobi' | size }} letters! " ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "p" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "p" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", "Change \"Hello world\" to \"Hi world\": {{ 'Hello world' | replace: 'Hello', 'Hi' }} " ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "p" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "p" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", "The date today is {{ 'now' | date: \"%Y %b %d\" }} " ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "p" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "h2" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", "If" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "h2" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "p" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "{%" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "if" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "user" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "name" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "'tobi'" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "or" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "user" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "name" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "'marc'" ],
|
||||
[ "text", " " ],
|
||||
[ "variable", "%}" ],
|
||||
[ "text", " " ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " hi marc or tobi" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "{%" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "endif" ],
|
||||
[ "text", " " ],
|
||||
[ "variable", "%}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "p" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "h2" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", "Case" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "h2" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "p" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "{%" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "case" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "template" ],
|
||||
[ "text", " " ],
|
||||
[ "variable", "%}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "{%" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "when" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "'index'" ],
|
||||
[ "text", " " ],
|
||||
[ "variable", "%}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " Welcome" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "{%" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "when" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "'product'" ],
|
||||
[ "text", " " ],
|
||||
[ "variable", "%}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "{{" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "product" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "vendor" ],
|
||||
[ "text", " | " ],
|
||||
[ "identifier", "link_to_vendor" ],
|
||||
[ "text", " " ],
|
||||
[ "variable", "}}" ],
|
||||
[ "text", " / {{ product.title }}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "{%" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "else" ],
|
||||
[ "text", " " ],
|
||||
[ "variable", "%}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "{{" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "page_title" ],
|
||||
[ "text", " " ],
|
||||
[ "variable", "}}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "{%" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "endcase" ],
|
||||
[ "text", " " ],
|
||||
[ "variable", "%}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "p" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "h2" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", "For Loops" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "h2" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "p" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "{%" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "for" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "item" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "in" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "array" ],
|
||||
[ "text", " " ],
|
||||
[ "variable", "%}" ],
|
||||
[ "text", " " ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "{{" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "item" ],
|
||||
[ "text", " " ],
|
||||
[ "variable", "}}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "{%" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "endfor" ],
|
||||
[ "text", " " ],
|
||||
[ "variable", "%}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "p" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "h2" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", "Tables" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "h2" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "p" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "{%" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "tablerow" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "item" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "in" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "items" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "cols" ],
|
||||
[ "text", ": " ],
|
||||
[ "constant.numeric", "3" ],
|
||||
[ "text", " " ],
|
||||
[ "variable", "%}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "{%" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "if" ],
|
||||
[ "text", " " ],
|
||||
[ "variable.language", "tablerowloop" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "col_first" ],
|
||||
[ "text", " " ],
|
||||
[ "variable", "%}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " First column: {{ item.variable }}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "{%" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "else" ],
|
||||
[ "text", " " ],
|
||||
[ "variable", "%}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " Different column: {{ item.variable }}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "{%" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "endif" ],
|
||||
[ "text", " " ],
|
||||
[ "variable", "%}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "{%" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "endtablerow" ],
|
||||
[ "text", " " ],
|
||||
[ "variable", "%}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "p" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
}
|
||||
]
|
||||
-451
@@ -1,451 +0,0 @@
|
||||
[
|
||||
{
|
||||
"state": "qcomment",
|
||||
"data": [
|
||||
[ "comment", "--[[--" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "qcomment",
|
||||
"data": [
|
||||
[ "comment", "num_args takes in 5.1 byte code and extracts the number of arguments" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "qcomment",
|
||||
"data": [
|
||||
[ "comment", "from its function header." ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "--]]" ],
|
||||
[ "comment", "--" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "function" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "int" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "t" ],
|
||||
[ "paren.rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t" ],
|
||||
[ "keyword", "return" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "t" ],
|
||||
[ "keyword.operator", ":" ],
|
||||
[ "support.function", "byte" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "constant.numeric", "1" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "keyword.operator", "+" ],
|
||||
[ "identifier", "t" ],
|
||||
[ "keyword.operator", ":" ],
|
||||
[ "support.function", "byte" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "constant.numeric", "2" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "keyword.operator", "*" ],
|
||||
[ "constant.numeric", "0x100" ],
|
||||
[ "keyword.operator", "+" ],
|
||||
[ "identifier", "t" ],
|
||||
[ "keyword.operator", ":" ],
|
||||
[ "support.function", "byte" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "constant.numeric", "3" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "keyword.operator", "*" ],
|
||||
[ "constant.numeric", "0x10000" ],
|
||||
[ "keyword.operator", "+" ],
|
||||
[ "identifier", "t" ],
|
||||
[ "keyword.operator", ":" ],
|
||||
[ "support.function", "byte" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "constant.numeric", "4" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "keyword.operator", "*" ],
|
||||
[ "constant.numeric", "0x1000000" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "end" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "function" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "num_args" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "func" ],
|
||||
[ "paren.rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t" ],
|
||||
[ "keyword", "local" ],
|
||||
[ "text", " " ],
|
||||
[ "support.function", "dump" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.library", "string" ],
|
||||
[ "text", "." ],
|
||||
[ "support.function", "dump" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "func" ],
|
||||
[ "paren.rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t" ],
|
||||
[ "keyword", "local" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "offset" ],
|
||||
[ "text", ", " ],
|
||||
[ "identifier", "cursor" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "int" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "support.function", "dump" ],
|
||||
[ "keyword.operator", ":" ],
|
||||
[ "support.function", "sub" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "constant.numeric", "13" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", ", " ],
|
||||
[ "identifier", "offset" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "+" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "26" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t" ],
|
||||
[ "comment", "--Get the params and var flag (whether there's a ... in the param)" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t" ],
|
||||
[ "keyword", "return" ],
|
||||
[ "text", " " ],
|
||||
[ "support.function", "dump" ],
|
||||
[ "keyword.operator", ":" ],
|
||||
[ "support.function", "sub" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "cursor" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "keyword.operator", ":" ],
|
||||
[ "support.function", "byte" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", ", " ],
|
||||
[ "support.function", "dump" ],
|
||||
[ "keyword.operator", ":" ],
|
||||
[ "support.function", "sub" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "cursor" ],
|
||||
[ "keyword.operator", "+" ],
|
||||
[ "constant.numeric", "1" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "keyword.operator", ":" ],
|
||||
[ "support.function", "byte" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "paren.rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "end" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "-- Usage:" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "identifier", "num_args" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "keyword", "function" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "a" ],
|
||||
[ "text", "," ],
|
||||
[ "identifier", "b" ],
|
||||
[ "text", "," ],
|
||||
[ "identifier", "c" ],
|
||||
[ "text", "," ],
|
||||
[ "identifier", "d" ],
|
||||
[ "text", ", " ],
|
||||
[ "keyword.operator", "..." ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "end" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "comment", "-- return 4, 7" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "-- Python styled string format operator" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "local" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "gm" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.library", "debug" ],
|
||||
[ "text", "." ],
|
||||
[ "support.function", "getmetatable" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "string", "\"\"" ],
|
||||
[ "paren.rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "identifier", "gm" ],
|
||||
[ "text", "." ],
|
||||
[ "support.function", "__mod" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "keyword", "function" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "self" ],
|
||||
[ "text", ", " ],
|
||||
[ "identifier", "other" ],
|
||||
[ "paren.rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "if" ],
|
||||
[ "text", " " ],
|
||||
[ "support.function", "type" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "other" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "~" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\"table\"" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "then" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "other" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ],
|
||||
[ "identifier", "other" ],
|
||||
[ "paren.rparen", "}" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "end" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "for" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "i" ],
|
||||
[ "text", "," ],
|
||||
[ "identifier", "v" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "in" ],
|
||||
[ "text", " " ],
|
||||
[ "support.function", "ipairs" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "other" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "do" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "other" ],
|
||||
[ "paren.lparen", "[" ],
|
||||
[ "identifier", "i" ],
|
||||
[ "paren.rparen", "]" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "support.function", "tostring" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "v" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "end" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "return" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "self" ],
|
||||
[ "keyword.operator", ":" ],
|
||||
[ "support.function", "format" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "support.function", "unpack" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "other" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "paren.rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "end" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "qstring3",
|
||||
"data": [
|
||||
[ "support.function", "print" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "string", "[===[" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "qstring3",
|
||||
"data": [
|
||||
[ "string", " blah blah %s, (%d %d)" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "string", "]===]" ],
|
||||
[ "keyword.operator", "%" ],
|
||||
[ "paren.lparen", "{" ],
|
||||
[ "string", "\"blah\"" ],
|
||||
[ "text", ", " ],
|
||||
[ "identifier", "num_args" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "int" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "paren.rparen", "}" ],
|
||||
[ "paren.rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "qcomment1",
|
||||
"data": [
|
||||
[ "comment", "--[=[--" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "qcomment1",
|
||||
"data": [
|
||||
[ "comment", "table.maxn is deprecated, use # instead." ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "--]=]" ],
|
||||
[ "comment", "--" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "support.function", "print" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "constant.library", "table" ],
|
||||
[ "text", "." ],
|
||||
[ "invalid.deprecated", "maxn" ],
|
||||
[ "paren.lparen", "{" ],
|
||||
[ "constant.numeric", "1" ],
|
||||
[ "text", "," ],
|
||||
[ "constant.numeric", "2" ],
|
||||
[ "text", "," ],
|
||||
[ "paren.lparen", "[" ],
|
||||
[ "constant.numeric", "4" ],
|
||||
[ "paren.rparen", "]" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "constant.numeric", "4" ],
|
||||
[ "text", "," ],
|
||||
[ "paren.lparen", "[" ],
|
||||
[ "constant.numeric", "8" ],
|
||||
[ "paren.rparen", "]" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "constant.numeric", "8" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "comment", "-- outputs 8 instead of 2" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
}
|
||||
]
|
||||
-824
@@ -1,824 +0,0 @@
|
||||
[
|
||||
{
|
||||
"state": "tag_embed_attribute_list",
|
||||
"data": [
|
||||
[ "text", "" ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "text", "!" ],
|
||||
[ "entity.other.attribute-name", "DOCTYPE" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "html" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "PUBLIC" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\"-//W3C//DTD XHTML 1.0 Strict//EN\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "string", "\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\"" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "html" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "lua-qcomment",
|
||||
"data": [
|
||||
[ "keyword", "<%" ],
|
||||
[ "text", " " ],
|
||||
[ "comment", "--[[--" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "lua-qcomment",
|
||||
"data": [
|
||||
[ "comment", " index.lp from the Kepler Project's LuaDoc HTML doclet." ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "lua-qcomment",
|
||||
"data": [
|
||||
[ "comment", " http://keplerproject.github.com/luadoc/" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "--]]" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "%>" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "head" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "title" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", "Reference" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "title" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "link" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "rel" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"stylesheet\"" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "href" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"<%=luadoc.doclet.html.link(\"" ],
|
||||
[ "entity.other.attribute-name", "luadoc" ],
|
||||
[ "text", "." ],
|
||||
[ "entity.other.attribute-name", "css" ],
|
||||
[ "string", "\")%>\"" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "type" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"text/css\"" ],
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "/>" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t" ],
|
||||
[ "comment", "<!--" ],
|
||||
[ "comment", "meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/-->" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "head" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "body" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "div" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "id" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"container\"" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "div" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "id" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"product\"" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t" ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "div" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "id" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"product_logo\"" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "div" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t" ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "div" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "id" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"product_name\"" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "big" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "b" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "b" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "big" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "div" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t" ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "div" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "id" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"product_description\"" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "div" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "div" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", " " ],
|
||||
[ "comment", "<!--" ],
|
||||
[ "comment", " id=\"product\" -->" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "div" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "id" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"main\"" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "div" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "id" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"navigation\"" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "<%=" ],
|
||||
[ "identifier", "luadoc" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "doclet" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "html" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "include" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "string", "\"menu.lp\"" ],
|
||||
[ "text", ", " ],
|
||||
[ "paren.lparen", "{" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "doc" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "identifier", "doc" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.rparen", "}" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "keyword", "%>" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "div" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", " " ],
|
||||
[ "comment", "<!--" ],
|
||||
[ "comment", " id=\"navigation\" -->" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "div" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "id" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"content\"" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "<%" ],
|
||||
[ "keyword", "if" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "not" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "options" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "nomodules" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "and" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "#" ],
|
||||
[ "identifier", "doc" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "modules" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", ">" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "0" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "then" ],
|
||||
[ "keyword", "%>" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "h2" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", "Modules" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "h2" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name.table", "table" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "class" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"module_list\"" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "<!--" ],
|
||||
[ "comment", "<tr><td colspan=\"2\">Modules</td></tr>-->" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "<%" ],
|
||||
[ "keyword", "for" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "_" ],
|
||||
[ "text", ", " ],
|
||||
[ "identifier", "modulename" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "in" ],
|
||||
[ "text", " " ],
|
||||
[ "support.function", "ipairs" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "doc" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "modules" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "do" ],
|
||||
[ "keyword", "%>" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t" ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name.table", "tr" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t\t" ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name.table", "td" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "class" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"name\"" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name.anchor", "a" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "href" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"<%=luadoc.doclet.html.module_link(modulename, doc)%>\"" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "keyword", "<%=" ],
|
||||
[ "identifier", "modulename" ],
|
||||
[ "keyword", "%>" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name.anchor", "a" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name.table", "td" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t\t" ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name.table", "td" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "class" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"summary\"" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "keyword", "<%=" ],
|
||||
[ "identifier", "doc" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "modules" ],
|
||||
[ "paren.lparen", "[" ],
|
||||
[ "identifier", "modulename" ],
|
||||
[ "paren.rparen", "]" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "summary" ],
|
||||
[ "keyword", "%>" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name.table", "td" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name.table", "tr" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "<%" ],
|
||||
[ "keyword", "end" ],
|
||||
[ "keyword", "%>" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name.table", "table" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "<%" ],
|
||||
[ "keyword", "end" ],
|
||||
[ "keyword", "%>" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "<%" ],
|
||||
[ "keyword", "if" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "not" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "options" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "nofiles" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "and" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "#" ],
|
||||
[ "identifier", "doc" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "files" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", ">" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "0" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "then" ],
|
||||
[ "keyword", "%>" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "h2" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", "Files" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "h2" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name.table", "table" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "class" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"file_list\"" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "<!--" ],
|
||||
[ "comment", "<tr><td colspan=\"2\">Files</td></tr>-->" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "<%" ],
|
||||
[ "keyword", "for" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "_" ],
|
||||
[ "text", ", " ],
|
||||
[ "identifier", "filepath" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "in" ],
|
||||
[ "text", " " ],
|
||||
[ "support.function", "ipairs" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "doc" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "files" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "do" ],
|
||||
[ "keyword", "%>" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t" ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name.table", "tr" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t\t" ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name.table", "td" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "class" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"name\"" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name.anchor", "a" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "href" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"<%=luadoc.doclet.html.file_link(filepath)%>\"" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "keyword", "<%=" ],
|
||||
[ "identifier", "filepath" ],
|
||||
[ "keyword", "%>" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name.anchor", "a" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name.table", "td" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t\t" ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name.table", "td" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "class" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"summary\"" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name.table", "td" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name.table", "tr" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "<%" ],
|
||||
[ "keyword", "end" ],
|
||||
[ "keyword", "%>" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name.table", "table" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "<%" ],
|
||||
[ "keyword", "end" ],
|
||||
[ "keyword", "%>" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "div" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", " " ],
|
||||
[ "comment", "<!--" ],
|
||||
[ "comment", " id=\"content\" -->" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "div" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", " " ],
|
||||
[ "comment", "<!--" ],
|
||||
[ "comment", " id=\"main\" -->" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "div" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "id" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"about\"" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t" ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "p" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name.anchor", "a" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "href" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"http://validator.w3.org/check?uri=referer\"" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name.image", "img" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "src" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"http://www.w3.org/Icons/valid-xhtml10\"" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "alt" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"Valid XHTML 1.0!\"" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "height" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"31\"" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "width" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"88\"" ],
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "/>" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name.anchor", "a" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "p" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "div" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", " " ],
|
||||
[ "comment", "<!--" ],
|
||||
[ "comment", " id=\"about\" -->" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "div" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", " " ],
|
||||
[ "comment", "<!--" ],
|
||||
[ "comment", " id=\"container\" -->" ],
|
||||
[ "text", "\t" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "body" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "html" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
}
|
||||
]
|
||||
-1202
File diff suppressed because it is too large
Load Diff
-260
@@ -1,260 +0,0 @@
|
||||
[
|
||||
{
|
||||
"state": "comment",
|
||||
"data": [
|
||||
[ "comment", "(*" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "comment",
|
||||
"data": [
|
||||
[ "comment", " * Example of early return implementation taken from" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "comment",
|
||||
"data": [
|
||||
[ "comment", " * http://ocaml.janestreet.com/?q=node/91" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", " *)" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "let" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "with_return" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "keyword", "type" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "t" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "f" ],
|
||||
[ "text", " : " ],
|
||||
[ "identifier", "_" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "-" ],
|
||||
[ "keyword.operator", ">" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "t" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "let" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "module" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "M" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "struct" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "exception" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "Return" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "of" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "t" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "end" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "in" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "let" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "return" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "return" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "keyword", "fun" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "x" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "-" ],
|
||||
[ "keyword.operator", ">" ],
|
||||
[ "text", " " ],
|
||||
[ "support.function", "raise" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "M" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "Return" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "x" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", "; " ],
|
||||
[ "paren.rparen", "}" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "in" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "try" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "f" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "return" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "with" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "M" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "Return" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "x" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "-" ],
|
||||
[ "keyword.operator", ">" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "x" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "(* Function that uses the 'early return' functionality provided by `with_return` *)" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "let" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "sum_until_first_negative" ],
|
||||
[ "text", " " ],
|
||||
[ "support.function", "list" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "with_return" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "keyword", "fun" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "r" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "-" ],
|
||||
[ "keyword.operator", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "support.function", "List" ],
|
||||
[ "text", "." ],
|
||||
[ "support.function", "fold" ],
|
||||
[ "text", " " ],
|
||||
[ "support.function", "list" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "~" ],
|
||||
[ "support.function", "init" ],
|
||||
[ "text", ":" ],
|
||||
[ "constant.numeric", "0" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "~" ],
|
||||
[ "identifier", "f" ],
|
||||
[ "text", ":" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "keyword", "fun" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "acc" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "x" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "-" ],
|
||||
[ "keyword.operator", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "if" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "x" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", ">" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "0" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "then" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "acc" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "+" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "x" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "else" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "r" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "return" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "acc" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "paren.rparen", ")" ]
|
||||
]
|
||||
}
|
||||
]
|
||||
-311
@@ -1,311 +0,0 @@
|
||||
[
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "#!/usr/bin/perl" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "use" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "strict" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "use" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "warnings" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "my" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "$num_primes" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "0" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "my" ],
|
||||
[ "text", " @" ],
|
||||
[ "identifier", "primes" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "# Put 2 as the first prime so we won't have an empty array" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "identifier", "$primes" ],
|
||||
[ "lparen", "[" ],
|
||||
[ "identifier", "$num_primes" ],
|
||||
[ "rparen", "]" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "2" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "identifier", "$num_primes" ],
|
||||
[ "keyword.operator", "++" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "identifier", "MAIN_LOOP" ],
|
||||
[ "text", ":" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "for" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "my" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "$number_to_check" ],
|
||||
[ "text", " " ],
|
||||
[ "lparen", "(" ],
|
||||
[ "constant.numeric", "3" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", ".." ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "200" ],
|
||||
[ "rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "for" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "my" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "$p" ],
|
||||
[ "text", " " ],
|
||||
[ "lparen", "(" ],
|
||||
[ "constant.numeric", "0" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", ".." ],
|
||||
[ "text", " " ],
|
||||
[ "lparen", "(" ],
|
||||
[ "identifier", "$num_primes" ],
|
||||
[ "constant.numeric", "-1" ],
|
||||
[ "rparen", ")" ],
|
||||
[ "rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "if" ],
|
||||
[ "text", " " ],
|
||||
[ "lparen", "(" ],
|
||||
[ "identifier", "$number_to_check" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "%" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "$primes" ],
|
||||
[ "lparen", "[" ],
|
||||
[ "identifier", "$p" ],
|
||||
[ "rparen", "]" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "==" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "0" ],
|
||||
[ "rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "next" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "MAIN_LOOP" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "comment", "# If we reached this point it means $number_to_check is not" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "comment", "# divisable by any prime number that came before it." ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "$primes" ],
|
||||
[ "lparen", "[" ],
|
||||
[ "identifier", "$num_primes" ],
|
||||
[ "rparen", "]" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "$number_to_check" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "$num_primes" ],
|
||||
[ "keyword.operator", "++" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "for" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "my" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "$p" ],
|
||||
[ "text", " " ],
|
||||
[ "lparen", "(" ],
|
||||
[ "constant.numeric", "0" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", ".." ],
|
||||
[ "text", " " ],
|
||||
[ "lparen", "(" ],
|
||||
[ "identifier", "$num_primes" ],
|
||||
[ "constant.numeric", "-1" ],
|
||||
[ "rparen", ")" ],
|
||||
[ "rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "support.function", "print" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "$primes" ],
|
||||
[ "lparen", "[" ],
|
||||
[ "identifier", "$p" ],
|
||||
[ "rparen", "]" ],
|
||||
[ "keyword.operator", "," ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\", \"" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "support.function", "print" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\"\\n\"" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
}
|
||||
]
|
||||
-1020
File diff suppressed because it is too large
Load Diff
-238
@@ -1,238 +0,0 @@
|
||||
[
|
||||
{
|
||||
"state": "php-start",
|
||||
"data": [
|
||||
[ "support.php_tag", "<?php" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "php-start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "php-start",
|
||||
"data": [
|
||||
[ "keyword", "function" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "nfact" ],
|
||||
[ "lparen", "(" ],
|
||||
[ "variable", "$n" ],
|
||||
[ "rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "php-start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "if" ],
|
||||
[ "text", " " ],
|
||||
[ "lparen", "(" ],
|
||||
[ "variable", "$n" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "==" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "0" ],
|
||||
[ "rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "php-start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "support.function", "return" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "1" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "php-start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "php-start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "else" ],
|
||||
[ "text", " " ],
|
||||
[ "lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "php-start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "support.function", "return" ],
|
||||
[ "text", " " ],
|
||||
[ "variable", "$n" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "*" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "nfact" ],
|
||||
[ "lparen", "(" ],
|
||||
[ "variable", "$n" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "-" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "1" ],
|
||||
[ "rparen", ")" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "php-start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "php-start",
|
||||
"data": [
|
||||
[ "rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "php-start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "php-start",
|
||||
"data": [
|
||||
[ "support.function", "echo" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\"" ],
|
||||
[ "constant.language.escape", "\\n" ],
|
||||
[ "constant.language.escape", "\\n" ],
|
||||
[ "string", "P" ],
|
||||
[ "string", "l" ],
|
||||
[ "string", "e" ],
|
||||
[ "string", "a" ],
|
||||
[ "string", "s" ],
|
||||
[ "string", "e" ],
|
||||
[ "string", " " ],
|
||||
[ "string", "e" ],
|
||||
[ "string", "n" ],
|
||||
[ "string", "t" ],
|
||||
[ "string", "e" ],
|
||||
[ "string", "r" ],
|
||||
[ "string", " " ],
|
||||
[ "string", "a" ],
|
||||
[ "string", " " ],
|
||||
[ "string", "w" ],
|
||||
[ "string", "h" ],
|
||||
[ "string", "o" ],
|
||||
[ "string", "l" ],
|
||||
[ "string", "e" ],
|
||||
[ "string", " " ],
|
||||
[ "string", "n" ],
|
||||
[ "string", "u" ],
|
||||
[ "string", "m" ],
|
||||
[ "string", "b" ],
|
||||
[ "string", "e" ],
|
||||
[ "string", "r" ],
|
||||
[ "string", " " ],
|
||||
[ "string", "." ],
|
||||
[ "string", "." ],
|
||||
[ "string", "." ],
|
||||
[ "string", " " ],
|
||||
[ "string", "\"" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "php-start",
|
||||
"data": [
|
||||
[ "variable", "$num" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "support.function", "trim" ],
|
||||
[ "lparen", "(" ],
|
||||
[ "support.function", "fgets" ],
|
||||
[ "lparen", "(" ],
|
||||
[ "constant.language", "STDIN" ],
|
||||
[ "rparen", ")" ],
|
||||
[ "rparen", ")" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "php-start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "php-start",
|
||||
"data": [
|
||||
[ "comment", "// ===== PROCESS - Determing the factorial of the input number =====" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "php-start",
|
||||
"data": [
|
||||
[ "variable", "$output" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\"" ],
|
||||
[ "constant.language.escape", "\\n" ],
|
||||
[ "constant.language.escape", "\\n" ],
|
||||
[ "string", "F" ],
|
||||
[ "string", "a" ],
|
||||
[ "string", "c" ],
|
||||
[ "string", "t" ],
|
||||
[ "string", "o" ],
|
||||
[ "string", "r" ],
|
||||
[ "string", "i" ],
|
||||
[ "string", "a" ],
|
||||
[ "string", "l" ],
|
||||
[ "string", " " ],
|
||||
[ "string", "\"" ],
|
||||
[ "text", " . " ],
|
||||
[ "variable", "$num" ],
|
||||
[ "text", " . " ],
|
||||
[ "string", "\"" ],
|
||||
[ "string", " " ],
|
||||
[ "string", "=" ],
|
||||
[ "string", " " ],
|
||||
[ "string", "\"" ],
|
||||
[ "text", " . " ],
|
||||
[ "identifier", "nfact" ],
|
||||
[ "lparen", "(" ],
|
||||
[ "variable", "$num" ],
|
||||
[ "rparen", ")" ],
|
||||
[ "text", " . " ],
|
||||
[ "string", "\"" ],
|
||||
[ "constant.language.escape", "\\n" ],
|
||||
[ "constant.language.escape", "\\n" ],
|
||||
[ "string", "\"" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "php-start",
|
||||
"data": [
|
||||
[ "support.function", "echo" ],
|
||||
[ "text", " " ],
|
||||
[ "variable", "$output" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "php-start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "support.php_tag", "?>" ]
|
||||
]
|
||||
}
|
||||
]
|
||||
-255
@@ -1,255 +0,0 @@
|
||||
[
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "# This is a simple comment" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "function" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "Hello" ],
|
||||
[ "lparen", "(" ],
|
||||
[ "variable.instance", "$name" ],
|
||||
[ "rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "Write-host" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\"Hello $name\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "function" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "add" ],
|
||||
[ "lparen", "(" ],
|
||||
[ "variable.instance", "$left" ],
|
||||
[ "text", ", " ],
|
||||
[ "variable.instance", "$right" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "constant.numeric", "4" ],
|
||||
[ "rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "if" ],
|
||||
[ "text", " " ],
|
||||
[ "lparen", "(" ],
|
||||
[ "variable.instance", "$right" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "-ne" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "4" ],
|
||||
[ "rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "return" ],
|
||||
[ "text", " " ],
|
||||
[ "variable.instance", "$left" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "rparen", "}" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "elseif" ],
|
||||
[ "text", " " ],
|
||||
[ "lparen", "(" ],
|
||||
[ "variable.instance", "$left" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "-eq" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.language", "$null" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "-and" ],
|
||||
[ "text", " " ],
|
||||
[ "variable.instance", "$right" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "-eq" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "2" ],
|
||||
[ "rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "return" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "3" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "rparen", "}" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "else" ],
|
||||
[ "text", " " ],
|
||||
[ "lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "return" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "2" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "variable.instance", "$number" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "1" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "+" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "2" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "variable.instance", "$number" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "+" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "3" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "support.function", "Write-Host" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "Hello" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "-" ],
|
||||
[ "identifier", "name" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\"World\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "variable.instance", "$an_array" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " @" ],
|
||||
[ "lparen", "(" ],
|
||||
[ "constant.numeric", "1" ],
|
||||
[ "text", ", " ],
|
||||
[ "constant.numeric", "2" ],
|
||||
[ "text", ", " ],
|
||||
[ "constant.numeric", "3" ],
|
||||
[ "rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "variable.instance", "$a_hash" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " @" ],
|
||||
[ "lparen", "{" ],
|
||||
[ "string", "\"something\"" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\"something else\"" ],
|
||||
[ "rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword.operator", "&" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "notepad" ],
|
||||
[ "text", " .\\" ],
|
||||
[ "identifier", "readme" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "md" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
}
|
||||
]
|
||||
-205
@@ -1,205 +0,0 @@
|
||||
[
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "#!/usr/local/bin/python" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "import" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "string" ],
|
||||
[ "text", ", " ],
|
||||
[ "identifier", "sys" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "# If no arguments were given, print a helpful message" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "if" ],
|
||||
[ "text", " " ],
|
||||
[ "support.function", "len" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "sys" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "argv" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "keyword.operator", "==" ],
|
||||
[ "constant.numeric", "1" ],
|
||||
[ "text", ":" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "qstring",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "print" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "'''Usage:" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "string", "celsius temp1 temp2 ...'''" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "sys" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "exit" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "constant.numeric", "0" ],
|
||||
[ "paren.rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "# Loop over the arguments" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "for" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "i" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "in" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "sys" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "argv" ],
|
||||
[ "paren.lparen", "[" ],
|
||||
[ "constant.numeric", "1" ],
|
||||
[ "text", ":" ],
|
||||
[ "paren.rparen", "]" ],
|
||||
[ "text", ":" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "try" ],
|
||||
[ "text", ":" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "fahrenheit" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "support.function", "float" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "string" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "atoi" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "i" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "paren.rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "except" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "string" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "atoi_error" ],
|
||||
[ "text", ":" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "print" ],
|
||||
[ "text", " " ],
|
||||
[ "support.function", "repr" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "i" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", ", " ],
|
||||
[ "string", "\"not a numeric value\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "else" ],
|
||||
[ "text", ":" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "celsius" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "fahrenheit" ],
|
||||
[ "keyword.operator", "-" ],
|
||||
[ "constant.numeric", "32" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "keyword.operator", "*" ],
|
||||
[ "constant.numeric", "5.0" ],
|
||||
[ "keyword.operator", "/" ],
|
||||
[ "constant.numeric", "9.0" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "print" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "'%i\\260F = %i\\260C'" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "%" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "support.function", "int" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "fahrenheit" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", ", " ],
|
||||
[ "support.function", "int" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "celsius" ],
|
||||
[ "keyword.operator", "+" ],
|
||||
[ "constant.numeric", ".5" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "paren.rparen", ")" ]
|
||||
]
|
||||
}
|
||||
]
|
||||
-104
@@ -1,104 +0,0 @@
|
||||
[
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "#!/usr/bin/ruby" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "# Program to find the factorial of a number" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "def" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "fact" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "n" ],
|
||||
[ "paren.rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "if" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "n" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "==" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "0" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "1" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "else" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "n" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "*" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "fact" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "n" ],
|
||||
[ "constant.numeric", "-1" ],
|
||||
[ "paren.rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "end" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "end" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "support.function", "puts" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "fact" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "variable.class", "ARGV" ],
|
||||
[ "paren.lparen", "[" ],
|
||||
[ "constant.numeric", "0" ],
|
||||
[ "paren.rparen", "]" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "to_i" ],
|
||||
[ "paren.rparen", ")" ]
|
||||
]
|
||||
}
|
||||
]
|
||||
-267
@@ -1,267 +0,0 @@
|
||||
[
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "// ace can highlight scad!" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "module" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "Element" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "xpos" ],
|
||||
[ "text", ", " ],
|
||||
[ "identifier", "ypos" ],
|
||||
[ "text", ", " ],
|
||||
[ "identifier", "zpos" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t" ],
|
||||
[ "identifier", "translate" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "paren.lparen", "[" ],
|
||||
[ "identifier", "xpos" ],
|
||||
[ "text", "," ],
|
||||
[ "identifier", "ypos" ],
|
||||
[ "text", "," ],
|
||||
[ "identifier", "zpos" ],
|
||||
[ "paren.rparen", "]" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t\t" ],
|
||||
[ "identifier", "union" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t\t\t" ],
|
||||
[ "identifier", "cube" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "paren.lparen", "[" ],
|
||||
[ "constant.numeric", "10" ],
|
||||
[ "text", "," ],
|
||||
[ "constant.numeric", "10" ],
|
||||
[ "text", "," ],
|
||||
[ "constant.numeric", "4" ],
|
||||
[ "paren.rparen", "]" ],
|
||||
[ "text", "," ],
|
||||
[ "identifier", "true" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t\t\t" ],
|
||||
[ "identifier", "cylinder" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "constant.numeric", "10" ],
|
||||
[ "text", "," ],
|
||||
[ "constant.numeric", "15" ],
|
||||
[ "text", "," ],
|
||||
[ "constant.numeric", "5" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t\t\t" ],
|
||||
[ "identifier", "translate" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "paren.lparen", "[" ],
|
||||
[ "constant.numeric", "0" ],
|
||||
[ "text", "," ],
|
||||
[ "constant.numeric", "0" ],
|
||||
[ "text", "," ],
|
||||
[ "constant.numeric", "10" ],
|
||||
[ "paren.rparen", "]" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "identifier", "sphere" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "constant.numeric", "5" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t\t" ],
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t" ],
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "identifier", "union" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t" ],
|
||||
[ "keyword", "for" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "i" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "paren.lparen", "[" ],
|
||||
[ "constant.numeric", "0" ],
|
||||
[ "text", ":" ],
|
||||
[ "constant.numeric", "30" ],
|
||||
[ "paren.rparen", "]" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t\t# " ],
|
||||
[ "identifier", "Element" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "constant.numeric", "0" ],
|
||||
[ "text", "," ],
|
||||
[ "constant.numeric", "0" ],
|
||||
[ "text", "," ],
|
||||
[ "constant.numeric", "0" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t\t" ],
|
||||
[ "identifier", "Element" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "constant.numeric", "15" ],
|
||||
[ "keyword.operator", "*" ],
|
||||
[ "identifier", "i" ],
|
||||
[ "text", "," ],
|
||||
[ "constant.numeric", "0" ],
|
||||
[ "text", "," ],
|
||||
[ "constant.numeric", "0" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t" ],
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "for" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "i" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "[" ],
|
||||
[ "constant.numeric", "3" ],
|
||||
[ "text", ", " ],
|
||||
[ "constant.numeric", "5" ],
|
||||
[ "text", ", " ],
|
||||
[ "constant.numeric", "7" ],
|
||||
[ "text", ", " ],
|
||||
[ "constant.numeric", "11" ],
|
||||
[ "paren.rparen", "]" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t" ],
|
||||
[ "identifier", "rotate" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "paren.lparen", "[" ],
|
||||
[ "identifier", "i" ],
|
||||
[ "keyword.operator", "*" ],
|
||||
[ "constant.numeric", "10" ],
|
||||
[ "text", "," ],
|
||||
[ "constant.numeric", "0" ],
|
||||
[ "text", "," ],
|
||||
[ "constant.numeric", "0" ],
|
||||
[ "paren.rparen", "]" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "identifier", "scale" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "paren.lparen", "[" ],
|
||||
[ "constant.numeric", "1" ],
|
||||
[ "text", "," ],
|
||||
[ "constant.numeric", "1" ],
|
||||
[ "text", "," ],
|
||||
[ "identifier", "i" ],
|
||||
[ "paren.rparen", "]" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "identifier", "cube" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "constant.numeric", "10" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
}
|
||||
]
|
||||
-748
@@ -1,748 +0,0 @@
|
||||
[
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "// http://www.scala-lang.org/node/54" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "package" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "examples" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "actors" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "import" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "scala" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "actors" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "Actor" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "import" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "scala" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "actors" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "Actor" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "_" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "abstract" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "class" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "PingMessage" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "case" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "object" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "Start" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "extends" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "PingMessage" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "case" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "object" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "SendPing" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "extends" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "PingMessage" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "case" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "object" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "Pong" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "extends" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "PingMessage" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "abstract" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "class" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "PongMessage" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "case" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "object" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "Ping" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "extends" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "PongMessage" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "case" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "object" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "Stop" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "extends" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "PongMessage" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "object" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "pingpong" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "extends" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "Application" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "val" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "pong" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "new" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "Pong" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "val" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "ping" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "new" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "Ping" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "constant.numeric", "100000" ],
|
||||
[ "text", ", " ],
|
||||
[ "identifier", "pong" ],
|
||||
[ "paren.rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "ping" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "start" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "pong" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "start" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "ping" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "!" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "Start" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "class" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "Ping" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "count" ],
|
||||
[ "text", ": " ],
|
||||
[ "support.function", "Int" ],
|
||||
[ "text", ", " ],
|
||||
[ "identifier", "pong" ],
|
||||
[ "text", ": " ],
|
||||
[ "identifier", "Actor" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "extends" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "Actor" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "def" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "act" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "println" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "string", "\"Ping: Initializing with count \"" ],
|
||||
[ "keyword.operator", "+" ],
|
||||
[ "identifier", "count" ],
|
||||
[ "keyword.operator", "+" ],
|
||||
[ "string", "\": \"" ],
|
||||
[ "keyword.operator", "+" ],
|
||||
[ "identifier", "pong" ],
|
||||
[ "paren.rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "var" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "pingsLeft" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "count" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "loop" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "react" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "case" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "Start" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "keyword.operator", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "println" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "string", "\"Ping: starting.\"" ],
|
||||
[ "paren.rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "pong" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "!" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "Ping" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "pingsLeft" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "pingsLeft" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "-" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "1" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "case" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "SendPing" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "keyword.operator", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "pong" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "!" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "Ping" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "pingsLeft" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "pingsLeft" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "-" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "1" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "case" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "Pong" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "keyword.operator", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "if" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "pingsLeft" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "%" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "1000" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "==" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "0" ],
|
||||
[ "paren.rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "println" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "string", "\"Ping: pong from: \"" ],
|
||||
[ "keyword.operator", "+" ],
|
||||
[ "identifier", "sender" ],
|
||||
[ "paren.rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "if" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "pingsLeft" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", ">" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "0" ],
|
||||
[ "paren.rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "self" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "!" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "SendPing" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "else" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "println" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "string", "\"Ping: Stop.\"" ],
|
||||
[ "paren.rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "pong" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "!" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "Stop" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "exit" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "symbol.constant", "'stop" ],
|
||||
[ "paren.rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "class" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "Pong" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "extends" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "Actor" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "def" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "act" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "var" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "pongCount" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "0" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "loop" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "react" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "case" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "Ping" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "keyword.operator", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "if" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "pongCount" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "%" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "1000" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "==" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "0" ],
|
||||
[ "paren.rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "println" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "string", "\"Pong: ping \"" ],
|
||||
[ "keyword.operator", "+" ],
|
||||
[ "identifier", "pongCount" ],
|
||||
[ "keyword.operator", "+" ],
|
||||
[ "string", "\" from \"" ],
|
||||
[ "keyword.operator", "+" ],
|
||||
[ "identifier", "sender" ],
|
||||
[ "paren.rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "sender" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "!" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "Pong" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "pongCount" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "pongCount" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "+" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "1" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "case" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "Stop" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "keyword.operator", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "println" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "string", "\"Pong: Stop.\"" ],
|
||||
[ "paren.rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "exit" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "symbol.constant", "'stop" ],
|
||||
[ "paren.rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
}
|
||||
]
|
||||
-181
@@ -1,181 +0,0 @@
|
||||
[
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "/*" ],
|
||||
[ "comment", " style.scss */" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "variable.language", "#navbar" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "$navbar-width" ],
|
||||
[ "text", ": " ],
|
||||
[ "constant.numeric", "800px" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "$items" ],
|
||||
[ "text", ": " ],
|
||||
[ "constant.numeric", "5" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "$navbar-color" ],
|
||||
[ "text", ": " ],
|
||||
[ "constant.numeric", "#ce4dd6" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "support.type", "width" ],
|
||||
[ "text", ": " ],
|
||||
[ "variable", "$navbar-width" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "support.type", "border-bottom" ],
|
||||
[ "text", ": " ],
|
||||
[ "constant.numeric", "2px" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.language", "solid" ],
|
||||
[ "text", " " ],
|
||||
[ "variable", "$navbar-color" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable.language", "li" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "support.type", "float" ],
|
||||
[ "text", ": " ],
|
||||
[ "support.type", "left" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "support.type", "width" ],
|
||||
[ "text", ": " ],
|
||||
[ "variable", "$navbar-width" ],
|
||||
[ "text", "/" ],
|
||||
[ "variable", "$items" ],
|
||||
[ "text", " " ],
|
||||
[ "constant", "-" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "10px" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "support.type", "background-color" ],
|
||||
[ "text", ": " ],
|
||||
[ "support.function", "lighten" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "variable", "$navbar-color" ],
|
||||
[ "text", ", " ],
|
||||
[ "constant.numeric", "20%" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " &" ],
|
||||
[ "variable.language", ":hover" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "support.type", "background-color" ],
|
||||
[ "text", ": " ],
|
||||
[ "support.function", "lighten" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "variable", "$navbar-color" ],
|
||||
[ "text", ", " ],
|
||||
[ "constant.numeric", "10%" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
}
|
||||
]
|
||||
-434
@@ -1,434 +0,0 @@
|
||||
[
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "#!/bin/sh" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "# Script to open a browser to current branch" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "# Repo formats:" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "# ssh git@github.com:richoH/gh_pr.git" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "# http https://richoH@github.com/richoH/gh_pr.git" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "# git git://github.com/richoH/gh_pr.git" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "variable", "username=" ],
|
||||
[ "text", "`" ],
|
||||
[ "identifier", "git" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "config" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "-" ],
|
||||
[ "keyword.operator", "-" ],
|
||||
[ "identifier", "get" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "github" ],
|
||||
[ "text", "." ],
|
||||
[ "identifier", "user" ],
|
||||
[ "text", "`" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "support.function", "get_repo()" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "git" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "remote" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "-" ],
|
||||
[ "identifier", "v" ],
|
||||
[ "text", " | " ],
|
||||
[ "identifier", "grep" ],
|
||||
[ "text", " $" ],
|
||||
[ "paren.lparen", "{" ],
|
||||
[ "text", "@:" ],
|
||||
[ "keyword.operator", "-" ],
|
||||
[ "variable", "$username" ],
|
||||
[ "paren.rparen", "}" ],
|
||||
[ "text", " | " ],
|
||||
[ "keyword", "while" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "read" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "remote" ],
|
||||
[ "text", "; " ],
|
||||
[ "keyword", "do" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "if" ],
|
||||
[ "text", " " ],
|
||||
[ "variable", "repo=" ],
|
||||
[ "text", "`" ],
|
||||
[ "constant.language", "echo" ],
|
||||
[ "text", " " ],
|
||||
[ "variable", "$remote" ],
|
||||
[ "text", " | " ],
|
||||
[ "identifier", "grep" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "-" ],
|
||||
[ "identifier", "E" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "-" ],
|
||||
[ "identifier", "o" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\"git@github.com:[^ ]*\"" ],
|
||||
[ "text", "`; " ],
|
||||
[ "keyword", "then" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "constant.language", "echo" ],
|
||||
[ "text", " " ],
|
||||
[ "variable", "$repo" ],
|
||||
[ "text", " | " ],
|
||||
[ "identifier", "sed" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "-" ],
|
||||
[ "identifier", "e" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\"s/^git@github\\.com://\"" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "-" ],
|
||||
[ "identifier", "e" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\"s/\\.git$//\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "constant.language", "exit" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "1" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "fi" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "if" ],
|
||||
[ "text", " " ],
|
||||
[ "variable", "repo=" ],
|
||||
[ "text", "`" ],
|
||||
[ "constant.language", "echo" ],
|
||||
[ "text", " " ],
|
||||
[ "variable", "$remote" ],
|
||||
[ "text", " | " ],
|
||||
[ "identifier", "grep" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "-" ],
|
||||
[ "identifier", "E" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "-" ],
|
||||
[ "identifier", "o" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\"https?://([^@]*@)?github.com/[^ ]*\\.git\"" ],
|
||||
[ "text", "`; " ],
|
||||
[ "keyword", "then" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "constant.language", "echo" ],
|
||||
[ "text", " " ],
|
||||
[ "variable", "$repo" ],
|
||||
[ "text", " | " ],
|
||||
[ "identifier", "sed" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "-" ],
|
||||
[ "identifier", "e" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\"s|^https?://||\"" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "-" ],
|
||||
[ "identifier", "e" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\"s/^.*github\\.com\\///\"" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "-" ],
|
||||
[ "identifier", "e" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\"s/\\.git$//\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "constant.language", "exit" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "1" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "fi" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "if" ],
|
||||
[ "text", " " ],
|
||||
[ "variable", "repo=" ],
|
||||
[ "text", "`" ],
|
||||
[ "constant.language", "echo" ],
|
||||
[ "text", " " ],
|
||||
[ "variable", "$remote" ],
|
||||
[ "text", " | " ],
|
||||
[ "identifier", "grep" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "-" ],
|
||||
[ "identifier", "E" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "-" ],
|
||||
[ "identifier", "o" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\"git://github.com/[^ ]*\\.git\"" ],
|
||||
[ "text", "`; " ],
|
||||
[ "keyword", "then" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "constant.language", "echo" ],
|
||||
[ "text", " " ],
|
||||
[ "variable", "$repo" ],
|
||||
[ "text", " | " ],
|
||||
[ "identifier", "sed" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "-" ],
|
||||
[ "identifier", "e" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\"s|^git://github.com/||\"" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "-" ],
|
||||
[ "identifier", "e" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\"s/\\.git$//\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "constant.language", "exit" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "1" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "fi" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "done" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "if" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "[" ],
|
||||
[ "text", " " ],
|
||||
[ "variable.language", "$?" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "-" ],
|
||||
[ "identifier", "eq" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "0" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.rparen", "]" ],
|
||||
[ "text", "; " ],
|
||||
[ "keyword", "then" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "constant.language", "echo" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\"Couldn't find a valid remote\"" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", ">" ],
|
||||
[ "support.function", "&2" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "constant.language", "exit" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "1" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "fi" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "if" ],
|
||||
[ "text", " " ],
|
||||
[ "variable", "repo=" ],
|
||||
[ "text", "`" ],
|
||||
[ "identifier", "get_repo" ],
|
||||
[ "text", " $@`; " ],
|
||||
[ "keyword", "then" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable", "branch=" ],
|
||||
[ "text", "`" ],
|
||||
[ "identifier", "git" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "symbolic" ],
|
||||
[ "keyword.operator", "-" ],
|
||||
[ "identifier", "ref" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "HEAD" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "2" ],
|
||||
[ "keyword.operator", ">" ],
|
||||
[ "keyword.operator", "/" ],
|
||||
[ "identifier", "dev" ],
|
||||
[ "keyword.operator", "/" ],
|
||||
[ "identifier", "null" ],
|
||||
[ "text", "`" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "constant.language", "echo" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\"http://github.com/$repo/pull/new/${branch##refs/heads/}\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "else" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "constant.language", "exit" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "1" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "fi" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
}
|
||||
]
|
||||
-73
@@ -1,73 +0,0 @@
|
||||
[
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "SELECT" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "city" ],
|
||||
[ "text", ", " ],
|
||||
[ "support.function", "COUNT" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "id" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "AS" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "users_count" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "FROM" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "users" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "WHERE" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "group_name" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "'salesman'" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "AND" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "created" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", ">" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "'2011-05-21'" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "GROUP" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "BY" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "1" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "ORDER" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "BY" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "2" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "DESC" ]
|
||||
]
|
||||
}
|
||||
]
|
||||
-931
@@ -1,931 +0,0 @@
|
||||
[
|
||||
{
|
||||
"state": "tag_embed_attribute_list",
|
||||
"data": [
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "svg" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "tag_embed_attribute_list",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "width" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"800\"" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "height" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"600\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "tag_embed_attribute_list",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "xmlns" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"http://www.w3.org/2000/svg\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "onload" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"StartAnimation(evt)\"" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "title" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", "Test Tube Progress Bar" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "title" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "desc" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", "Created for the Web Directions SVG competition" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "desc" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "js-regex_allowed",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "script" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "type" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"text/ecmascript\"" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "keyword.operator", "<" ],
|
||||
[ "keyword.operator", "!" ],
|
||||
[ "paren.lparen", "[" ],
|
||||
[ "identifier", "CDATA" ],
|
||||
[ "paren.lparen", "[" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "js-regex_allowed",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "storage.type", "var" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "timevalue" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "0" ],
|
||||
[ "punctuation.operator", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "js-regex_allowed",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "storage.type", "var" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "timer_increment" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "1" ],
|
||||
[ "punctuation.operator", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "js-regex_allowed",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "storage.type", "var" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "max_time" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "100" ],
|
||||
[ "punctuation.operator", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "js-regex_allowed",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "storage.type", "var" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "hickory" ],
|
||||
[ "punctuation.operator", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "js-regex_allowed",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "storage.type", "var" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "dickory" ],
|
||||
[ "punctuation.operator", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "js-regex_allowed",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "storage.type", "var" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "dock" ],
|
||||
[ "punctuation.operator", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "js-regex_allowed",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "storage.type", "var" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "i" ],
|
||||
[ "punctuation.operator", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "js-start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "js-regex_allowed",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "storage.type", "function" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.name.function", "StartAnimation" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "variable.parameter", "evt" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "js-regex_allowed",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "hickory" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "evt" ],
|
||||
[ "punctuation.operator", "." ],
|
||||
[ "identifier", "target" ],
|
||||
[ "punctuation.operator", "." ],
|
||||
[ "identifier", "ownerDocument" ],
|
||||
[ "punctuation.operator", "." ],
|
||||
[ "support.function.dom", "getElementById" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "string", "\"hickory\"" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "punctuation.operator", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "js-regex_allowed",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "dickory" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "evt" ],
|
||||
[ "punctuation.operator", "." ],
|
||||
[ "identifier", "target" ],
|
||||
[ "punctuation.operator", "." ],
|
||||
[ "identifier", "ownerDocument" ],
|
||||
[ "punctuation.operator", "." ],
|
||||
[ "support.function.dom", "getElementById" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "string", "\"dickory\"" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "punctuation.operator", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "js-regex_allowed",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "dock" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "evt" ],
|
||||
[ "punctuation.operator", "." ],
|
||||
[ "identifier", "target" ],
|
||||
[ "punctuation.operator", "." ],
|
||||
[ "identifier", "ownerDocument" ],
|
||||
[ "punctuation.operator", "." ],
|
||||
[ "support.function.dom", "getElementById" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "string", "\"dock\"" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "punctuation.operator", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "js-start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "js-regex_allowed",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "ShowAndGrowElement" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "punctuation.operator", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "js-start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "js-regex_allowed",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "storage.type", "function" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.name.function", "ShowAndGrowElement" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "js-regex_allowed",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "timevalue" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "timevalue" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "+" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "timer_increment" ],
|
||||
[ "punctuation.operator", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "js-start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "if" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "timevalue" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", ">" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "max_time" ],
|
||||
[ "paren.rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "js-regex_allowed",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "return" ],
|
||||
[ "punctuation.operator", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "js-start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "comment", "// Scale the text string gradually until it is 20 times larger" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "js-regex_allowed",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "scalefactor" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "timevalue" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "*" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "650" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "/" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "max_time" ],
|
||||
[ "punctuation.operator", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "js-start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "js-regex_allowed",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "if" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "timevalue" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "<" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "30" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "js-regex_allowed",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "hickory" ],
|
||||
[ "punctuation.operator", "." ],
|
||||
[ "support.function.dom", "setAttribute" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "string", "\"display\"" ],
|
||||
[ "punctuation.operator", "," ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\"\"" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "punctuation.operator", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "js-regex_allowed",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "hickory" ],
|
||||
[ "punctuation.operator", "." ],
|
||||
[ "support.function.dom", "setAttribute" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "string", "\"transform\"" ],
|
||||
[ "punctuation.operator", "," ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\"translate(\"" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "+" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "constant.numeric", "600" ],
|
||||
[ "keyword.operator", "+" ],
|
||||
[ "identifier", "scalefactor" ],
|
||||
[ "keyword.operator", "*" ],
|
||||
[ "constant.numeric", "3" ],
|
||||
[ "keyword.operator", "*" ],
|
||||
[ "constant.numeric", "-1" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "+" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\", -144 )\"" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "punctuation.operator", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "js-start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "js-start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "js-regex_allowed",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "if" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "timevalue" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", ">" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "30" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "&" ],
|
||||
[ "keyword.operator", "&" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "timevalue" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "<" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "66" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "js-regex_allowed",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "dickory" ],
|
||||
[ "punctuation.operator", "." ],
|
||||
[ "support.function.dom", "setAttribute" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "string", "\"display\"" ],
|
||||
[ "punctuation.operator", "," ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\"\"" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "punctuation.operator", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "js-regex_allowed",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "dickory" ],
|
||||
[ "punctuation.operator", "." ],
|
||||
[ "support.function.dom", "setAttribute" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "string", "\"transform\"" ],
|
||||
[ "punctuation.operator", "," ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\"translate(\"" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "+" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "constant.numeric", "-795" ],
|
||||
[ "keyword.operator", "+" ],
|
||||
[ "identifier", "scalefactor" ],
|
||||
[ "keyword.operator", "*" ],
|
||||
[ "constant.numeric", "2" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "+" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\", 0 )\"" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "punctuation.operator", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "js-start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "js-regex_allowed",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "if" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "identifier", "timevalue" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", ">" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "66" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "js-regex_allowed",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "dock" ],
|
||||
[ "punctuation.operator", "." ],
|
||||
[ "support.function.dom", "setAttribute" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "string", "\"display\"" ],
|
||||
[ "punctuation.operator", "," ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\"\"" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "punctuation.operator", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "js-regex_allowed",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "dock" ],
|
||||
[ "punctuation.operator", "." ],
|
||||
[ "support.function.dom", "setAttribute" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "string", "\"transform\"" ],
|
||||
[ "punctuation.operator", "," ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\"translate(\"" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "+" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "constant.numeric", "1450" ],
|
||||
[ "keyword.operator", "+" ],
|
||||
[ "identifier", "scalefactor" ],
|
||||
[ "keyword.operator", "*" ],
|
||||
[ "constant.numeric", "2" ],
|
||||
[ "keyword.operator", "*" ],
|
||||
[ "constant.numeric", "-1" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "+" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\", 144 )\"" ],
|
||||
[ "paren.rparen", ")" ],
|
||||
[ "punctuation.operator", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "js-start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "js-start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "js-start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "comment", "// Call ShowAndGrowElement again <timer_increment> milliseconds later." ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "js-start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "setTimeout" ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "string", "\"ShowAndGrowElement()\"" ],
|
||||
[ "punctuation.operator", "," ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "timer_increment" ],
|
||||
[ "paren.rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "js-start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "paren.rparen", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "js-start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "variable.language", "window" ],
|
||||
[ "punctuation.operator", "." ],
|
||||
[ "identifier", "ShowAndGrowElement" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "ShowAndGrowElement" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "paren.rparen", "]" ],
|
||||
[ "paren.rparen", "]" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "script" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "tag_embed_attribute_list",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "rect" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "tag_embed_attribute_list",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "fill" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"#2e3436\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "tag_embed_attribute_list",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "fill-rule" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"nonzero\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "tag_embed_attribute_list",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "stroke-width" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"3\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "tag_embed_attribute_list",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "y" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"0\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "tag_embed_attribute_list",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "x" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"0\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "tag_embed_attribute_list",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "height" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"600\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "tag_embed_attribute_list",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "width" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"800\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "id" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"rect3590\"" ],
|
||||
[ "meta.tag", "/>" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "tag_embed_attribute_list",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "text" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "tag_embed_attribute_list",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "style" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"font-size:144px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans Bold\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "tag_embed_attribute_list",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "x" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"50\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "tag_embed_attribute_list",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "y" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"350\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "tag_embed_attribute_list",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "id" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"hickory\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "display" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"none\"" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " Hickory," ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "text" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "tag_embed_attribute_list",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "text" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "tag_embed_attribute_list",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "style" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"font-size:144px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans Bold\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "tag_embed_attribute_list",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "x" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"50\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "tag_embed_attribute_list",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "y" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"350\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "tag_embed_attribute_list",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "id" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"dickory\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "display" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"none\"" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " dickory," ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "text" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "tag_embed_attribute_list",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "text" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "tag_embed_attribute_list",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "style" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"font-size:144px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans Bold\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "tag_embed_attribute_list",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "x" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"50\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "tag_embed_attribute_list",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "y" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"350\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "tag_embed_attribute_list",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "id" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"dock\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "display" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"none\"" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " dock!" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "text" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "svg" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
}
|
||||
]
|
||||
-536
@@ -1,536 +0,0 @@
|
||||
[
|
||||
{
|
||||
"state": "commandItem",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "commandItem",
|
||||
"data": [
|
||||
[ "keyword", "proc" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "dijkstra" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ],
|
||||
[ "keyword", "graph" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "origin" ],
|
||||
[ "paren.rparen", "}" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "comment", "# Initialize" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "commandItem",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "dict" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "for" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ],
|
||||
[ "keyword", "vertex" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "distmap" ],
|
||||
[ "paren.rparen", "}" ],
|
||||
[ "text", " " ],
|
||||
[ "variable.instancce", "$" ],
|
||||
[ "variable.instancce", "graph" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t" ],
|
||||
[ "keyword", "dict" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "set" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "dist" ],
|
||||
[ "text", " " ],
|
||||
[ "variable.instancce", "$" ],
|
||||
[ "variable.instancce", "vertex" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "Inf" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "commandItem",
|
||||
"data": [
|
||||
[ "text", "\t" ],
|
||||
[ "keyword", "dict" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "set" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "path" ],
|
||||
[ "text", " " ],
|
||||
[ "variable.instancce", "$" ],
|
||||
[ "variable.instancce", "vertex" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ],
|
||||
[ "text", "}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "commandItem",
|
||||
"data": [
|
||||
[ "text", " }" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "dict" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "set" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "dist" ],
|
||||
[ "text", " " ],
|
||||
[ "variable.instancce", "$" ],
|
||||
[ "variable.instancce", "origin" ],
|
||||
[ "text", " 0" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "dict" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "set" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "path" ],
|
||||
[ "text", " " ],
|
||||
[ "variable.instancce", "$" ],
|
||||
[ "variable.instancce", "origin" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "[" ],
|
||||
[ "keyword", "list" ],
|
||||
[ "text", " " ],
|
||||
[ "variable.instancce", "$" ],
|
||||
[ "variable.instancce", "origin" ],
|
||||
[ "paren.rparen", "]" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "commandItem",
|
||||
"data": [
|
||||
[ "text", " " ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "commandItem",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "while" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ],
|
||||
[ "text", "[" ],
|
||||
[ "keyword", "dict" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "size" ],
|
||||
[ "text", " " ],
|
||||
[ "variable.instancce", "$" ],
|
||||
[ "variable.instancce", "graph" ],
|
||||
[ "paren.rparen", "]" ],
|
||||
[ "paren.rparen", "}" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t" ],
|
||||
[ "comment", "# Find unhandled node with least weight" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t" ],
|
||||
[ "keyword", "set" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "d" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "Inf" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "commandItem",
|
||||
"data": [
|
||||
[ "text", "\t" ],
|
||||
[ "keyword", "dict" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "for" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ],
|
||||
[ "keyword", "uu" ],
|
||||
[ "text", " " ],
|
||||
[ "support.function", "-" ],
|
||||
[ "paren.rparen", "}" ],
|
||||
[ "text", " " ],
|
||||
[ "variable.instancce", "$" ],
|
||||
[ "variable.instancce", "graph" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "commandItem",
|
||||
"data": [
|
||||
[ "text", "\t " ],
|
||||
[ "keyword", "if" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ],
|
||||
[ "variable.instancce", "$" ],
|
||||
[ "variable.instancce", "d" ],
|
||||
[ "text", " " ],
|
||||
[ "support.function", ">" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "[" ],
|
||||
[ "keyword", "set" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "dd" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "[" ],
|
||||
[ "keyword", "dict" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "get" ],
|
||||
[ "text", " " ],
|
||||
[ "variable.instancce", "$" ],
|
||||
[ "variable.instancce", "dist" ],
|
||||
[ "text", " " ],
|
||||
[ "variable.instancce", "$" ],
|
||||
[ "variable.instancce", "uu" ],
|
||||
[ "paren.rparen", "]" ],
|
||||
[ "paren.rparen", "]" ],
|
||||
[ "paren.rparen", "}" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t\t" ],
|
||||
[ "keyword", "set" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "u" ],
|
||||
[ "text", " " ],
|
||||
[ "variable.instancce", "$" ],
|
||||
[ "variable.instancce", "uu" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t\t" ],
|
||||
[ "keyword", "set" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "d" ],
|
||||
[ "text", " " ],
|
||||
[ "variable.instancce", "$" ],
|
||||
[ "variable.instancce", "dd" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "commandItem",
|
||||
"data": [
|
||||
[ "text", "\t }" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "commandItem",
|
||||
"data": [
|
||||
[ "text", "\t}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "commandItem",
|
||||
"data": [
|
||||
[ "text", " " ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t" ],
|
||||
[ "comment", "# No such node; graph must be disconnected" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t" ],
|
||||
[ "keyword", "if" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ],
|
||||
[ "variable.instancce", "$" ],
|
||||
[ "variable.instancce", "d" ],
|
||||
[ "text", " " ],
|
||||
[ "support.function", "==" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "Inf" ],
|
||||
[ "paren.rparen", "}" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "break" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "commandItem",
|
||||
"data": [
|
||||
[ "text", " " ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "commentfollow",
|
||||
"data": [
|
||||
[ "text", "\t" ],
|
||||
[ "comment", "# Update the weights for nodes\\" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "\t lead to by the node we've picked" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "commandItem",
|
||||
"data": [
|
||||
[ "text", "\t" ],
|
||||
[ "keyword", "dict" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "for" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ],
|
||||
[ "keyword", "v" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "dd" ],
|
||||
[ "paren.rparen", "}" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "[" ],
|
||||
[ "keyword", "dict" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "get" ],
|
||||
[ "text", " " ],
|
||||
[ "variable.instancce", "$" ],
|
||||
[ "variable.instancce", "graph" ],
|
||||
[ "text", " " ],
|
||||
[ "variable.instancce", "$" ],
|
||||
[ "variable.instancce", "u" ],
|
||||
[ "paren.rparen", "]" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "commandItem",
|
||||
"data": [
|
||||
[ "text", "\t " ],
|
||||
[ "keyword", "if" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ],
|
||||
[ "text", "[" ],
|
||||
[ "keyword", "dict" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "exists" ],
|
||||
[ "text", " " ],
|
||||
[ "variable.instancce", "$" ],
|
||||
[ "variable.instancce", "graph" ],
|
||||
[ "text", " " ],
|
||||
[ "variable.instancce", "$" ],
|
||||
[ "variable.instancce", "v" ],
|
||||
[ "paren.rparen", "]" ],
|
||||
[ "paren.rparen", "}" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t\t" ],
|
||||
[ "keyword", "set" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "alt" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "[" ],
|
||||
[ "keyword", "expr" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ],
|
||||
[ "variable.instancce", "$" ],
|
||||
[ "variable.instancce", "d" ],
|
||||
[ "text", " " ],
|
||||
[ "support.function", "+" ],
|
||||
[ "text", " " ],
|
||||
[ "variable.instancce", "$" ],
|
||||
[ "variable.instancce", "dd" ],
|
||||
[ "paren.rparen", "}" ],
|
||||
[ "paren.rparen", "]" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "commandItem",
|
||||
"data": [
|
||||
[ "text", "\t\t" ],
|
||||
[ "keyword", "if" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ],
|
||||
[ "variable.instancce", "$" ],
|
||||
[ "variable.instancce", "alt" ],
|
||||
[ "text", " " ],
|
||||
[ "support.function", "<" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "[" ],
|
||||
[ "keyword", "dict" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "get" ],
|
||||
[ "text", " " ],
|
||||
[ "variable.instancce", "$" ],
|
||||
[ "variable.instancce", "dist" ],
|
||||
[ "text", " " ],
|
||||
[ "variable.instancce", "$" ],
|
||||
[ "variable.instancce", "v" ],
|
||||
[ "paren.rparen", "]" ],
|
||||
[ "paren.rparen", "}" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "{" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t\t " ],
|
||||
[ "keyword", "dict" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "set" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "dist" ],
|
||||
[ "text", " " ],
|
||||
[ "variable.instancce", "$" ],
|
||||
[ "variable.instancce", "v" ],
|
||||
[ "text", " " ],
|
||||
[ "variable.instancce", "$" ],
|
||||
[ "variable.instancce", "alt" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t\t " ],
|
||||
[ "keyword", "dict" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "set" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "path" ],
|
||||
[ "text", " " ],
|
||||
[ "variable.instancce", "$" ],
|
||||
[ "variable.instancce", "v" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "[" ],
|
||||
[ "keyword", "list" ],
|
||||
[ "text", " " ],
|
||||
[ "support.function", "{*}" ],
|
||||
[ "paren.lparen", "[" ],
|
||||
[ "keyword", "dict" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "get" ],
|
||||
[ "text", " " ],
|
||||
[ "variable.instancce", "$" ],
|
||||
[ "variable.instancce", "path" ],
|
||||
[ "text", " " ],
|
||||
[ "variable.instancce", "$" ],
|
||||
[ "variable.instancce", "u" ],
|
||||
[ "paren.rparen", "]" ],
|
||||
[ "text", " " ],
|
||||
[ "variable.instancce", "$" ],
|
||||
[ "variable.instancce", "v" ],
|
||||
[ "paren.rparen", "]" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "commandItem",
|
||||
"data": [
|
||||
[ "text", "\t\t}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "commandItem",
|
||||
"data": [
|
||||
[ "text", "\t }" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "commandItem",
|
||||
"data": [
|
||||
[ "text", "\t}" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "commandItem",
|
||||
"data": [
|
||||
[ "text", " " ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t" ],
|
||||
[ "comment", "# Remove chosen node from graph still to be handled" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "\t" ],
|
||||
[ "keyword", "dict" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "unset" ],
|
||||
[ "text", " " ],
|
||||
[ "identifier", "graph" ],
|
||||
[ "text", " " ],
|
||||
[ "variable.instancce", "$" ],
|
||||
[ "variable.instancce", "u" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "commandItem",
|
||||
"data": [
|
||||
[ "text", " }" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "keyword", "return" ],
|
||||
[ "text", " " ],
|
||||
[ "paren.lparen", "[" ],
|
||||
[ "keyword", "list" ],
|
||||
[ "text", " " ],
|
||||
[ "variable.instancce", "$" ],
|
||||
[ "variable.instancce", "dist" ],
|
||||
[ "text", " " ],
|
||||
[ "variable.instancce", "$" ],
|
||||
[ "variable.instancce", "path" ],
|
||||
[ "paren.rparen", "]" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "commandItem",
|
||||
"data": [
|
||||
[ "text", "}" ]
|
||||
]
|
||||
}
|
||||
]
|
||||
-58
@@ -1,58 +0,0 @@
|
||||
[
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet." ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat." ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi." ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat." ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis." ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, At accusam aliquyam diam diam dolore dolores duo eirmod eos erat, et nonumy sed tempor et et invidunt justo labore Stet clita ea et gubergren, kasd magna no rebum. sanctus sea sed takimata ut vero voluptua. est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur" ]
|
||||
]
|
||||
}
|
||||
]
|
||||
-195
@@ -1,195 +0,0 @@
|
||||
[
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "markup.heading.1", "h1" ],
|
||||
[ "keyword", ". " ],
|
||||
[ "text", "Textile document" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "markup.heading.2", "h2" ],
|
||||
[ "keyword", ". " ],
|
||||
[ "text", "Heading Two" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "markup.heading.3", "h3" ],
|
||||
[ "keyword", ". " ],
|
||||
[ "text", "A two-line" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " header" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "markup.heading.2", "h2" ],
|
||||
[ "keyword", ". " ],
|
||||
[ "text", "Another two-line" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "header" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "Paragraph:" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "one, two," ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "thee lines!" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "markup.heading", "p" ],
|
||||
[ "keyword", "(" ],
|
||||
[ "string", "classone" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "two" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "three" ],
|
||||
[ "keyword", ")" ],
|
||||
[ "keyword", ". " ],
|
||||
[ "text", "This is a paragraph with classes" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "markup.heading", "p" ],
|
||||
[ "keyword", "(" ],
|
||||
[ "keyword", "#" ],
|
||||
[ "string", "id" ],
|
||||
[ "keyword", ")" ],
|
||||
[ "keyword", ". " ],
|
||||
[ "text", "(one with an id)" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "markup.heading", "p" ],
|
||||
[ "keyword", "(" ],
|
||||
[ "string", "one" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "two" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "three" ],
|
||||
[ "keyword", "#" ],
|
||||
[ "string", "my_id" ],
|
||||
[ "keyword", ")" ],
|
||||
[ "keyword", ". " ],
|
||||
[ "text", "..classes + id" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "*" ],
|
||||
[ "text", " Unordered list" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "**" ],
|
||||
[ "text", " sublist" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "*" ],
|
||||
[ "text", " back again!" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "**" ],
|
||||
[ "text", " sublist again.." ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "#" ],
|
||||
[ "text", " ordered" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "bg. Blockquote!" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " This is a two-list blockquote..!" ]
|
||||
]
|
||||
}
|
||||
]
|
||||
-705
@@ -1,705 +0,0 @@
|
||||
[
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "xml-pe", "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "tag_embed_attribute_list",
|
||||
"data": [
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "query" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "xmlns:yahoo" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"http://www.yahooapis.com/v1/base.rng\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "yahoo:count" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"7\"" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "yahoo:created" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"2011-10-11T08:40:23Z\"" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "yahoo:lang" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"en-US\"" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "diagnostics" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "publiclyCallable" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", "true" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "publiclyCallable" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "url" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "execution-start-time" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"0\"" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "execution-stop-time" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"25\"" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "execution-time" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"25\"" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", "<![CDATA[http://where.yahooapis.com/v1/continents;start=0;count=10]]>" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "url" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "user-time" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", "26" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "user-time" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "service-time" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", "25" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "service-time" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "build-version" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", "21978" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "build-version" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "diagnostics" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", " " ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "results" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "tag_embed_attribute_list",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "place" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "xmlns" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"http://where.yahooapis.com/v1/schema.rng\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "xml:lang" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"en-US\"" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "yahoo:uri" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"http://where.yahooapis.com/v1/place/24865670\"" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "woeid" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", "24865670" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "woeid" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "placeTypeName" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "code" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"29\"" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", "Continent" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "placeTypeName" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "name" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", "Africa" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "name" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "place" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "tag_embed_attribute_list",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "place" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "xmlns" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"http://where.yahooapis.com/v1/schema.rng\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "xml:lang" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"en-US\"" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "yahoo:uri" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"http://where.yahooapis.com/v1/place/24865675\"" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "woeid" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", "24865675" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "woeid" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "placeTypeName" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "code" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"29\"" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", "Continent" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "placeTypeName" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "name" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", "Europe" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "name" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "place" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "tag_embed_attribute_list",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "place" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "xmlns" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"http://where.yahooapis.com/v1/schema.rng\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "xml:lang" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"en-US\"" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "yahoo:uri" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"http://where.yahooapis.com/v1/place/24865673\"" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "woeid" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", "24865673" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "woeid" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "placeTypeName" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "code" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"29\"" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", "Continent" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "placeTypeName" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "name" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", "South America" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "name" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "place" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "tag_embed_attribute_list",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "place" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "xmlns" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"http://where.yahooapis.com/v1/schema.rng\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "xml:lang" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"en-US\"" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "yahoo:uri" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"http://where.yahooapis.com/v1/place/28289421\"" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "woeid" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", "28289421" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "woeid" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "placeTypeName" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "code" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"29\"" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", "Continent" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "placeTypeName" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "name" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", "Antarctic" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "name" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "place" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "tag_embed_attribute_list",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "place" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "xmlns" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"http://where.yahooapis.com/v1/schema.rng\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "xml:lang" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"en-US\"" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "yahoo:uri" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"http://where.yahooapis.com/v1/place/24865671\"" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "woeid" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", "24865671" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "woeid" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "placeTypeName" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "code" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"29\"" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", "Continent" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "placeTypeName" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "name" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", "Asia" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "name" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "place" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "tag_embed_attribute_list",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "place" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "xmlns" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"http://where.yahooapis.com/v1/schema.rng\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "xml:lang" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"en-US\"" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "yahoo:uri" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"http://where.yahooapis.com/v1/place/24865672\"" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "woeid" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", "24865672" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "woeid" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "placeTypeName" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "code" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"29\"" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", "Continent" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "placeTypeName" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "name" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", "North America" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "name" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "place" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "tag_embed_attribute_list",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "place" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "xmlns" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"http://where.yahooapis.com/v1/schema.rng\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "xml:lang" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"en-US\"" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "yahoo:uri" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"http://where.yahooapis.com/v1/place/55949070\"" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "woeid" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", "55949070" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "woeid" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "placeTypeName" ],
|
||||
[ "text", " " ],
|
||||
[ "entity.other.attribute-name", "code" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "string", "\"29\"" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", "Continent" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "placeTypeName" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "<" ],
|
||||
[ "meta.tag.tag-name", "name" ],
|
||||
[ "meta.tag", ">" ],
|
||||
[ "text", "Australia" ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "name" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "place" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "results" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "meta.tag", "</" ],
|
||||
[ "meta.tag.tag-name", "query" ],
|
||||
[ "meta.tag", ">" ]
|
||||
]
|
||||
}
|
||||
]
|
||||
-64
@@ -1,64 +0,0 @@
|
||||
[
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "xquery" ],
|
||||
[ "text", " " ],
|
||||
[ "keyword", "version" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\"1.0\"" ],
|
||||
[ "text", ";" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "let" ],
|
||||
[ "text", " " ],
|
||||
[ "variable", "$message" ],
|
||||
[ "text", " :" ],
|
||||
[ "keyword.operator", "=" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "\"Hello World!\"" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "keyword", "return" ],
|
||||
[ "text", " <" ],
|
||||
[ "meta.tag", "results" ],
|
||||
[ "text", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " <" ],
|
||||
[ "meta.tag", "message" ],
|
||||
[ "text", ">" ],
|
||||
[ "lparen", "{" ],
|
||||
[ "variable", "$message" ],
|
||||
[ "rparen", "}" ],
|
||||
[ "text", "</" ],
|
||||
[ "meta.tag", "message" ],
|
||||
[ "text", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "</" ],
|
||||
[ "meta.tag", "results" ],
|
||||
[ "text", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
}
|
||||
]
|
||||
-260
@@ -1,260 +0,0 @@
|
||||
[
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "# This sample document was taken from wikipedia:" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "# http://en.wikipedia.org/wiki/YAML#Sample_document" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "comment", "---" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "identifier", "receipt:" ],
|
||||
[ "text", " Oz-Ware Purchase Invoice" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "identifier", "date:" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "2007" ],
|
||||
[ "constant.numeric", "-08" ],
|
||||
[ "constant.numeric", "-06" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "identifier", "customer:" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "given:" ],
|
||||
[ "text", " Dorothy" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "family:" ],
|
||||
[ "text", " Gale" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "identifier", "items:" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " - " ],
|
||||
[ "identifier", "part_no:" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "'A4786'" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "descrip:" ],
|
||||
[ "text", " Water Bucket " ],
|
||||
[ "paren.lparen", "(" ],
|
||||
[ "text", "Filled" ],
|
||||
[ "paren.rparen", ")" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "price:" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "1.47" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "quantity:" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "4" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " - " ],
|
||||
[ "identifier", "part_no:" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "'E1628'" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "descrip:" ],
|
||||
[ "text", " High Heeled " ],
|
||||
[ "string", "\"Ruby\"" ],
|
||||
[ "text", " Slippers" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "size:" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "8" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "price:" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "100.27" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "quantity:" ],
|
||||
[ "text", " " ],
|
||||
[ "constant.numeric", "1" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "bill-" ],
|
||||
[ "identifier", "to:" ],
|
||||
[ "text", " " ],
|
||||
[ "variable", "&id001" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "qqstring",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "street:" ],
|
||||
[ "text", " " ],
|
||||
[ "string", "|" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "qqstring",
|
||||
"data": [
|
||||
[ "string", " 123 Tornado Alley" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "qqstring",
|
||||
"data": [
|
||||
[ "string", " Suite 16" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "city:" ],
|
||||
[ "text", " East Centerville" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", " " ],
|
||||
[ "identifier", "state:" ],
|
||||
[ "text", " KS" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": [
|
||||
[ "text", "ship-" ],
|
||||
[ "identifier", "to:" ],
|
||||
[ "text", " " ],
|
||||
[ "variable", "*id001" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "start",
|
||||
"data": []
|
||||
},
|
||||
{
|
||||
"state": "qqstring",
|
||||
"data": [
|
||||
[ "identifier", "specialDelivery:" ],
|
||||
[ "text", " " ],
|
||||
[ "string", ">" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "qqstring",
|
||||
"data": [
|
||||
[ "string", " Follow the Yellow Brick" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "qqstring",
|
||||
"data": [
|
||||
[ "string", " Road to the Emerald City." ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "qqstring",
|
||||
"data": [
|
||||
[ "string", " Pay no attention to the" ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "qqstring",
|
||||
"data": [
|
||||
[ "string", " man behind the curtain." ]
|
||||
]
|
||||
},
|
||||
{
|
||||
"state": "qqstring",
|
||||
"data": []
|
||||
}
|
||||
]
|
||||
@@ -1,68 +0,0 @@
|
||||
/*
|
||||
* eXide - web-based XQuery IDE
|
||||
*
|
||||
* Copyright (C) 2011 Wolfgang Meier
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var oop = require("../../lib/oop");
|
||||
var Behaviour = require('../behaviour').Behaviour;
|
||||
var CstyleBehaviour = require('./cstyle').CstyleBehaviour;
|
||||
|
||||
var XQueryBehaviour = function (parent) {
|
||||
|
||||
this.inherit(CstyleBehaviour, ["braces", "parens", "string_dquotes"]); // Get string behaviour
|
||||
this.parent = parent;
|
||||
|
||||
// this.add("brackets", "insertion", function (state, action, editor, session, text) {
|
||||
// if (text == "\n") {
|
||||
// var cursor = editor.getCursorPosition();
|
||||
// var line = session.doc.getLine(cursor.row);
|
||||
// var rightChars = line.substring(cursor.column, cursor.column + 2);
|
||||
// if (rightChars == '</') {
|
||||
// var indent = this.$getIndent(session.doc.getLine(cursor.row)) + session.getTabString();
|
||||
// var next_indent = this.$getIndent(session.doc.getLine(cursor.row));
|
||||
//
|
||||
// return {
|
||||
// text: '\n' + indent + '\n' + next_indent,
|
||||
// selection: [1, indent.length, 1, indent.length]
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return false;
|
||||
// });
|
||||
|
||||
// Check for open tag if user enters / and auto-close it.
|
||||
// this.add("slash", "insertion", function (state, action, editor, session, text) {
|
||||
// if (text == "/") {
|
||||
// var cursor = editor.getCursorPosition();
|
||||
// var line = session.doc.getLine(cursor.row);
|
||||
// if (cursor.column > 0 && line.charAt(cursor.column - 1) == "<") {
|
||||
// line = line.substring(0, cursor.column) + "/" + line.substring(cursor.column);
|
||||
// var lines = session.doc.getAllLines();
|
||||
// lines[cursor.row] = line;
|
||||
// // call mode helper to close the tag if possible
|
||||
// parent.exec("closeTag", lines.join(session.doc.getNewLineCharacter()), cursor.row);
|
||||
// }
|
||||
// }
|
||||
// return false;
|
||||
// });
|
||||
}
|
||||
oop.inherits(XQueryBehaviour, Behaviour);
|
||||
|
||||
exports.XQueryBehaviour = XQueryBehaviour;
|
||||
});
|
||||
-187
@@ -1,187 +0,0 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Distributed under the BSD license:
|
||||
*
|
||||
* Copyright (c) 2010, Ajax.org B.V.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of Ajax.org B.V. nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var oop = require("../lib/oop");
|
||||
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
|
||||
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
||||
|
||||
// used by objective-c
|
||||
var cFunctions = exports.cFunctions = "\\s*\\bhypot(?:f|l)?|s(?:scanf|ystem|nprintf|ca(?:nf|lb(?:n(?:f|l)?|ln(?:f|l)?))|i(?:n(?:h(?:f|l)?|f|l)?|gn(?:al|bit))|tr(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(?:jmp|vbuf|locale|buf)|qrt(?:f|l)?|w(?:scanf|printf)|rand)|n(?:e(?:arbyint(?:f|l)?|xt(?:toward(?:f|l)?|after(?:f|l)?))|an(?:f|l)?)|c(?:s(?:in(?:h(?:f|l)?|f|l)?|qrt(?:f|l)?)|cos(?:h(?:f)?|f|l)?|imag(?:f|l)?|t(?:ime|an(?:h(?:f|l)?|f|l)?)|o(?:s(?:h(?:f|l)?|f|l)?|nj(?:f|l)?|pysign(?:f|l)?)|p(?:ow(?:f|l)?|roj(?:f|l)?)|e(?:il(?:f|l)?|xp(?:f|l)?)|l(?:o(?:ck|g(?:f|l)?)|earerr)|a(?:sin(?:h(?:f|l)?|f|l)?|cos(?:h(?:f|l)?|f|l)?|tan(?:h(?:f|l)?|f|l)?|lloc|rg(?:f|l)?|bs(?:f|l)?)|real(?:f|l)?|brt(?:f|l)?)|t(?:ime|o(?:upper|lower)|an(?:h(?:f|l)?|f|l)?|runc(?:f|l)?|gamma(?:f|l)?|mp(?:nam|file))|i(?:s(?:space|n(?:ormal|an)|cntrl|inf|digit|u(?:nordered|pper)|p(?:unct|rint)|finite|w(?:space|c(?:ntrl|type)|digit|upper|p(?:unct|rint)|lower|al(?:num|pha)|graph|xdigit|blank)|l(?:ower|ess(?:equal|greater)?)|al(?:num|pha)|gr(?:eater(?:equal)?|aph)|xdigit|blank)|logb(?:f|l)?|max(?:div|abs))|di(?:v|fftime)|_Exit|unget(?:c|wc)|p(?:ow(?:f|l)?|ut(?:s|c(?:har)?|wc(?:har)?)|error|rintf)|e(?:rf(?:c(?:f|l)?|f|l)?|x(?:it|p(?:2(?:f|l)?|f|l|m1(?:f|l)?)?))|v(?:s(?:scanf|nprintf|canf|printf|w(?:scanf|printf))|printf|f(?:scanf|printf|w(?:scanf|printf))|w(?:scanf|printf)|a_(?:start|copy|end|arg))|qsort|f(?:s(?:canf|e(?:tpos|ek))|close|tell|open|dim(?:f|l)?|p(?:classify|ut(?:s|c|w(?:s|c))|rintf)|e(?:holdexcept|set(?:e(?:nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(?:aiseexcept|ror)|get(?:e(?:nv|xceptflag)|round))|flush|w(?:scanf|ide|printf|rite)|loor(?:f|l)?|abs(?:f|l)?|get(?:s|c|pos|w(?:s|c))|re(?:open|e|ad|xp(?:f|l)?)|m(?:in(?:f|l)?|od(?:f|l)?|a(?:f|l|x(?:f|l)?)?))|l(?:d(?:iv|exp(?:f|l)?)|o(?:ngjmp|cal(?:time|econv)|g(?:1(?:p(?:f|l)?|0(?:f|l)?)|2(?:f|l)?|f|l|b(?:f|l)?)?)|abs|l(?:div|abs|r(?:int(?:f|l)?|ound(?:f|l)?))|r(?:int(?:f|l)?|ound(?:f|l)?)|gamma(?:f|l)?)|w(?:scanf|c(?:s(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?|mbs)|pbrk|ftime|len|r(?:chr|tombs)|xfrm)|to(?:b|mb)|rtomb)|printf|mem(?:set|c(?:hr|py|mp)|move))|a(?:s(?:sert|ctime|in(?:h(?:f|l)?|f|l)?)|cos(?:h(?:f|l)?|f|l)?|t(?:o(?:i|f|l(?:l)?)|exit|an(?:h(?:f|l)?|2(?:f|l)?|f|l)?)|b(?:s|ort))|g(?:et(?:s|c(?:har)?|env|wc(?:har)?)|mtime)|r(?:int(?:f|l)?|ound(?:f|l)?|e(?:name|alloc|wind|m(?:ove|quo(?:f|l)?|ainder(?:f|l)?))|a(?:nd|ise))|b(?:search|towc)|m(?:odf(?:f|l)?|em(?:set|c(?:hr|py|mp)|move)|ktime|alloc|b(?:s(?:init|towcs|rtowcs)|towc|len|r(?:towc|len)))\\b"
|
||||
|
||||
var c_cppHighlightRules = function() {
|
||||
|
||||
var keywordControls = (
|
||||
"break|case|continue|default|do|else|for|goto|if|_Pragma|" +
|
||||
"return|switch|while|catch|operator|try|throw|using"
|
||||
);
|
||||
|
||||
var storageType = (
|
||||
"asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|" +
|
||||
"_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void|" +
|
||||
"class|wchar_t|template"
|
||||
);
|
||||
|
||||
var storageModifiers = (
|
||||
"const|extern|register|restrict|static|volatile|inline|private:|" +
|
||||
"protected:|public:|friend|explicit|virtual|export|mutable|typename"
|
||||
);
|
||||
|
||||
var keywordOperators = (
|
||||
"and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq" +
|
||||
"const_cast|dynamic_cast|reinterpret_cast|static_cast|sizeof|namespace"
|
||||
);
|
||||
|
||||
var builtinConstants = (
|
||||
"NULL|true|false|TRUE|FALSE"
|
||||
);
|
||||
|
||||
var keywordMapper = this.$keywords = this.createKeywordMapper({
|
||||
"keyword.control" : keywordControls,
|
||||
"storage.type" : storageType,
|
||||
"storage.modifier" : storageModifiers,
|
||||
"keyword.operator" : keywordOperators,
|
||||
"variable.language": "this",
|
||||
"constant.language": builtinConstants
|
||||
}, "identifier");
|
||||
|
||||
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\d\\$_\u00a1-\uffff]*\\b";
|
||||
|
||||
// regexp must not have capturing parentheses. Use (?:) instead.
|
||||
// regexps are ordered -> the first match is used
|
||||
|
||||
this.$rules = {
|
||||
"start" : [
|
||||
{
|
||||
token : "comment",
|
||||
regex : "\\/\\/.*$"
|
||||
},
|
||||
DocCommentHighlightRules.getStartRule("doc-start"),
|
||||
{
|
||||
token : "comment", // multi line comment
|
||||
merge : true,
|
||||
regex : "\\/\\*",
|
||||
next : "comment"
|
||||
}, {
|
||||
token : "string", // single line
|
||||
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
|
||||
}, {
|
||||
token : "string", // multi line string start
|
||||
merge : true,
|
||||
regex : '["].*\\\\$',
|
||||
next : "qqstring"
|
||||
}, {
|
||||
token : "string", // single line
|
||||
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
|
||||
}, {
|
||||
token : "string", // multi line string start
|
||||
merge : true,
|
||||
regex : "['].*\\\\$",
|
||||
next : "qstring"
|
||||
}, {
|
||||
token : "constant.numeric", // hex
|
||||
regex : "0[xX][0-9a-fA-F]+\\b"
|
||||
}, {
|
||||
token : "constant.numeric", // float
|
||||
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
|
||||
}, {
|
||||
token : "constant", // <CONSTANT>
|
||||
regex : "<[a-zA-Z0-9.]+>"
|
||||
}, {
|
||||
token : "keyword", // pre-compiler directivs
|
||||
regex : "(?:#include|#import|#pragma|#line|#define|#undef|#ifdef|#else|#elif|#endif|#ifndef)"
|
||||
}, {
|
||||
token : "support.function.C99.c",
|
||||
regex : cFunctions
|
||||
}, {
|
||||
token : keywordMapper,
|
||||
regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
|
||||
}, {
|
||||
token : "keyword.operator",
|
||||
regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|==|=|!=|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|new|delete|typeof|void)"
|
||||
}, {
|
||||
token : "punctuation.operator",
|
||||
regex : "\\?|\\:|\\,|\\;|\\."
|
||||
}, {
|
||||
token : "paren.lparen",
|
||||
regex : "[[({]"
|
||||
}, {
|
||||
token : "paren.rparen",
|
||||
regex : "[\\])}]"
|
||||
}, {
|
||||
token : "text",
|
||||
regex : "\\s+"
|
||||
}
|
||||
],
|
||||
"comment" : [
|
||||
{
|
||||
token : "comment", // closing comment
|
||||
regex : ".*?\\*\\/",
|
||||
next : "start"
|
||||
}, {
|
||||
token : "comment", // comment spanning whole line
|
||||
merge : true,
|
||||
regex : ".+"
|
||||
}
|
||||
],
|
||||
"qqstring" : [
|
||||
{
|
||||
token : "string",
|
||||
regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"',
|
||||
next : "start"
|
||||
}, {
|
||||
token : "string",
|
||||
merge : true,
|
||||
regex : '.+'
|
||||
}
|
||||
],
|
||||
"qstring" : [
|
||||
{
|
||||
token : "string",
|
||||
regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'",
|
||||
next : "start"
|
||||
}, {
|
||||
token : "string",
|
||||
merge : true,
|
||||
regex : '.+'
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
this.embedRules(DocCommentHighlightRules, "doc-",
|
||||
[ DocCommentHighlightRules.getEndRule("start") ]);
|
||||
};
|
||||
|
||||
oop.inherits(c_cppHighlightRules, TextHighlightRules);
|
||||
|
||||
exports.c_cppHighlightRules = c_cppHighlightRules;
|
||||
});
|
||||
@@ -1,115 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2009-2012 Jeremy Ashkenas
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person
|
||||
* obtaining a copy of this software and associated documentation
|
||||
* files (the "Software"), to deal in the Software without
|
||||
* restriction, including without limitation the rights to use,
|
||||
* copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following
|
||||
* conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be
|
||||
* included in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
define(function(require, exports, module) {
|
||||
// Generated by CoffeeScript 1.3.3
|
||||
|
||||
var extend, flatten, _ref;
|
||||
|
||||
exports.starts = function(string, literal, start) {
|
||||
return literal === string.substr(start, literal.length);
|
||||
};
|
||||
|
||||
exports.ends = function(string, literal, back) {
|
||||
var len;
|
||||
len = literal.length;
|
||||
return literal === string.substr(string.length - len - (back || 0), len);
|
||||
};
|
||||
|
||||
exports.compact = function(array) {
|
||||
var item, _i, _len, _results;
|
||||
_results = [];
|
||||
for (_i = 0, _len = array.length; _i < _len; _i++) {
|
||||
item = array[_i];
|
||||
if (item) {
|
||||
_results.push(item);
|
||||
}
|
||||
}
|
||||
return _results;
|
||||
};
|
||||
|
||||
exports.count = function(string, substr) {
|
||||
var num, pos;
|
||||
num = pos = 0;
|
||||
if (!substr.length) {
|
||||
return 1 / 0;
|
||||
}
|
||||
while (pos = 1 + string.indexOf(substr, pos)) {
|
||||
num++;
|
||||
}
|
||||
return num;
|
||||
};
|
||||
|
||||
exports.merge = function(options, overrides) {
|
||||
return extend(extend({}, options), overrides);
|
||||
};
|
||||
|
||||
extend = exports.extend = function(object, properties) {
|
||||
var key, val;
|
||||
for (key in properties) {
|
||||
val = properties[key];
|
||||
object[key] = val;
|
||||
}
|
||||
return object;
|
||||
};
|
||||
|
||||
exports.flatten = flatten = function(array) {
|
||||
var element, flattened, _i, _len;
|
||||
flattened = [];
|
||||
for (_i = 0, _len = array.length; _i < _len; _i++) {
|
||||
element = array[_i];
|
||||
if (element instanceof Array) {
|
||||
flattened = flattened.concat(flatten(element));
|
||||
} else {
|
||||
flattened.push(element);
|
||||
}
|
||||
}
|
||||
return flattened;
|
||||
};
|
||||
|
||||
exports.del = function(obj, key) {
|
||||
var val;
|
||||
val = obj[key];
|
||||
delete obj[key];
|
||||
return val;
|
||||
};
|
||||
|
||||
exports.last = function(array, back) {
|
||||
return array[array.length - (back || 0) - 1];
|
||||
};
|
||||
|
||||
exports.some = (_ref = Array.prototype.some) != null ? _ref : function(fn) {
|
||||
var e, _i, _len;
|
||||
for (_i = 0, _len = this.length; _i < _len; _i++) {
|
||||
e = this[_i];
|
||||
if (fn(e)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
|
||||
});
|
||||
File diff suppressed because one or more lines are too long
@@ -1,376 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2009-2012 Jeremy Ashkenas
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person
|
||||
* obtaining a copy of this software and associated documentation
|
||||
* files (the "Software"), to deal in the Software without
|
||||
* restriction, including without limitation the rights to use,
|
||||
* copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following
|
||||
* conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be
|
||||
* included in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
define(function(require, exports, module) {
|
||||
// Generated by CoffeeScript 1.3.3
|
||||
|
||||
var BALANCED_PAIRS, EXPRESSION_CLOSE, EXPRESSION_END, EXPRESSION_START, IMPLICIT_BLOCK, IMPLICIT_CALL, IMPLICIT_END, IMPLICIT_FUNC, IMPLICIT_UNSPACED_CALL, INVERSES, LINEBREAKS, SINGLE_CLOSERS, SINGLE_LINERS, left, rite, _i, _len, _ref,
|
||||
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
|
||||
__slice = [].slice;
|
||||
|
||||
exports.Rewriter = (function() {
|
||||
|
||||
function Rewriter() {}
|
||||
|
||||
Rewriter.prototype.rewrite = function(tokens) {
|
||||
this.tokens = tokens;
|
||||
this.removeLeadingNewlines();
|
||||
this.removeMidExpressionNewlines();
|
||||
this.closeOpenCalls();
|
||||
this.closeOpenIndexes();
|
||||
this.addImplicitIndentation();
|
||||
this.tagPostfixConditionals();
|
||||
this.addImplicitBraces();
|
||||
this.addImplicitParentheses();
|
||||
return this.tokens;
|
||||
};
|
||||
|
||||
Rewriter.prototype.scanTokens = function(block) {
|
||||
var i, token, tokens;
|
||||
tokens = this.tokens;
|
||||
i = 0;
|
||||
while (token = tokens[i]) {
|
||||
i += block.call(this, token, i, tokens);
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
Rewriter.prototype.detectEnd = function(i, condition, action) {
|
||||
var levels, token, tokens, _ref, _ref1;
|
||||
tokens = this.tokens;
|
||||
levels = 0;
|
||||
while (token = tokens[i]) {
|
||||
if (levels === 0 && condition.call(this, token, i)) {
|
||||
return action.call(this, token, i);
|
||||
}
|
||||
if (!token || levels < 0) {
|
||||
return action.call(this, token, i - 1);
|
||||
}
|
||||
if (_ref = token[0], __indexOf.call(EXPRESSION_START, _ref) >= 0) {
|
||||
levels += 1;
|
||||
} else if (_ref1 = token[0], __indexOf.call(EXPRESSION_END, _ref1) >= 0) {
|
||||
levels -= 1;
|
||||
}
|
||||
i += 1;
|
||||
}
|
||||
return i - 1;
|
||||
};
|
||||
|
||||
Rewriter.prototype.removeLeadingNewlines = function() {
|
||||
var i, tag, _i, _len, _ref;
|
||||
_ref = this.tokens;
|
||||
for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
|
||||
tag = _ref[i][0];
|
||||
if (tag !== 'TERMINATOR') {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i) {
|
||||
return this.tokens.splice(0, i);
|
||||
}
|
||||
};
|
||||
|
||||
Rewriter.prototype.removeMidExpressionNewlines = function() {
|
||||
return this.scanTokens(function(token, i, tokens) {
|
||||
var _ref;
|
||||
if (!(token[0] === 'TERMINATOR' && (_ref = this.tag(i + 1), __indexOf.call(EXPRESSION_CLOSE, _ref) >= 0))) {
|
||||
return 1;
|
||||
}
|
||||
tokens.splice(i, 1);
|
||||
return 0;
|
||||
});
|
||||
};
|
||||
|
||||
Rewriter.prototype.closeOpenCalls = function() {
|
||||
var action, condition;
|
||||
condition = function(token, i) {
|
||||
var _ref;
|
||||
return ((_ref = token[0]) === ')' || _ref === 'CALL_END') || token[0] === 'OUTDENT' && this.tag(i - 1) === ')';
|
||||
};
|
||||
action = function(token, i) {
|
||||
return this.tokens[token[0] === 'OUTDENT' ? i - 1 : i][0] = 'CALL_END';
|
||||
};
|
||||
return this.scanTokens(function(token, i) {
|
||||
if (token[0] === 'CALL_START') {
|
||||
this.detectEnd(i + 1, condition, action);
|
||||
}
|
||||
return 1;
|
||||
});
|
||||
};
|
||||
|
||||
Rewriter.prototype.closeOpenIndexes = function() {
|
||||
var action, condition;
|
||||
condition = function(token, i) {
|
||||
var _ref;
|
||||
return (_ref = token[0]) === ']' || _ref === 'INDEX_END';
|
||||
};
|
||||
action = function(token, i) {
|
||||
return token[0] = 'INDEX_END';
|
||||
};
|
||||
return this.scanTokens(function(token, i) {
|
||||
if (token[0] === 'INDEX_START') {
|
||||
this.detectEnd(i + 1, condition, action);
|
||||
}
|
||||
return 1;
|
||||
});
|
||||
};
|
||||
|
||||
Rewriter.prototype.addImplicitBraces = function() {
|
||||
var action, condition, sameLine, stack, start, startIndent, startIndex, startsLine;
|
||||
stack = [];
|
||||
start = null;
|
||||
startsLine = null;
|
||||
sameLine = true;
|
||||
startIndent = 0;
|
||||
startIndex = 0;
|
||||
condition = function(token, i) {
|
||||
var one, tag, three, two, _ref, _ref1;
|
||||
_ref = this.tokens.slice(i + 1, +(i + 3) + 1 || 9e9), one = _ref[0], two = _ref[1], three = _ref[2];
|
||||
if ('HERECOMMENT' === (one != null ? one[0] : void 0)) {
|
||||
return false;
|
||||
}
|
||||
tag = token[0];
|
||||
if (__indexOf.call(LINEBREAKS, tag) >= 0) {
|
||||
sameLine = false;
|
||||
}
|
||||
return (((tag === 'TERMINATOR' || tag === 'OUTDENT') || (__indexOf.call(IMPLICIT_END, tag) >= 0 && sameLine && !(i - startIndex === 1))) && ((!startsLine && this.tag(i - 1) !== ',') || !((two != null ? two[0] : void 0) === ':' || (one != null ? one[0] : void 0) === '@' && (three != null ? three[0] : void 0) === ':'))) || (tag === ',' && one && ((_ref1 = one[0]) !== 'IDENTIFIER' && _ref1 !== 'NUMBER' && _ref1 !== 'STRING' && _ref1 !== '@' && _ref1 !== 'TERMINATOR' && _ref1 !== 'OUTDENT'));
|
||||
};
|
||||
action = function(token, i) {
|
||||
var tok;
|
||||
tok = this.generate('}', '}', token[2]);
|
||||
return this.tokens.splice(i, 0, tok);
|
||||
};
|
||||
return this.scanTokens(function(token, i, tokens) {
|
||||
var ago, idx, prevTag, tag, tok, value, _ref, _ref1;
|
||||
if (_ref = (tag = token[0]), __indexOf.call(EXPRESSION_START, _ref) >= 0) {
|
||||
stack.push([(tag === 'INDENT' && this.tag(i - 1) === '{' ? '{' : tag), i]);
|
||||
return 1;
|
||||
}
|
||||
if (__indexOf.call(EXPRESSION_END, tag) >= 0) {
|
||||
start = stack.pop();
|
||||
return 1;
|
||||
}
|
||||
if (!(tag === ':' && ((ago = this.tag(i - 2)) === ':' || ((_ref1 = stack[stack.length - 1]) != null ? _ref1[0] : void 0) !== '{'))) {
|
||||
return 1;
|
||||
}
|
||||
sameLine = true;
|
||||
startIndex = i + 1;
|
||||
stack.push(['{']);
|
||||
idx = ago === '@' ? i - 2 : i - 1;
|
||||
while (this.tag(idx - 2) === 'HERECOMMENT') {
|
||||
idx -= 2;
|
||||
}
|
||||
prevTag = this.tag(idx - 1);
|
||||
startsLine = !prevTag || (__indexOf.call(LINEBREAKS, prevTag) >= 0);
|
||||
value = new String('{');
|
||||
value.generated = true;
|
||||
tok = this.generate('{', value, token[2]);
|
||||
tokens.splice(idx, 0, tok);
|
||||
this.detectEnd(i + 2, condition, action);
|
||||
return 2;
|
||||
});
|
||||
};
|
||||
|
||||
Rewriter.prototype.addImplicitParentheses = function() {
|
||||
var action, condition, noCall, seenControl, seenSingle;
|
||||
noCall = seenSingle = seenControl = false;
|
||||
condition = function(token, i) {
|
||||
var post, tag, _ref, _ref1;
|
||||
tag = token[0];
|
||||
if (!seenSingle && token.fromThen) {
|
||||
return true;
|
||||
}
|
||||
if (tag === 'IF' || tag === 'ELSE' || tag === 'CATCH' || tag === '->' || tag === '=>' || tag === 'CLASS') {
|
||||
seenSingle = true;
|
||||
}
|
||||
if (tag === 'IF' || tag === 'ELSE' || tag === 'SWITCH' || tag === 'TRY' || tag === '=') {
|
||||
seenControl = true;
|
||||
}
|
||||
if ((tag === '.' || tag === '?.' || tag === '::') && this.tag(i - 1) === 'OUTDENT') {
|
||||
return true;
|
||||
}
|
||||
return !token.generated && this.tag(i - 1) !== ',' && (__indexOf.call(IMPLICIT_END, tag) >= 0 || (tag === 'INDENT' && !seenControl)) && (tag !== 'INDENT' || (((_ref = this.tag(i - 2)) !== 'CLASS' && _ref !== 'EXTENDS') && (_ref1 = this.tag(i - 1), __indexOf.call(IMPLICIT_BLOCK, _ref1) < 0) && !((post = this.tokens[i + 1]) && post.generated && post[0] === '{')));
|
||||
};
|
||||
action = function(token, i) {
|
||||
return this.tokens.splice(i, 0, this.generate('CALL_END', ')', token[2]));
|
||||
};
|
||||
return this.scanTokens(function(token, i, tokens) {
|
||||
var callObject, current, next, prev, tag, _ref, _ref1, _ref2;
|
||||
tag = token[0];
|
||||
if (tag === 'CLASS' || tag === 'IF' || tag === 'FOR' || tag === 'WHILE') {
|
||||
noCall = true;
|
||||
}
|
||||
_ref = tokens.slice(i - 1, +(i + 1) + 1 || 9e9), prev = _ref[0], current = _ref[1], next = _ref[2];
|
||||
callObject = !noCall && tag === 'INDENT' && next && next.generated && next[0] === '{' && prev && (_ref1 = prev[0], __indexOf.call(IMPLICIT_FUNC, _ref1) >= 0);
|
||||
seenSingle = false;
|
||||
seenControl = false;
|
||||
if (__indexOf.call(LINEBREAKS, tag) >= 0) {
|
||||
noCall = false;
|
||||
}
|
||||
if (prev && !prev.spaced && tag === '?') {
|
||||
token.call = true;
|
||||
}
|
||||
if (token.fromThen) {
|
||||
return 1;
|
||||
}
|
||||
if (!(callObject || (prev != null ? prev.spaced : void 0) && (prev.call || (_ref2 = prev[0], __indexOf.call(IMPLICIT_FUNC, _ref2) >= 0)) && (__indexOf.call(IMPLICIT_CALL, tag) >= 0 || !(token.spaced || token.newLine) && __indexOf.call(IMPLICIT_UNSPACED_CALL, tag) >= 0))) {
|
||||
return 1;
|
||||
}
|
||||
tokens.splice(i, 0, this.generate('CALL_START', '(', token[2]));
|
||||
this.detectEnd(i + 1, condition, action);
|
||||
if (prev[0] === '?') {
|
||||
prev[0] = 'FUNC_EXIST';
|
||||
}
|
||||
return 2;
|
||||
});
|
||||
};
|
||||
|
||||
Rewriter.prototype.addImplicitIndentation = function() {
|
||||
var action, condition, indent, outdent, starter;
|
||||
starter = indent = outdent = null;
|
||||
condition = function(token, i) {
|
||||
var _ref;
|
||||
return token[1] !== ';' && (_ref = token[0], __indexOf.call(SINGLE_CLOSERS, _ref) >= 0) && !(token[0] === 'ELSE' && (starter !== 'IF' && starter !== 'THEN'));
|
||||
};
|
||||
action = function(token, i) {
|
||||
return this.tokens.splice((this.tag(i - 1) === ',' ? i - 1 : i), 0, outdent);
|
||||
};
|
||||
return this.scanTokens(function(token, i, tokens) {
|
||||
var tag, _ref, _ref1;
|
||||
tag = token[0];
|
||||
if (tag === 'TERMINATOR' && this.tag(i + 1) === 'THEN') {
|
||||
tokens.splice(i, 1);
|
||||
return 0;
|
||||
}
|
||||
if (tag === 'ELSE' && this.tag(i - 1) !== 'OUTDENT') {
|
||||
tokens.splice.apply(tokens, [i, 0].concat(__slice.call(this.indentation(token))));
|
||||
return 2;
|
||||
}
|
||||
if (tag === 'CATCH' && ((_ref = this.tag(i + 2)) === 'OUTDENT' || _ref === 'TERMINATOR' || _ref === 'FINALLY')) {
|
||||
tokens.splice.apply(tokens, [i + 2, 0].concat(__slice.call(this.indentation(token))));
|
||||
return 4;
|
||||
}
|
||||
if (__indexOf.call(SINGLE_LINERS, tag) >= 0 && this.tag(i + 1) !== 'INDENT' && !(tag === 'ELSE' && this.tag(i + 1) === 'IF')) {
|
||||
starter = tag;
|
||||
_ref1 = this.indentation(token, true), indent = _ref1[0], outdent = _ref1[1];
|
||||
if (starter === 'THEN') {
|
||||
indent.fromThen = true;
|
||||
}
|
||||
tokens.splice(i + 1, 0, indent);
|
||||
this.detectEnd(i + 2, condition, action);
|
||||
if (tag === 'THEN') {
|
||||
tokens.splice(i, 1);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
return 1;
|
||||
});
|
||||
};
|
||||
|
||||
Rewriter.prototype.tagPostfixConditionals = function() {
|
||||
var action, condition, original;
|
||||
original = null;
|
||||
condition = function(token, i) {
|
||||
var _ref;
|
||||
return (_ref = token[0]) === 'TERMINATOR' || _ref === 'INDENT';
|
||||
};
|
||||
action = function(token, i) {
|
||||
if (token[0] !== 'INDENT' || (token.generated && !token.fromThen)) {
|
||||
return original[0] = 'POST_' + original[0];
|
||||
}
|
||||
};
|
||||
return this.scanTokens(function(token, i) {
|
||||
if (token[0] !== 'IF') {
|
||||
return 1;
|
||||
}
|
||||
original = token;
|
||||
this.detectEnd(i + 1, condition, action);
|
||||
return 1;
|
||||
});
|
||||
};
|
||||
|
||||
Rewriter.prototype.indentation = function(token, implicit) {
|
||||
var indent, outdent;
|
||||
if (implicit == null) {
|
||||
implicit = false;
|
||||
}
|
||||
indent = ['INDENT', 2, token[2]];
|
||||
outdent = ['OUTDENT', 2, token[2]];
|
||||
if (implicit) {
|
||||
indent.generated = outdent.generated = true;
|
||||
}
|
||||
return [indent, outdent];
|
||||
};
|
||||
|
||||
Rewriter.prototype.generate = function(tag, value, line) {
|
||||
var tok;
|
||||
tok = [tag, value, line];
|
||||
tok.generated = true;
|
||||
return tok;
|
||||
};
|
||||
|
||||
Rewriter.prototype.tag = function(i) {
|
||||
var _ref;
|
||||
return (_ref = this.tokens[i]) != null ? _ref[0] : void 0;
|
||||
};
|
||||
|
||||
return Rewriter;
|
||||
|
||||
})();
|
||||
|
||||
BALANCED_PAIRS = [['(', ')'], ['[', ']'], ['{', '}'], ['INDENT', 'OUTDENT'], ['CALL_START', 'CALL_END'], ['PARAM_START', 'PARAM_END'], ['INDEX_START', 'INDEX_END']];
|
||||
|
||||
exports.INVERSES = INVERSES = {};
|
||||
|
||||
EXPRESSION_START = [];
|
||||
|
||||
EXPRESSION_END = [];
|
||||
|
||||
for (_i = 0, _len = BALANCED_PAIRS.length; _i < _len; _i++) {
|
||||
_ref = BALANCED_PAIRS[_i], left = _ref[0], rite = _ref[1];
|
||||
EXPRESSION_START.push(INVERSES[rite] = left);
|
||||
EXPRESSION_END.push(INVERSES[left] = rite);
|
||||
}
|
||||
|
||||
EXPRESSION_CLOSE = ['CATCH', 'WHEN', 'ELSE', 'FINALLY'].concat(EXPRESSION_END);
|
||||
|
||||
IMPLICIT_FUNC = ['IDENTIFIER', 'SUPER', ')', 'CALL_END', ']', 'INDEX_END', '@', 'THIS'];
|
||||
|
||||
IMPLICIT_CALL = ['IDENTIFIER', 'NUMBER', 'STRING', 'JS', 'REGEX', 'NEW', 'PARAM_START', 'CLASS', 'IF', 'TRY', 'SWITCH', 'THIS', 'BOOL', 'NULL', 'UNDEFINED', 'UNARY', 'SUPER', '@', '->', '=>', '[', '(', '{', '--', '++'];
|
||||
|
||||
IMPLICIT_UNSPACED_CALL = ['+', '-'];
|
||||
|
||||
IMPLICIT_BLOCK = ['->', '=>', '{', '[', ','];
|
||||
|
||||
IMPLICIT_END = ['POST_IF', 'FOR', 'WHILE', 'UNTIL', 'WHEN', 'BY', 'LOOP', 'TERMINATOR'];
|
||||
|
||||
SINGLE_LINERS = ['ELSE', '->', '=>', 'TRY', 'FINALLY', 'THEN'];
|
||||
|
||||
SINGLE_CLOSERS = ['TERMINATOR', 'CATCH', 'FINALLY', 'ELSE', 'OUTDENT', 'LEADING_WHEN'];
|
||||
|
||||
LINEBREAKS = ['TERMINATOR', 'INDENT', 'OUTDENT'];
|
||||
|
||||
|
||||
});
|
||||
-328
@@ -1,328 +0,0 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Distributed under the BSD license:
|
||||
*
|
||||
* Copyright (c) 2010, Ajax.org B.V.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of Ajax.org B.V. nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var oop = require("../lib/oop");
|
||||
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
||||
|
||||
oop.inherits(CoffeeHighlightRules, TextHighlightRules);
|
||||
|
||||
function CoffeeHighlightRules() {
|
||||
var identifier = "[$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*";
|
||||
var stringfill = {
|
||||
token : "string",
|
||||
merge : true,
|
||||
regex : ".+"
|
||||
};
|
||||
|
||||
var keywords = (
|
||||
"this|throw|then|try|typeof|super|switch|return|break|by|continue|" +
|
||||
"catch|class|in|instanceof|is|isnt|if|else|extends|for|forown|" +
|
||||
"finally|function|while|when|new|no|not|delete|debugger|do|loop|of|off|" +
|
||||
"or|on|unless|until|and|yes"
|
||||
);
|
||||
|
||||
var langConstant = (
|
||||
"true|false|null|undefined|NaN|Infinity"
|
||||
);
|
||||
|
||||
var illegal = (
|
||||
"case|const|default|function|var|void|with|enum|export|implements|" +
|
||||
"interface|let|package|private|protected|public|static|yield|" +
|
||||
"__hasProp|slice|bind|indexOf"
|
||||
);
|
||||
|
||||
var supportClass = (
|
||||
"Array|Boolean|Date|Function|Number|Object|RegExp|ReferenceError|String|" +
|
||||
"Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" +
|
||||
"SyntaxError|TypeError|URIError|" +
|
||||
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
|
||||
"Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray"
|
||||
);
|
||||
|
||||
var supportFunction = (
|
||||
"Math|JSON|isNaN|isFinite|parseInt|parseFloat|encodeURI|" +
|
||||
"encodeURIComponent|decodeURI|decodeURIComponent|String|"
|
||||
);
|
||||
|
||||
var variableLanguage = (
|
||||
"window|arguments|prototype|document"
|
||||
);
|
||||
|
||||
var keywordMapper = this.createKeywordMapper({
|
||||
"keyword": keywords,
|
||||
"constant.language": langConstant,
|
||||
"invalid.illegal": illegal,
|
||||
"language.support.class": supportClass,
|
||||
"language.support.function": supportFunction,
|
||||
"variable.language": variableLanguage
|
||||
}, "identifier");
|
||||
|
||||
var functionRules = {
|
||||
"({args})->": {
|
||||
token: ["paren.lparen", "text", "paren.lparen", "text", "variable.parameter", "text", "paren.rparen", "text", "paren.rparen", "text", "storage.type"],
|
||||
regex: "(\\()(\\s*)(\\{)(\\s*)([$@A-Za-z_\\x7f-\\uffff][$@\\w\\s,\\x7f-\\uffff]*)(\\s*)(\\})(\\s*)(\\))(\\s*)([\\-=]>)"
|
||||
},
|
||||
"({})->": {
|
||||
token: ["paren.lparen", "text", "paren.lparen", "text", "paren.rparen", "text", "paren.rparen", "text", "storage.type"],
|
||||
regex: "(\\()(\\s*)(\\{)(\\s*)(\\})(\\s*)(\\))(\\s*)([\\-=]>)"
|
||||
},
|
||||
"(args)->": {
|
||||
token: ["paren.lparen", "text", "variable.parameter", "text", "paren.rparen", "text", "storage.type"],
|
||||
regex: "(\\()(\\s*)([$@A-Za-z_\\x7f-\\uffff][\\s\\x21-\\uffff]*)(\\s*)(\\))(\\s*)([\\-=]>)"
|
||||
},
|
||||
"()->": {
|
||||
token: ["paren.lparen", "text", "paren.rparen", "text", "storage.type"],
|
||||
regex: "(\\()(\\s*)(\\))(\\s*)([\\-=]>)"
|
||||
}
|
||||
};
|
||||
|
||||
this.$rules = {
|
||||
start : [
|
||||
{
|
||||
token : "constant.numeric",
|
||||
regex : "(?:0x[\\da-fA-F]+|(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:[eE][+-]?\\d+)?)"
|
||||
}, {
|
||||
token : "string",
|
||||
merge : true,
|
||||
regex : "'''",
|
||||
next : "qdoc"
|
||||
}, {
|
||||
token : "string",
|
||||
merge : true,
|
||||
regex : '"""',
|
||||
next : "qqdoc"
|
||||
}, {
|
||||
token : "string",
|
||||
merge : true,
|
||||
regex : "'",
|
||||
next : "qstring"
|
||||
}, {
|
||||
token : "string",
|
||||
merge : true,
|
||||
regex : '"',
|
||||
next : "qqstring"
|
||||
}, {
|
||||
token : "string",
|
||||
merge : true,
|
||||
regex : "`",
|
||||
next : "js"
|
||||
}, {
|
||||
token : "string.regex",
|
||||
merge : true,
|
||||
regex : "///",
|
||||
next : "heregex"
|
||||
}, {
|
||||
token : "string.regex",
|
||||
regex : /(?:\/(?![\s=])[^[\/\n\\]*(?:(?:\\[\s\S]|\[[^\]\n\\]*(?:\\[\s\S][^\]\n\\]*)*])[^[\/\n\\]*)*\/)(?:[imgy]{0,4})(?!\w)/
|
||||
}, {
|
||||
token : "comment",
|
||||
merge : true,
|
||||
regex : "###(?!#)",
|
||||
next : "comment"
|
||||
}, {
|
||||
token : "comment",
|
||||
regex : "#.*"
|
||||
}, {
|
||||
token : [
|
||||
"punctuation.operator", "identifier"
|
||||
],
|
||||
regex : "(\\.)(" + illegal + ")"
|
||||
}, {
|
||||
token : "punctuation.operator",
|
||||
regex : "\\."
|
||||
}, {
|
||||
//class A extends B
|
||||
token : [
|
||||
"keyword", "text", "language.support.class", "text", "keyword", "text", "language.support.class"
|
||||
],
|
||||
regex : "(class)(\\s+)(" + identifier + ")(\\s+)(extends)(\\s+)(" + identifier + ")"
|
||||
}, {
|
||||
//class A
|
||||
token : [
|
||||
"keyword", "text", "language.support.class"
|
||||
],
|
||||
regex : "(class)(\\s+)(" + identifier + ")"
|
||||
}, {
|
||||
//play = ({args}) ->
|
||||
token : [
|
||||
"entity.name.function", "text", "keyword.operator", "text"
|
||||
].concat(functionRules["({args})->"].token),
|
||||
regex : "(" + identifier + ")(\\s*)(=)(\\s*)" + functionRules["({args})->"].regex
|
||||
}, {
|
||||
//play : ({args}) ->
|
||||
token : [
|
||||
"entity.name.function", "text", "punctuation.operator", "text"
|
||||
].concat(functionRules["({args})->"].token),
|
||||
regex : "(" + identifier + ")(\\s*)(:)(\\s*)" + functionRules["({args})->"].regex
|
||||
}, {
|
||||
//play = ({}) ->
|
||||
token : [
|
||||
"entity.name.function", "text", "keyword.operator", "text"
|
||||
].concat(functionRules["({})->"].token),
|
||||
regex : "(" + identifier + ")(\\s*)(=)(\\s*)" + functionRules["({})->"].regex
|
||||
}, {
|
||||
//play : ({}) ->
|
||||
token : [
|
||||
"entity.name.function", "text", "punctuation.operator", "text"
|
||||
].concat(functionRules["({})->"].token),
|
||||
regex : "(" + identifier + ")(\\s*)(:)(\\s*)" + functionRules["({})->"].regex
|
||||
}, {
|
||||
//play = (args) ->
|
||||
token : [
|
||||
"entity.name.function", "text", "keyword.operator", "text"
|
||||
].concat(functionRules["(args)->"].token),
|
||||
regex : "(" + identifier + ")(\\s*)(=)(\\s*)" + functionRules["(args)->"].regex
|
||||
}, {
|
||||
//play : (args) ->
|
||||
token : [
|
||||
"entity.name.function", "text", "punctuation.operator", "text"
|
||||
].concat(functionRules["(args)->"].token),
|
||||
regex : "(" + identifier + ")(\\s*)(:)(\\s*)" + functionRules["(args)->"].regex
|
||||
}, {
|
||||
//play = () ->
|
||||
token : [
|
||||
"entity.name.function", "text", "keyword.operator", "text"
|
||||
].concat(functionRules["()->"].token),
|
||||
regex : "(" + identifier + ")(\\s*)(=)(\\s*)" + functionRules["()->"].regex
|
||||
}, {
|
||||
//play : () ->
|
||||
token : [
|
||||
"entity.name.function", "text", "punctuation.operator", "text"
|
||||
].concat(functionRules["()->"].token),
|
||||
regex : "(" + identifier + ")(\\s*)(:)(\\s*)" + functionRules["()->"].regex
|
||||
}, {
|
||||
//play = ->
|
||||
token : [
|
||||
"entity.name.function", "text", "keyword.operator", "text", "storage.type"
|
||||
],
|
||||
regex : "(" + identifier + ")(\\s*)(=)(\\s*)([\\-=]>)"
|
||||
}, {
|
||||
//play : ->
|
||||
token : [
|
||||
"entity.name.function", "text", "punctuation.operator", "text", "storage.type"
|
||||
],
|
||||
regex : "(" + identifier + ")(\\s*)(:)(\\s*)([\\-=]>)"
|
||||
},
|
||||
functionRules["({args})->"],
|
||||
functionRules["({})->"],
|
||||
functionRules["(args)->"],
|
||||
functionRules["()->"]
|
||||
, {
|
||||
token : "identifier",
|
||||
regex : "(?:(?:\\.|::)\\s*)" + identifier
|
||||
}, {
|
||||
token : "variable",
|
||||
regex : "@(?:" + identifier + ")?"
|
||||
}, {
|
||||
token: keywordMapper,
|
||||
regex : identifier
|
||||
}, {
|
||||
token : "punctuation.operator",
|
||||
regex : "\\?|\\:|\\,|\\."
|
||||
}, {
|
||||
token : "storage.type",
|
||||
regex : "[\\-=]>"
|
||||
}, {
|
||||
token : "keyword.operator",
|
||||
regex : "(?:[-+*/%<>&|^!?=]=|>>>=?|\\-\\-|\\+\\+|::|&&=|\\|\\|=|<<=|>>=|\\?\\.|\\.{2,3}|[!*+-=><])"
|
||||
}, {
|
||||
token : "paren.lparen",
|
||||
regex : "[({[]"
|
||||
}, {
|
||||
token : "paren.rparen",
|
||||
regex : "[\\]})]"
|
||||
}, {
|
||||
token : "text",
|
||||
regex : "\\s+"
|
||||
}],
|
||||
|
||||
qdoc : [{
|
||||
token : "string",
|
||||
regex : ".*?'''",
|
||||
next : "start"
|
||||
}, stringfill],
|
||||
|
||||
qqdoc : [{
|
||||
token : "string",
|
||||
regex : '.*?"""',
|
||||
next : "start"
|
||||
}, stringfill],
|
||||
|
||||
qstring : [{
|
||||
token : "string",
|
||||
regex : "[^\\\\']*(?:\\\\.[^\\\\']*)*'",
|
||||
merge : true,
|
||||
next : "start"
|
||||
}, stringfill],
|
||||
|
||||
qqstring : [{
|
||||
token : "string",
|
||||
regex : '[^\\\\"]*(?:\\\\.[^\\\\"]*)*"',
|
||||
merge : true,
|
||||
next : "start"
|
||||
}, stringfill],
|
||||
|
||||
js : [{
|
||||
token : "string",
|
||||
merge : true,
|
||||
regex : "[^\\\\`]*(?:\\\\.[^\\\\`]*)*`",
|
||||
next : "start"
|
||||
}, stringfill],
|
||||
|
||||
heregex : [{
|
||||
token : "string.regex",
|
||||
regex : '.*?///[imgy]{0,4}',
|
||||
next : "start"
|
||||
}, {
|
||||
token : "comment.regex",
|
||||
regex : "\\s+(?:#.*)?"
|
||||
}, {
|
||||
token : "string.regex",
|
||||
merge : true,
|
||||
regex : "\\S+"
|
||||
}],
|
||||
|
||||
comment : [{
|
||||
token : "comment",
|
||||
regex : '.*?###',
|
||||
next : "start"
|
||||
}, {
|
||||
token : "comment",
|
||||
merge : true,
|
||||
regex : ".+"
|
||||
}]
|
||||
};
|
||||
}
|
||||
|
||||
exports.CoffeeHighlightRules = CoffeeHighlightRules;
|
||||
});
|
||||
-266
@@ -1,266 +0,0 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Distributed under the BSD license:
|
||||
*
|
||||
* Copyright (c) 2010, Ajax.org B.V.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of Ajax.org B.V. nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
if (typeof process !== "undefined") {
|
||||
require("amd-loader");
|
||||
}
|
||||
|
||||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var Mode = require("./coffee").Mode;
|
||||
var assert = require("../test/assertions");
|
||||
|
||||
module.exports = {
|
||||
setUp : function() {
|
||||
this.tokenizer = new Mode().getTokenizer();
|
||||
this.testTokens = function(tokens, correct) {
|
||||
assert.equal(tokens.length, correct.length);
|
||||
correct.forEach(function(type, i) {
|
||||
assert.equal(tokens[i].type, type);
|
||||
});
|
||||
};
|
||||
},
|
||||
|
||||
"test: tokenize keyword": function() {
|
||||
var tokens = this.tokenizer.getLineTokens("for", "start").tokens;
|
||||
assert.equal(tokens.length, 1);
|
||||
assert.equal(tokens[0].type, "keyword");
|
||||
},
|
||||
|
||||
"test: tokenize regexp": function() {
|
||||
var tokens = this.tokenizer.getLineTokens('/"[a]/', "start").tokens;
|
||||
assert.equal(tokens.length, 1);
|
||||
assert.equal(tokens[0].type, "string.regex");
|
||||
},
|
||||
|
||||
"test: tokenize function: 'foo = ({args}) ->'": function() {
|
||||
var tokens = this.tokenizer.getLineTokens("foo = ({args}) ->", "start").tokens;
|
||||
var correct = [
|
||||
"entity.name.function", "text", "keyword.operator", "text",
|
||||
"paren.lparen", "paren.lparen", "variable.parameter", "paren.rparen", "paren.rparen", "text", "storage.type"
|
||||
];
|
||||
this.testTokens(tokens, correct);
|
||||
|
||||
tokens = this.tokenizer.getLineTokens("foo = ({a1, a2}) ->", "start").tokens;
|
||||
this.testTokens(tokens, correct);
|
||||
|
||||
tokens = this.tokenizer.getLineTokens("foo = ({@a1, a2}) ->", "start").tokens;
|
||||
this.testTokens(tokens, correct);
|
||||
},
|
||||
|
||||
"test: tokenize function: 'foo : ({args}) ->'": function() {
|
||||
var tokens = this.tokenizer.getLineTokens("foo : ({args}) ->", "start").tokens;
|
||||
var correct = [
|
||||
"entity.name.function", "text", "punctuation.operator", "text",
|
||||
"paren.lparen", "paren.lparen", "variable.parameter", "paren.rparen", "paren.rparen", "text", "storage.type"
|
||||
];
|
||||
this.testTokens(tokens, correct);
|
||||
},
|
||||
|
||||
"test: tokenize function: invalid case: 'foo = ({args}) ->'": function() {
|
||||
var tokens = this.tokenizer.getLineTokens("foo = ({0abc}) ->", "start").tokens;
|
||||
assert.notEqual(tokens[0].type, "entity.name.function");
|
||||
|
||||
tokens = this.tokenizer.getLineTokens("foo = ({/abc}) ->", "start").tokens;
|
||||
assert.notEqual(tokens[0].type, "entity.name.function");
|
||||
|
||||
tokens = this.tokenizer.getLineTokens("foo = ({abc/}) ->", "start").tokens;
|
||||
assert.notEqual(tokens[0].type, "entity.name.function");
|
||||
|
||||
tokens = this.tokenizer.getLineTokens("foo = ({#abc}) ->", "start").tokens;
|
||||
assert.notEqual(tokens[0].type, "entity.name.function");
|
||||
|
||||
tokens = this.tokenizer.getLineTokens("foo = ({abc#}) ->", "start").tokens;
|
||||
assert.notEqual(tokens[0].type, "entity.name.function");
|
||||
|
||||
tokens = this.tokenizer.getLineTokens("foo = ({)abc}) ->", "start").tokens;
|
||||
assert.notEqual(tokens[0].type, "entity.name.function");
|
||||
|
||||
tokens = this.tokenizer.getLineTokens("foo = ({abc)}) ->", "start").tokens;
|
||||
assert.notEqual(tokens[0].type, "entity.name.function");
|
||||
|
||||
tokens = this.tokenizer.getLineTokens("foo = ({a{bc}) ->", "start").tokens;
|
||||
assert.notEqual(tokens[0].type, "entity.name.function");
|
||||
},
|
||||
|
||||
"test: tokenize function: 'foo = ({}) ->'": function() {
|
||||
var tokens = this.tokenizer.getLineTokens("foo = ({}) ->", "start").tokens;
|
||||
var correct = [
|
||||
"entity.name.function", "text", "keyword.operator", "text",
|
||||
"paren.lparen", "paren.lparen", "paren.rparen", "paren.rparen", "text", "storage.type"
|
||||
];
|
||||
this.testTokens(tokens, correct);
|
||||
|
||||
tokens = this.tokenizer.getLineTokens("foo = ({ }) ->", "start").tokens;
|
||||
correct = [
|
||||
"entity.name.function", "text", "keyword.operator", "text",
|
||||
"paren.lparen", "paren.lparen", "text", "paren.rparen", "paren.rparen", "text", "storage.type"
|
||||
];
|
||||
assert.equal(tokens.length, 11);
|
||||
this.testTokens(tokens, correct);
|
||||
},
|
||||
|
||||
"test: tokenize function: 'foo : ({}) ->'": function() {
|
||||
var tokens = this.tokenizer.getLineTokens("foo : ({}) ->", "start").tokens;
|
||||
var correct = [
|
||||
"entity.name.function", "text", "punctuation.operator", "text",
|
||||
"paren.lparen", "paren.lparen", "paren.rparen", "paren.rparen", "text", "storage.type"
|
||||
];
|
||||
this.testTokens(tokens, correct);
|
||||
},
|
||||
|
||||
"test: tokenize function: 'foo = (args) ->'": function() {
|
||||
var tokens = this.tokenizer.getLineTokens("foo = (args) ->", "start").tokens;
|
||||
var correct = [
|
||||
"entity.name.function", "text", "keyword.operator", "text",
|
||||
"paren.lparen", "variable.parameter", "paren.rparen", "text", "storage.type"
|
||||
];
|
||||
this.testTokens(tokens, correct);
|
||||
|
||||
tokens = this.tokenizer.getLineTokens("foo = (arg1, arg2) ->", "start").tokens;
|
||||
this.testTokens(tokens, correct);
|
||||
|
||||
tokens = this.tokenizer.getLineTokens("foo = (arg1 = 1, arg2 = 'name') ->", "start").tokens;
|
||||
this.testTokens(tokens, correct);
|
||||
|
||||
tokens = this.tokenizer.getLineTokens("foo = (@arg1 = /abc/, arg2 = 'name') ->", "start").tokens;
|
||||
this.testTokens(tokens, correct);
|
||||
},
|
||||
|
||||
"test: tokenize function: invalid case: 'foo=(args) ->'": function() {
|
||||
var tokens = this.tokenizer.getLineTokens("foo=(/args) ->", "start").tokens;
|
||||
assert.notEqual(tokens[0].type, "entity.name.function");
|
||||
},
|
||||
|
||||
"test: tokenize function: 'foo = () ->'": function() {
|
||||
var tokens = this.tokenizer.getLineTokens("foo = () ->", "start").tokens;
|
||||
var correct = [
|
||||
"entity.name.function", "text", "keyword.operator", "text",
|
||||
"paren.lparen", "paren.rparen", "text", "storage.type"
|
||||
];
|
||||
this.testTokens(tokens, correct);
|
||||
|
||||
tokens = this.tokenizer.getLineTokens("foo = ( ) ->", "start").tokens;
|
||||
correct = [
|
||||
"entity.name.function", "text", "keyword.operator", "text",
|
||||
"paren.lparen", "text", "paren.rparen", "text", "storage.type"
|
||||
];
|
||||
this.testTokens(tokens, correct);
|
||||
},
|
||||
|
||||
"test: tokenize function: 'foo : () ->'": function() {
|
||||
var tokens = this.tokenizer.getLineTokens("foo : () ->", "start").tokens;
|
||||
var correct = [
|
||||
"entity.name.function", "text", "punctuation.operator", "text",
|
||||
"paren.lparen", "paren.rparen", "text", "storage.type"
|
||||
];
|
||||
this.testTokens(tokens, correct);
|
||||
|
||||
tokens = this.tokenizer.getLineTokens("foo : ( ) ->", "start").tokens;
|
||||
var correct = [
|
||||
"entity.name.function", "text", "punctuation.operator", "text",
|
||||
"paren.lparen", "text", "paren.rparen", "text", "storage.type"
|
||||
];
|
||||
this.testTokens(tokens, correct);
|
||||
},
|
||||
|
||||
"test: tokenize function: 'window.foo = (args) ->'": function() {
|
||||
var tokens = this.tokenizer.getLineTokens("window.foo = (args) ->", "start").tokens;
|
||||
var correct = [
|
||||
"variable.language", "punctuation.operator", "entity.name.function", "text", "keyword.operator", "text",
|
||||
"paren.lparen", "variable.parameter", "paren.rparen", "text", "storage.type"
|
||||
];
|
||||
this.testTokens(tokens, correct);
|
||||
},
|
||||
|
||||
"test: tokenize function: 'foo = ->'": function() {
|
||||
var tokens = this.tokenizer.getLineTokens("foo = ->", "start").tokens;
|
||||
var correct = [
|
||||
"entity.name.function", "text", "keyword.operator", "text", "storage.type"
|
||||
];
|
||||
this.testTokens(tokens, correct);
|
||||
},
|
||||
|
||||
"test: tokenize function: 'foo : ->'": function() {
|
||||
var tokens = this.tokenizer.getLineTokens("foo : ->", "start").tokens;
|
||||
var correct = [
|
||||
"entity.name.function", "text", "punctuation.operator", "text", "storage.type"
|
||||
];
|
||||
this.testTokens(tokens, correct);
|
||||
},
|
||||
|
||||
"test: tokenize callback function: 'foo bar: 1, (args) ->'": function() {
|
||||
var tokens = this.tokenizer.getLineTokens("foo bar: 1, (args) ->", "start").tokens;
|
||||
var correct = [
|
||||
"identifier", "text", "identifier", "punctuation.operator", "text", "constant.numeric", "punctuation.operator", "text",
|
||||
"paren.lparen", "variable.parameter", "paren.rparen", "text", "storage.type"
|
||||
];
|
||||
this.testTokens(tokens, correct);
|
||||
},
|
||||
|
||||
"test: tokenize class: 'class Foo'": function() {
|
||||
var tokens = this.tokenizer.getLineTokens("class Foo", "start").tokens;
|
||||
var correct = [
|
||||
"keyword", "text", "language.support.class"
|
||||
];
|
||||
this.testTokens(tokens, correct);
|
||||
},
|
||||
|
||||
"test: tokenize class 'class Foo extends Bar'": function() {
|
||||
var tokens = this.tokenizer.getLineTokens("class Foo extends Bar", "start").tokens;
|
||||
var correct = [
|
||||
"keyword", "text", "language.support.class", "text", "keyword", "text", "language.support.class"
|
||||
];
|
||||
this.testTokens(tokens, correct);
|
||||
},
|
||||
|
||||
"test: tokenize illegal name property: 'foo.static.function'": function() {
|
||||
var tokens = this.tokenizer.getLineTokens("foo.static.function", "start").tokens;
|
||||
var correct = [
|
||||
"identifier", "punctuation.operator", "identifier", "punctuation.operator", "identifier"
|
||||
];
|
||||
this.testTokens(tokens, correct);
|
||||
},
|
||||
|
||||
// TODO: disable. not yet implemented
|
||||
"!test tokenize string with interpolation": function() {
|
||||
var tokens = this.tokenizer.getLineTokens('"#{ 22 / 7 } is a decent approximation of π"', "start").tokens;
|
||||
console.log(tokens);
|
||||
assert.equal(tokens.length, 12);
|
||||
//assert.equal(tokens[0].type, "keyword");
|
||||
}
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec();
|
||||
}
|
||||
-128
@@ -1,128 +0,0 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Distributed under the BSD license:
|
||||
*
|
||||
* Copyright (c) 2010, Ajax.org B.V.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of Ajax.org B.V. nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var oop = require("../lib/oop");
|
||||
var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
|
||||
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
|
||||
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
||||
var xml_util = require("./xml_util");
|
||||
|
||||
var ColdfusionHighlightRules = function() {
|
||||
|
||||
// regexp must not have capturing parentheses
|
||||
// regexps are ordered -> the first match is used
|
||||
|
||||
this.$rules = {
|
||||
start : [ {
|
||||
token : "text",
|
||||
merge : true,
|
||||
regex : "<\\!\\[CDATA\\[",
|
||||
next : "cdata"
|
||||
}, {
|
||||
token : "xml-pe",
|
||||
regex : "<\\?.*?\\?>"
|
||||
}, {
|
||||
token : "comment",
|
||||
merge : true,
|
||||
regex : "<\\!--",
|
||||
next : "comment"
|
||||
}, {
|
||||
token : "meta.tag",
|
||||
regex : "<(?=script)",
|
||||
next : "script"
|
||||
}, {
|
||||
token : "meta.tag",
|
||||
regex : "<(?=style)",
|
||||
next : "style"
|
||||
}, {
|
||||
token : "meta.tag", // opening tag
|
||||
regex : "<\\/?",
|
||||
next : "tag"
|
||||
}, {
|
||||
token : "text",
|
||||
regex : "\\s+"
|
||||
}, {
|
||||
token : "text",
|
||||
regex : "[^<]+"
|
||||
} ],
|
||||
|
||||
cdata : [ {
|
||||
token : "text",
|
||||
regex : "\\]\\]>",
|
||||
next : "start"
|
||||
}, {
|
||||
token : "text",
|
||||
merge : true,
|
||||
regex : "\\s+"
|
||||
}, {
|
||||
token : "text",
|
||||
merge : true,
|
||||
regex : ".+"
|
||||
} ],
|
||||
|
||||
comment : [ {
|
||||
token : "comment",
|
||||
regex : ".*?-->",
|
||||
next : "start"
|
||||
}, {
|
||||
token : "comment",
|
||||
merge : true,
|
||||
regex : ".+"
|
||||
} ]
|
||||
};
|
||||
|
||||
xml_util.tag(this.$rules, "tag", "start");
|
||||
xml_util.tag(this.$rules, "style", "css-start");
|
||||
xml_util.tag(this.$rules, "script", "js-start");
|
||||
|
||||
this.embedRules(JavaScriptHighlightRules, "js-", [{
|
||||
token: "comment",
|
||||
regex: "\\/\\/.*(?=<\\/script>)",
|
||||
next: "tag"
|
||||
}, {
|
||||
token: "meta.tag",
|
||||
regex: "<\\/(?=script)",
|
||||
next: "tag"
|
||||
}]);
|
||||
|
||||
this.embedRules(CssHighlightRules, "css-", [{
|
||||
token: "meta.tag",
|
||||
regex: "<\\/(?=style)",
|
||||
next: "tag"
|
||||
}]);
|
||||
};
|
||||
|
||||
oop.inherits(ColdfusionHighlightRules, TextHighlightRules);
|
||||
|
||||
exports.ColdfusionHighlightRules = ColdfusionHighlightRules;
|
||||
});
|
||||
-192
@@ -1,192 +0,0 @@
|
||||
/*
|
||||
THIS FILE WAS AUTOGENERATED BY mode_highlight_rules.tmpl.js (UUID: 958518BC-799F-477A-99F9-5B28EBF230F6) */
|
||||
|
||||
|
||||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var oop = require("../lib/oop");
|
||||
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
||||
|
||||
var DartHighlightRules = function() {
|
||||
|
||||
var constantLanguage = "true|false|null";
|
||||
var variableLanguage = "this|super";
|
||||
var keywordControl = "try|catch|finally|throw|break|case|continue|default|do|else|for|if|in|return|switch|while|new";
|
||||
var keywordDeclaration = "abstract|class|extends|external|factory|implements|interface|get|native|operator|set|typedef";
|
||||
var storageModifier = "static|final|const";
|
||||
var storageType = "void|bool|num|int|double|Dynamic|var|String";
|
||||
|
||||
var keywordMapper = this.createKeywordMapper({
|
||||
"constant.language.dart": constantLanguage,
|
||||
"variable.language.dart": variableLanguage,
|
||||
"keyword.control.dart": keywordControl,
|
||||
"keyword.declaration.dart": keywordDeclaration,
|
||||
"storage.modifier.dart": storageModifier,
|
||||
"storage.type.primitive.dart": storageType
|
||||
}, "identifier");
|
||||
|
||||
var stringfill = {
|
||||
token : "string",
|
||||
merge : true,
|
||||
regex : ".+"
|
||||
};
|
||||
|
||||
// regexp must not have capturing parentheses. Use (?:) instead.
|
||||
// regexps are ordered -> the first match is used
|
||||
|
||||
this.$rules =
|
||||
{
|
||||
"start": [
|
||||
{
|
||||
"token" : "comment",
|
||||
"regex" : /\/\/.*$/
|
||||
},
|
||||
{
|
||||
"token" : "comment", // multi line comment
|
||||
"merge" : true,
|
||||
"regex" : /\/\*/,
|
||||
"next" : "comment"
|
||||
},
|
||||
{
|
||||
"token": ["meta.preprocessor.script.dart"],
|
||||
"regex": "^(#!.*)$"
|
||||
},
|
||||
{
|
||||
"token": [ "keyword.other.import.dart", "meta.declaration.dart"],
|
||||
"regex": "#(?:\\b)(?:library|import|source|resource)(?:\\b)"
|
||||
},
|
||||
{
|
||||
"token" : ["keyword.other.import.dart", "text"],
|
||||
"regex" : "(?:\\b)(prefix)(\\s*:)"
|
||||
},
|
||||
{
|
||||
"regex": "\\bas\\b",
|
||||
"token": "keyword.cast.dart"
|
||||
},
|
||||
{
|
||||
"regex": "\\?|:",
|
||||
"token": "keyword.control.ternary.dart"
|
||||
},
|
||||
{
|
||||
"regex": "(?:\\b)(is\\!?)(?:\\b)",
|
||||
"token": ["keyword.operator.dart"]
|
||||
},
|
||||
{
|
||||
"regex": "(<<|>>>?|~|\\^|\\||&)",
|
||||
"token": ["keyword.operator.bitwise.dart"]
|
||||
},
|
||||
{
|
||||
"regex": "((?:&|\\^|\\||<<|>>>?)=)",
|
||||
"token": ["keyword.operator.assignment.bitwise.dart"]
|
||||
},
|
||||
{
|
||||
"regex": "(===?|!==?|<=?|>=?)",
|
||||
"token": ["keyword.operator.comparison.dart"]
|
||||
},
|
||||
{
|
||||
"regex": "((?:[+*/%-]|\\~)=)",
|
||||
"token": ["keyword.operator.assignment.arithmetic.dart"]
|
||||
},
|
||||
{
|
||||
"regex": "=",
|
||||
"token": "keyword.operator.assignment.dart"
|
||||
},
|
||||
{
|
||||
"token" : "string",
|
||||
"merge" : true,
|
||||
"regex" : "'''",
|
||||
"next" : "qdoc"
|
||||
},
|
||||
{
|
||||
"token" : "string",
|
||||
"merge" : true,
|
||||
"regex" : '"""',
|
||||
"next" : "qqdoc"
|
||||
},
|
||||
{
|
||||
"token" : "string",
|
||||
"merge" : true,
|
||||
"regex" : "'",
|
||||
"next" : "qstring"
|
||||
},
|
||||
{
|
||||
"token" : "string",
|
||||
"merge" : true,
|
||||
"regex" : '"',
|
||||
"next" : "qqstring"
|
||||
},
|
||||
{
|
||||
"regex": "(\\-\\-|\\+\\+)",
|
||||
"token": ["keyword.operator.increment-decrement.dart"]
|
||||
},
|
||||
{
|
||||
"regex": "(\\-|\\+|\\*|\\/|\\~\\/|%)",
|
||||
"token": ["keyword.operator.arithmetic.dart"]
|
||||
},
|
||||
{
|
||||
"regex": "(!|&&|\\|\\|)",
|
||||
"token": ["keyword.operator.logical.dart"]
|
||||
},
|
||||
{
|
||||
"token" : "constant.numeric", // hex
|
||||
"regex" : "0[xX][0-9a-fA-F]+\\b"
|
||||
},
|
||||
{
|
||||
"token" : "constant.numeric", // float
|
||||
"regex" : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
|
||||
},
|
||||
{
|
||||
"token" : keywordMapper,
|
||||
"regex" : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
|
||||
}
|
||||
],
|
||||
"comment" : [
|
||||
{
|
||||
token : "comment", // closing comment
|
||||
regex : ".*?\\*\\/",
|
||||
merge : true,
|
||||
next : "start"
|
||||
}, {
|
||||
token : "comment", // comment spanning whole line
|
||||
merge : true,
|
||||
regex : ".+"
|
||||
}
|
||||
],
|
||||
"qdoc" : [
|
||||
{
|
||||
"token" : "string",
|
||||
"regex" : ".*?'''",
|
||||
"next" : "start"
|
||||
}, stringfill],
|
||||
|
||||
"qqdoc" : [
|
||||
{
|
||||
"token" : "string",
|
||||
"regex" : '.*?"""',
|
||||
"next" : "start"
|
||||
}, stringfill],
|
||||
|
||||
"qstring" : [
|
||||
{
|
||||
"token" : "string",
|
||||
"regex" : "[^\\\\']*(?:\\\\.[^\\\\']*)*'",
|
||||
"merge" : true,
|
||||
"next" : "start"
|
||||
}, stringfill],
|
||||
|
||||
"qqstring" : [
|
||||
{
|
||||
"token" : "string",
|
||||
"regex" : '[^\\\\"]*(?:\\\\.[^\\\\"]*)*"',
|
||||
"merge" : true,
|
||||
"next" : "start"
|
||||
}, stringfill]
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
oop.inherits(DartHighlightRules, TextHighlightRules);
|
||||
|
||||
exports.DartHighlightRules = DartHighlightRules;
|
||||
});
|
||||
@@ -1,80 +0,0 @@
|
||||
define(function(require, exports, module) {
|
||||
|
||||
var oop = require("../lib/oop");
|
||||
var TextMode = require("./text").Mode;
|
||||
var Tokenizer = require("../tokenizer").Tokenizer;
|
||||
var GolangHighlightRules = require("./golang_highlight_rules").GolangHighlightRules;
|
||||
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
|
||||
var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
|
||||
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
this.$tokenizer = new Tokenizer(new GolangHighlightRules().getRules());
|
||||
this.$outdent = new MatchingBraceOutdent();
|
||||
this.foldingRules = new CStyleFoldMode();
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
(function() {
|
||||
|
||||
this.toggleCommentLines = function(state, doc, startRow, endRow) {
|
||||
var outdent = true;
|
||||
var re = /^(\s*)\/\//;
|
||||
|
||||
for (var i=startRow; i<= endRow; i++) {
|
||||
if (!re.test(doc.getLine(i))) {
|
||||
outdent = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (outdent) {
|
||||
var deleteRange = new Range(0, 0, 0, 0);
|
||||
for (var i=startRow; i<= endRow; i++)
|
||||
{
|
||||
var line = doc.getLine(i);
|
||||
var m = line.match(re);
|
||||
deleteRange.start.row = i;
|
||||
deleteRange.end.row = i;
|
||||
deleteRange.end.column = m[0].length;
|
||||
doc.replace(deleteRange, m[1]);
|
||||
}
|
||||
}
|
||||
else {
|
||||
doc.indentRows(startRow, endRow, "//");
|
||||
}
|
||||
};
|
||||
|
||||
this.getNextLineIndent = function(state, line, tab) {
|
||||
var indent = this.$getIndent(line);
|
||||
|
||||
var tokenizedLine = this.$tokenizer.getLineTokens(line, state);
|
||||
var tokens = tokenizedLine.tokens;
|
||||
var endState = tokenizedLine.state;
|
||||
|
||||
if (tokens.length && tokens[tokens.length-1].type == "comment") {
|
||||
return indent;
|
||||
}
|
||||
|
||||
if (state == "start") {
|
||||
var match = line.match(/^.*[\{\(\[]\s*$/);
|
||||
if (match) {
|
||||
indent += tab;
|
||||
}
|
||||
}
|
||||
|
||||
return indent;
|
||||
};//end getNextLineIndent
|
||||
|
||||
this.checkOutdent = function(state, line, input) {
|
||||
return this.$outdent.checkOutdent(line, input);
|
||||
};
|
||||
|
||||
this.autoOutdent = function(state, doc, row) {
|
||||
this.$outdent.autoOutdent(doc, row);
|
||||
};
|
||||
|
||||
}).call(Mode.prototype);
|
||||
|
||||
exports.Mode = Mode;
|
||||
});
|
||||
-186
@@ -1,186 +0,0 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Distributed under the BSD license:
|
||||
*
|
||||
* Copyright (c) 2010, Ajax.org B.V.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of Ajax.org B.V. nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
if (typeof process !== "undefined") {
|
||||
require("amd-loader");
|
||||
}
|
||||
|
||||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var HtmlMode = require("./html").Mode;
|
||||
var assert = require("../test/assertions");
|
||||
|
||||
var testData = {
|
||||
"test: tokenize embedded script" : [{
|
||||
text: "<script a='a'>var</script>'123'",
|
||||
state: ["start", "start"],
|
||||
tokens: [{
|
||||
type: "meta.tag",
|
||||
value: "<"
|
||||
}, {
|
||||
type: "meta.tag.tag-name.script",
|
||||
value: "script"
|
||||
}, {
|
||||
type: "text",
|
||||
value: " "
|
||||
}, {
|
||||
type: "entity.other.attribute-name",
|
||||
value: "a"
|
||||
}, {
|
||||
type: "keyword.operator",
|
||||
value: "="
|
||||
}, {
|
||||
type: "string",
|
||||
value: "'a'"
|
||||
}, {
|
||||
type: "meta.tag",
|
||||
value: ">"
|
||||
}, {
|
||||
type: "storage.type",
|
||||
value: "var"
|
||||
}, {
|
||||
type: "meta.tag",
|
||||
value: "</"
|
||||
}, {
|
||||
type: "meta.tag.tag-name.script",
|
||||
value: "script"
|
||||
}, {
|
||||
type: "meta.tag",
|
||||
value: ">"
|
||||
}, {
|
||||
type: "text",
|
||||
value: "'123'"
|
||||
}]
|
||||
}],
|
||||
|
||||
"test: tokenize multiline attribute value with double quotes": [{
|
||||
text: "<a href=\"abc",
|
||||
state: [ "start", "tag_qqstring"],
|
||||
tokens: [{
|
||||
type: "meta.tag",
|
||||
value: "<"
|
||||
}, {
|
||||
type: "meta.tag.tag-name.anchor",
|
||||
value: "a"
|
||||
}, {
|
||||
type: "text",
|
||||
value: " "
|
||||
}, {
|
||||
type: "entity.other.attribute-name",
|
||||
value: "href"
|
||||
}, {
|
||||
type: "keyword.operator",
|
||||
value: "="
|
||||
}, {
|
||||
type: "string",
|
||||
value: "\"abc"
|
||||
}
|
||||
]
|
||||
}, {
|
||||
text: "def\">",
|
||||
state: [ "tag_qqstring", "start" ],
|
||||
tokens: [ {
|
||||
type: "string",
|
||||
value: "def\""
|
||||
}, {
|
||||
type: "meta.tag",
|
||||
value: ">"
|
||||
}
|
||||
]
|
||||
}],
|
||||
|
||||
"test: tokenize multiline attribute value with single quotes": [{
|
||||
text: "<a href='abc",
|
||||
state: ["start", "tag_qstring"],
|
||||
tokens: [{
|
||||
type: "meta.tag",
|
||||
value: "<"
|
||||
}, {
|
||||
type: "meta.tag.tag-name.anchor",
|
||||
value: "a"
|
||||
}, {
|
||||
type: "text",
|
||||
value: " "
|
||||
}, {
|
||||
type: "entity.other.attribute-name",
|
||||
value: "href"
|
||||
}, {
|
||||
type: "keyword.operator",
|
||||
value: "="
|
||||
}, {
|
||||
type: "string",
|
||||
value: "'abc"
|
||||
}
|
||||
]
|
||||
}, {
|
||||
text: "def\"'>",
|
||||
state: [ "tag_qstring", "start" ],
|
||||
tokens: [ {
|
||||
type: "string",
|
||||
value: "def\"'"
|
||||
}, {
|
||||
type: "meta.tag",
|
||||
value: ">"
|
||||
}
|
||||
]
|
||||
}]
|
||||
};
|
||||
|
||||
function generateTest(exampleData) {
|
||||
return function testTokenizer() {
|
||||
for (var i = 0; i < exampleData.length; i++) {
|
||||
var s = exampleData[i];
|
||||
var lineTokens = tokenizer.getLineTokens(s.text, s.state[0]);
|
||||
|
||||
assert.equal(
|
||||
JSON.stringify(lineTokens, null, 4),
|
||||
JSON.stringify({tokens:s.tokens, state: s.state[1]}, null, 4)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var tokenizer;
|
||||
module.exports = {
|
||||
setUp : function() {
|
||||
tokenizer = new HtmlMode().getTokenizer();
|
||||
}
|
||||
}
|
||||
|
||||
for (var i in testData) {
|
||||
module.exports[i] = generateTest(testData[i])
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec();
|
||||
}
|
||||
-4838
File diff suppressed because it is too large
Load Diff
-218
@@ -1,218 +0,0 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Distributed under the BSD license:
|
||||
*
|
||||
* Copyright (c) 2010, Ajax.org B.V.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of Ajax.org B.V. nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
if (typeof process !== "undefined") {
|
||||
require("amd-loader");
|
||||
}
|
||||
|
||||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var JavaScriptMode = require("./javascript").Mode;
|
||||
var assert = require("../test/assertions");
|
||||
|
||||
module.exports = {
|
||||
|
||||
name: "JavaScript Tokenizer",
|
||||
|
||||
setUp : function() {
|
||||
this.tokenizer = new JavaScriptMode().getTokenizer();
|
||||
},
|
||||
|
||||
"test: tokenize1" : function() {
|
||||
var line = "foo = function";
|
||||
|
||||
var tokens = this.tokenizer.getLineTokens(line, "start").tokens;
|
||||
|
||||
assert.equal(5, tokens.length);
|
||||
assert.equal("identifier", tokens[0].type);
|
||||
assert.equal("text", tokens[1].type);
|
||||
assert.equal("keyword.operator", tokens[2].type);
|
||||
assert.equal("text", tokens[3].type);
|
||||
assert.equal("storage.type", tokens[4].type);
|
||||
},
|
||||
|
||||
"test: tokenize 'standard' functions" : function() {
|
||||
var line = "string.charCodeAt(23); document.getElementById('test'); console.log('Here it is');";
|
||||
|
||||
var tokens = this.tokenizer.getLineTokens(line, "start").tokens;
|
||||
|
||||
assert.equal(23, tokens.length);
|
||||
assert.equal("support.function", tokens[2].type); // charCodeAt
|
||||
assert.equal("support.function.dom", tokens[10].type); // getElementById
|
||||
assert.equal("support.function.firebug", tokens[18].type); // log
|
||||
},
|
||||
|
||||
"test: tokenize doc comment" : function() {
|
||||
var line = "abc /** de */ fg";
|
||||
|
||||
var tokens = this.tokenizer.getLineTokens(line, "start").tokens;
|
||||
|
||||
assert.equal(5, tokens.length);
|
||||
assert.equal("identifier", tokens[0].type);
|
||||
assert.equal("text", tokens[1].type);
|
||||
assert.equal("comment.doc", tokens[2].type);
|
||||
assert.equal("text", tokens[3].type);
|
||||
assert.equal("identifier", tokens[4].type);
|
||||
},
|
||||
|
||||
"test: tokenize doc comment with tag" : function() {
|
||||
var line = "/** @param {} */";
|
||||
|
||||
var tokens = this.tokenizer.getLineTokens(line, "start").tokens;
|
||||
|
||||
assert.equal(3, tokens.length);
|
||||
assert.equal("comment.doc", tokens[0].type);
|
||||
assert.equal("comment.doc.tag", tokens[1].type);
|
||||
assert.equal("comment.doc", tokens[2].type);
|
||||
},
|
||||
|
||||
"test: tokenize parens" : function() {
|
||||
var line = "[{( )}]";
|
||||
|
||||
var tokens = this.tokenizer.getLineTokens(line, "start").tokens;
|
||||
|
||||
assert.equal(7, tokens.length);
|
||||
assert.equal("paren.lparen", tokens[0].type);
|
||||
assert.equal("paren.lparen", tokens[1].type);
|
||||
assert.equal("paren.lparen", tokens[2].type);
|
||||
assert.equal("text", tokens[3].type);
|
||||
assert.equal("paren.rparen", tokens[4].type);
|
||||
assert.equal("paren.rparen", tokens[5].type);
|
||||
assert.equal("paren.rparen", tokens[6].type);
|
||||
},
|
||||
|
||||
"test for last rule in ruleset to catch capturing group bugs" : function() {
|
||||
var tokens = this.tokenizer.getLineTokens("}", "start").tokens;
|
||||
|
||||
assert.equal(1, tokens.length);
|
||||
assert.equal("paren.rparen", tokens[0].type);
|
||||
},
|
||||
|
||||
"test tokenize arithmetic expression which looks like a regexp": function() {
|
||||
var tokens = this.tokenizer.getLineTokens("a/b/c", "start").tokens;
|
||||
assert.equal(5, tokens.length);
|
||||
|
||||
var tokens = this.tokenizer.getLineTokens("a/=b/c", "start").tokens;
|
||||
assert.equal(5, tokens.length);
|
||||
},
|
||||
|
||||
"test tokenize reg exps" : function() {
|
||||
var tokens = this.tokenizer.getLineTokens("a=/b/g", "start").tokens;
|
||||
assert.equal(3, tokens.length);
|
||||
assert.equal("string.regexp", tokens[2].type);
|
||||
|
||||
var tokens = this.tokenizer.getLineTokens("a+/b/g", "start").tokens;
|
||||
assert.equal(3, tokens.length);
|
||||
assert.equal("string.regexp", tokens[2].type);
|
||||
|
||||
var tokens = this.tokenizer.getLineTokens("a = 1 + /2 + 1/b", "start").tokens;
|
||||
assert.equal(11, tokens.length);
|
||||
assert.equal("string.regexp", tokens[8].type);
|
||||
|
||||
var tokens = this.tokenizer.getLineTokens("a=/a/ / /a/", "start").tokens;
|
||||
assert.equal(7, tokens.length);
|
||||
assert.equal("string.regexp", tokens[2].type);
|
||||
assert.equal("string.regexp", tokens[6].type);
|
||||
|
||||
var tokens = this.tokenizer.getLineTokens("case /a/.test(c)", "start").tokens;
|
||||
assert.equal(8, tokens.length);
|
||||
assert.equal("string.regexp", tokens[2].type);
|
||||
},
|
||||
|
||||
"test tokenize multi-line comment containing a single line comment" : function() {
|
||||
var tokens = this.tokenizer.getLineTokens("/* foo // bar */", "start").tokens;
|
||||
assert.equal(1, tokens.length);
|
||||
assert.equal("comment", tokens[0].type);
|
||||
|
||||
var tokens = this.tokenizer.getLineTokens("/* foo // bar */", "regex_allowed").tokens;
|
||||
assert.equal(1, tokens.length);
|
||||
assert.equal("comment", tokens[0].type);
|
||||
},
|
||||
|
||||
"test tokenize identifier with umlauts": function() {
|
||||
var tokens = this.tokenizer.getLineTokens("füße", "start").tokens;
|
||||
assert.equal(1, tokens.length);
|
||||
},
|
||||
|
||||
"test // is not a regexp": function() {
|
||||
var tokens = this.tokenizer.getLineTokens("{ // 123", "start").tokens;
|
||||
assert.equal(3, tokens.length);
|
||||
assert.equal("paren.lparen", tokens[0].type);
|
||||
assert.equal("text", tokens[1].type);
|
||||
assert.equal("comment", tokens[2].type);
|
||||
},
|
||||
|
||||
"test skipping escaped chars": function() {
|
||||
var line = "console.log('Meh\\nNeh');"
|
||||
var tokens = this.tokenizer.getLineTokens(line, "start").tokens;
|
||||
|
||||
assert.equal(9, tokens.length);
|
||||
assert.equal("constant.language.escape", tokens[5].type);
|
||||
|
||||
line = "console.log('\\u1232Feh');";
|
||||
tokens = this.tokenizer.getLineTokens(line, "start").tokens;
|
||||
|
||||
assert.equal(9, tokens.length);
|
||||
assert.equal("constant.language.escape", tokens[5].type);
|
||||
},
|
||||
|
||||
"test multiline strings": function() {
|
||||
var line = "console.log('Meh\\"
|
||||
var data = this.tokenizer.getLineTokens(line, "start")
|
||||
|
||||
assert.equal(5, data.tokens.length);
|
||||
assert.equal(data.state, "qstring");
|
||||
|
||||
line = "console.log('Meh\\ "
|
||||
data = this.tokenizer.getLineTokens(line, "start")
|
||||
|
||||
assert.equal(6, data.tokens.length);
|
||||
assert.equal(data.state, "start");
|
||||
|
||||
line = 'console.log("\\'
|
||||
data = this.tokenizer.getLineTokens(line, "start")
|
||||
|
||||
assert.equal(5, data.tokens.length);
|
||||
assert.equal(data.state, "qqstring");
|
||||
|
||||
line = 'a="'
|
||||
data = this.tokenizer.getLineTokens(line, "start")
|
||||
|
||||
assert.equal(3, data.tokens.length);
|
||||
assert.equal(data.state, "start");
|
||||
}
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec()
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var oop = require("../lib/oop");
|
||||
var TextMode = require("./text").Mode;
|
||||
var Tokenizer = require("../tokenizer").Tokenizer;
|
||||
var JsxHighlightRules = require("./jsx_highlight_rules").JsxHighlightRules;
|
||||
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
|
||||
var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
|
||||
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
||||
|
||||
function Mode() {
|
||||
this.$tokenizer = new Tokenizer(new JsxHighlightRules().getRules());
|
||||
this.$outdent = new MatchingBraceOutdent();
|
||||
this.$behaviour = new CstyleBehaviour();
|
||||
this.foldingRules = new CStyleFoldMode();
|
||||
}
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
(function() {
|
||||
|
||||
this.getNextLineIndent = function(state, line, tab) {
|
||||
var indent = this.$getIndent(line);
|
||||
|
||||
var tokenizedLine = this.$tokenizer.getLineTokens(line, state);
|
||||
var tokens = tokenizedLine.tokens;
|
||||
|
||||
if (tokens.length && tokens[tokens.length-1].type == "comment") {
|
||||
return indent;
|
||||
}
|
||||
|
||||
if (state == "start") {
|
||||
var match = line.match(/^.*[\{\(\[]\s*$/);
|
||||
if (match) {
|
||||
indent += tab;
|
||||
}
|
||||
}
|
||||
|
||||
return indent;
|
||||
};
|
||||
|
||||
this.checkOutdent = function(state, line, input) {
|
||||
return this.$outdent.checkOutdent(line, input);
|
||||
};
|
||||
|
||||
this.autoOutdent = function(state, doc, row) {
|
||||
this.$outdent.autoOutdent(doc, row);
|
||||
};
|
||||
|
||||
}).call(Mode.prototype);
|
||||
|
||||
exports.Mode = Mode;
|
||||
});
|
||||
-122
@@ -1,122 +0,0 @@
|
||||
define(function(require, exports, module) {
|
||||
var oop = require("../lib/oop");
|
||||
var lang = require("../lib/lang");
|
||||
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
|
||||
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
||||
|
||||
var JsxHighlightRules = function() {
|
||||
var keywords = lang.arrayToMap(
|
||||
("break|do|instanceof|typeof|case|else|new|var|catch|finally|return|void|continue|for|switch|default|while|function|this|" +
|
||||
"if|throw|" +
|
||||
"delete|in|try|" +
|
||||
"class|extends|super|import|from|into|implements|interface|static|mixin|override|abstract|final|" +
|
||||
"number|int|string|boolean|variant|" +
|
||||
"log|assert").split("|")
|
||||
);
|
||||
|
||||
var buildinConstants = lang.arrayToMap(
|
||||
("null|true|false|NaN|Infinity|__FILE__|__LINE__|undefined").split("|")
|
||||
);
|
||||
|
||||
var reserved = lang.arrayToMap(
|
||||
("debugger|with|" +
|
||||
"const|export|" +
|
||||
"let|private|public|yield|protected|" +
|
||||
"extern|native|as|operator|__fake__|__readonly__").split("|")
|
||||
);
|
||||
|
||||
var identifierRe = "[a-zA-Z_][a-zA-Z0-9_]*\\b";
|
||||
|
||||
this.$rules = {
|
||||
"start" : [
|
||||
{
|
||||
token : "comment",
|
||||
regex : "\\/\\/.*$"
|
||||
},
|
||||
DocCommentHighlightRules.getStartRule("doc-start"),
|
||||
{
|
||||
token : "comment", // multi line comment
|
||||
regex : "\\/\\*",
|
||||
merge : true,
|
||||
next : "comment"
|
||||
}, {
|
||||
token : "string.regexp",
|
||||
regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
|
||||
}, {
|
||||
token : "string", // single line
|
||||
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
|
||||
}, {
|
||||
token : "string", // single line
|
||||
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
|
||||
}, {
|
||||
token : "constant.numeric", // hex
|
||||
regex : "0[xX][0-9a-fA-F]+\\b"
|
||||
}, {
|
||||
token : "constant.numeric", // float
|
||||
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
|
||||
}, {
|
||||
token : "constant.language.boolean",
|
||||
regex : "(?:true|false)\\b"
|
||||
}, {
|
||||
token : [
|
||||
"storage.type",
|
||||
"text",
|
||||
"entity.name.function"
|
||||
],
|
||||
regex : "(function)(\\s+)(" + identifierRe + ")"
|
||||
}, {
|
||||
token : function(value) {
|
||||
if (value == "this")
|
||||
return "variable.language";
|
||||
else if (value == "function")
|
||||
return "storage.type";
|
||||
else if (keywords.hasOwnProperty(value) || reserved.hasOwnProperty(value))
|
||||
return "keyword";
|
||||
else if (buildinConstants.hasOwnProperty(value))
|
||||
return "constant.language";
|
||||
else if (/^_?[A-Z][a-zA-Z0-9_]*$/.test(value))
|
||||
return "language.support.class";
|
||||
else
|
||||
return "identifier";
|
||||
},
|
||||
// TODO: Unicode escape sequences
|
||||
// TODO: Unicode identifiers
|
||||
regex : identifierRe
|
||||
}, {
|
||||
token : "keyword.operator",
|
||||
regex : "!|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|==|=|!=|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"
|
||||
}, {
|
||||
token : "punctuation.operator",
|
||||
regex : "\\?|\\:|\\,|\\;|\\."
|
||||
}, {
|
||||
token : "paren.lparen",
|
||||
regex : "[[({<]"
|
||||
}, {
|
||||
token : "paren.rparen",
|
||||
regex : "[\\])}>]"
|
||||
}, {
|
||||
token : "text",
|
||||
regex : "\\s+"
|
||||
}
|
||||
],
|
||||
"comment" : [
|
||||
{
|
||||
token : "comment", // closing comment
|
||||
regex : ".*?\\*\\/",
|
||||
next : "start"
|
||||
}, {
|
||||
token : "comment", // comment spanning whole line
|
||||
merge : true,
|
||||
regex : ".+"
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
this.embedRules(DocCommentHighlightRules, "doc-",
|
||||
[ DocCommentHighlightRules.getEndRule("start") ]);
|
||||
};
|
||||
|
||||
oop.inherits(JsxHighlightRules, TextHighlightRules);
|
||||
|
||||
exports.JsxHighlightRules = JsxHighlightRules;
|
||||
});
|
||||
@@ -1,58 +0,0 @@
|
||||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var oop = require("../lib/oop");
|
||||
var TextMode = require("./text").Mode;
|
||||
var Tokenizer = require("../tokenizer").Tokenizer;
|
||||
var LatexHighlightRules = require("./latex_highlight_rules").LatexHighlightRules;
|
||||
var LatexFoldMode = require("./folding/latex").FoldMode;
|
||||
var Range = require("../range").Range;
|
||||
|
||||
var Mode = function() {
|
||||
this.$tokenizer = new Tokenizer(new LatexHighlightRules().getRules());
|
||||
this.foldingRules = new LatexFoldMode();
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
(function() {
|
||||
this.toggleCommentLines = function(state, doc, startRow, endRow) {
|
||||
// This code is adapted from ruby.js
|
||||
var outdent = true;
|
||||
|
||||
// LaTeX comments begin with % and go to the end of the line
|
||||
var commentRegEx = /^(\s*)\%/;
|
||||
|
||||
for (var i = startRow; i <= endRow; i++) {
|
||||
if (!commentRegEx.test(doc.getLine(i))) {
|
||||
outdent = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (outdent) {
|
||||
var deleteRange = new Range(0, 0, 0, 0);
|
||||
for (var i = startRow; i <= endRow; i++) {
|
||||
var line = doc.getLine(i);
|
||||
var m = line.match(commentRegEx);
|
||||
deleteRange.start.row = i;
|
||||
deleteRange.end.row = i;
|
||||
deleteRange.end.column = m[0].length;
|
||||
doc.replace(deleteRange, m[1]);
|
||||
}
|
||||
}
|
||||
else {
|
||||
doc.indentRows(startRow, endRow, "%");
|
||||
}
|
||||
};
|
||||
|
||||
// There is no universally accepted way of indenting a tex document
|
||||
// so just maintain the indentation of the previous line
|
||||
this.getNextLineIndent = function(state, line, tab) {
|
||||
return this.$getIndent(line);
|
||||
};
|
||||
|
||||
}).call(Mode.prototype);
|
||||
|
||||
exports.Mode = Mode;
|
||||
|
||||
});
|
||||
-38
@@ -1,38 +0,0 @@
|
||||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var oop = require("../lib/oop");
|
||||
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
||||
|
||||
var LatexHighlightRules = function() {
|
||||
this.$rules = {
|
||||
"start" : [{
|
||||
// A tex command e.g. \foo
|
||||
token : "keyword",
|
||||
regex : "\\\\(?:[^a-zA-Z]|[a-zA-Z]+)"
|
||||
}, {
|
||||
// Curly and square braces
|
||||
token : "lparen",
|
||||
regex : "[[({]"
|
||||
}, {
|
||||
// Curly and square braces
|
||||
token : "rparen",
|
||||
regex : "[\\])}]"
|
||||
}, {
|
||||
// Inline math between two $ symbols
|
||||
token : "string",
|
||||
regex : "\\$(?:(?:\\\\.)|(?:[^\\$\\\\]))*?\\$"
|
||||
}, {
|
||||
// A comment. Tex comments start with % and go to
|
||||
// the end of the line
|
||||
token : "comment",
|
||||
regex : "%.*$"
|
||||
}]
|
||||
};
|
||||
};
|
||||
|
||||
oop.inherits(LatexHighlightRules, TextHighlightRules);
|
||||
|
||||
exports.LatexHighlightRules = LatexHighlightRules;
|
||||
|
||||
});
|
||||
@@ -1,109 +0,0 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Distributed under the BSD license:
|
||||
*
|
||||
* Copyright (c) 2010, Ajax.org B.V.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of Ajax.org B.V. nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
var oop = require("../lib/oop");
|
||||
var TextMode = require("./text").Mode;
|
||||
var Tokenizer = require("../tokenizer").Tokenizer;
|
||||
var LiquidHighlightRules = require("./liquid_highlight_rules").LiquidHighlightRules;
|
||||
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
|
||||
var Range = require("../range").Range;
|
||||
|
||||
var Mode = function() {
|
||||
this.$tokenizer = new Tokenizer(new LiquidHighlightRules().getRules());
|
||||
this.$outdent = new MatchingBraceOutdent();
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
(function() {
|
||||
|
||||
this.toggleCommentLines = function(state, doc, startRow, endRow) {
|
||||
var outdent = true;
|
||||
var outentedRows = [];
|
||||
var re = /^(\s*)#/;
|
||||
|
||||
for (var i=startRow; i<= endRow; i++) {
|
||||
if (!re.test(doc.getLine(i))) {
|
||||
outdent = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (outdent) {
|
||||
var deleteRange = new Range(0, 0, 0, 0);
|
||||
for (var i=startRow; i<= endRow; i++)
|
||||
{
|
||||
var line = doc.getLine(i);
|
||||
var m = line.match(re);
|
||||
deleteRange.start.row = i;
|
||||
deleteRange.end.row = i;
|
||||
deleteRange.end.column = m[0].length;
|
||||
doc.replace(deleteRange, m[1]);
|
||||
}
|
||||
}
|
||||
else {
|
||||
doc.indentRows(startRow, endRow, "#");
|
||||
}
|
||||
};
|
||||
|
||||
this.getNextLineIndent = function(state, line, tab) {
|
||||
var indent = this.$getIndent(line);
|
||||
|
||||
var tokenizedLine = this.$tokenizer.getLineTokens(line, state);
|
||||
var tokens = tokenizedLine.tokens;
|
||||
var endState = tokenizedLine.state;
|
||||
|
||||
if (tokens.length && tokens[tokens.length-1].type == "comment") {
|
||||
return indent;
|
||||
}
|
||||
|
||||
if (state == "start") {
|
||||
var match = line.match(/^.*[\{\(\[]\s*$/);
|
||||
if (match) {
|
||||
indent += tab;
|
||||
}
|
||||
}
|
||||
|
||||
return indent;
|
||||
};
|
||||
|
||||
this.checkOutdent = function(state, line, input) {
|
||||
return this.$outdent.checkOutdent(line, input);
|
||||
};
|
||||
|
||||
this.autoOutdent = function(state, doc, row) {
|
||||
this.$outdent.autoOutdent(doc, row);
|
||||
};
|
||||
|
||||
}).call(Mode.prototype);
|
||||
|
||||
exports.Mode = Mode;
|
||||
});
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user