freezerwatch 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +40 -0
- data/Rakefile +1 -0
- data/bin/console +14 -0
- data/bin/freezerwatch +9 -0
- data/bin/setup +7 -0
- data/freezerwatch.gemspec +23 -0
- data/lib/freezerwatch.rb +5 -0
- data/lib/freezerwatch/version.rb +3 -0
- data/node_modules/.bin/freezerwatch +139 -0
- data/node_modules/freezerwatch/.npmignore +3 -0
- data/node_modules/freezerwatch/.ruby-version +1 -0
- data/node_modules/freezerwatch/Gemfile +4 -0
- data/node_modules/freezerwatch/Gemfile.lock +79 -0
- data/node_modules/freezerwatch/LICENSE +23 -0
- data/node_modules/freezerwatch/README.md +41 -0
- data/node_modules/freezerwatch/Rakefile +13 -0
- data/node_modules/freezerwatch/freezerwatch.js +139 -0
- data/node_modules/freezerwatch/metrics/bigfiles_high_water_mark +1 -0
- data/node_modules/freezerwatch/metrics/cane_high_water_mark +1 -0
- data/node_modules/freezerwatch/metrics/flay_high_water_mark +1 -0
- data/node_modules/freezerwatch/metrics/flog_high_water_mark +1 -0
- data/node_modules/freezerwatch/metrics/punchlist_high_water_mark +2 -0
- data/node_modules/freezerwatch/metrics/reek_high_water_mark +1 -0
- data/node_modules/freezerwatch/metrics/rubocop_high_water_mark +1 -0
- data/node_modules/freezerwatch/node_modules/async/.jshintrc +25 -0
- data/node_modules/freezerwatch/node_modules/async/.travis.yml +6 -0
- data/node_modules/freezerwatch/node_modules/async/CHANGELOG.md +65 -0
- data/node_modules/freezerwatch/node_modules/async/LICENSE +19 -0
- data/node_modules/freezerwatch/node_modules/async/README.md +1803 -0
- data/node_modules/freezerwatch/node_modules/async/bower.json +43 -0
- data/node_modules/freezerwatch/node_modules/async/component.json +17 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/base.css +182 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/index.html +73 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/base.css +182 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/index.html +73 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/lib/async.js.html +3900 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/lib/index.html +73 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/prettify.css +1 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/prettify.js +1 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/sorter.js +156 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lcov.info +1452 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lib/async.js.html +3597 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lib/index.html +73 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/prettify.css +1 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/prettify.js +1 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/sort-arrow-sprite.png +0 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/sorter.js +156 -0
- data/node_modules/freezerwatch/node_modules/async/lib/async.js +1191 -0
- data/node_modules/freezerwatch/node_modules/async/nyc_output/5074.json +1 -0
- data/node_modules/freezerwatch/node_modules/async/package.json +96 -0
- data/node_modules/freezerwatch/node_modules/async/support/sync-package-managers.js +53 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/.npmignore +15 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/Client.js +60 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/Device.js +38 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/DeviceRawReadStream.js +36 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/DeviceSingleRawReadStream.js +29 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/DeviceStream.js +35 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/LICENSE +23 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/README.md +25 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/index.js +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/.npmignore +2 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/.travis.yml +12 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/LICENSE +55 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/README.md +364 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/index.js +156 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/lib/copy.js +8 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/lib/debug.js +7 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/lib/getSafe.js +34 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/lib/optional.js +5 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/.bin/uuid +26 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/aws-sign2/LICENSE +55 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/aws-sign2/README.md +4 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/aws-sign2/index.js +202 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/aws-sign2/package.json +46 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/forever-agent/LICENSE +55 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/forever-agent/README.md +4 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/forever-agent/index.js +119 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/forever-agent/package.json +45 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/License +19 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/Readme.md +175 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/lib/form_data.js +351 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/.travis.yml +5 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/LICENSE +19 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/README.md +1647 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/bower.json +38 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/component.json +16 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js +1123 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/package.json +84 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/support/sync-package-managers.js +53 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/License +19 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/Readme.md +132 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/lib/combined_stream.js +188 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/.npmignore +2 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/License +19 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Makefile +7 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Readme.md +154 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js +99 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/package.json +42 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/common.js +6 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js +38 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js +21 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js +14 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js +48 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js +15 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js +18 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js +13 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js +13 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/run.js +7 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json +60 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/package.json +80 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/.npmignore +18 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/.travis.yml +5 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/LICENSE +24 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/Makefile +10 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/README.md +627 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/example/usage.js +78 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/images/hawk.png +0 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/images/logo.png +0 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/index.js +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/lib/browser.js +485 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/lib/client.js +367 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/lib/crypto.js +111 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/lib/index.js +15 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/lib/server.js +524 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/lib/utils.js +183 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/.npmignore +18 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/.travis.yml +5 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/LICENSE +24 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/Makefile +11 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/README.md +6 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/images/boom.png +0 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/index.js +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js +207 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/package.json +64 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/test/index.js +245 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/.npmignore +18 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/.travis.yml +5 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/LICENSE +24 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/Makefile +11 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/README.md +6 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/index.js +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/lib/index.js +68 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json +65 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/test/index.js +101 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/.npmignore +18 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/.travis.yml +5 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/LICENSE +33 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/Makefile +10 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/README.md +436 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/images/hoek.png +0 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/index.js +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/lib/escape.js +132 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/lib/index.js +585 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/package.json +70 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/test/escaper.js +86 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/test/index.js +1078 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test1.js +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test2.js +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test3.js +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/.npmignore +18 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/.travis.yml +5 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/LICENSE +24 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/Makefile +11 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/README.md +68 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/examples/offset.js +16 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/examples/time.js +25 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/index.js +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/lib/index.js +409 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/package.json +65 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/test/index.js +359 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/package.json +70 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/browser.js +771 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/client.js +206 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/crypto.js +86 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/index.js +316 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/message.js +246 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/readme.js +98 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/server.js +686 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/uri.js +456 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/utils.js +120 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/.dir-locals.el +6 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/.npmignore +7 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/LICENSE +18 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/README.md +79 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/http_signing.md +296 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/lib/index.js +26 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/lib/parser.js +304 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/lib/signer.js +178 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/lib/util.js +304 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/lib/verify.js +42 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/.npmignore +2 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/LICENSE +19 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/README.md +50 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/errors.js +13 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/index.js +27 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/reader.js +267 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/types.js +36 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/writer.js +317 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/index.js +20 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/package.json +63 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/reader.test.js +172 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/writer.test.js +296 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/assert-plus/README.md +126 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/assert-plus/assert.js +245 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json +45 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/.npmignore +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/CHANGELOG +78 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/LICENSE +24 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/README +82 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/README.old +298 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/ctf.js +245 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/ctio.js +1485 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/ctype.js +944 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/man/man3ctype/ctio.3ctype +241 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/package.json +42 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsl.conf +129 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsstyle +839 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/package.json +72 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/.npmignore +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/CHANGELOG.md +14 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/LICENSE +15 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/Makefile +35 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/README.md +52 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/package.json +68 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/stringify.js +27 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/test/mocha.opts +2 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/test/stringify_test.js +246 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/mime/LICENSE +19 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/mime/README.md +66 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/mime/mime.js +114 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/mime/package.json +57 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/mime/test.js +84 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/mime/types/mime.types +1588 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/mime/types/node.types +77 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/.npmignore +2 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/LICENSE.md +21 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/README.md +243 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/benchmark/README.md +53 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu +174 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/benchmark/bench.sh +34 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/benchmark/benchmark-native.c +34 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/benchmark/benchmark.js +84 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/bin/uuid +26 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/bower.json +23 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/component.json +18 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/package.json +65 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/test/compare_v1.js +63 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/test/test.html +17 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/test/test.js +228 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/uuid.js +247 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/oauth-sign/LICENSE +55 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/oauth-sign/README.md +4 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/oauth-sign/index.js +43 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/oauth-sign/package.json +48 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/oauth-sign/test.js +49 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/qs/.gitmodules +6 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/qs/.npmignore +7 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/qs/Readme.md +58 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/qs/index.js +366 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/qs/package.json +55 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/.jshintrc +72 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/.npmignore +3 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/LICENSE +78 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/README.md +380 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/generate-pubsuffix.js +230 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/lib/cookie.js +947 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/lib/memstore.js +102 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/lib/pubsuffix.js +69 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/node_modules/punycode/LICENSE-MIT.txt +20 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/node_modules/punycode/README.md +176 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/node_modules/punycode/package.json +81 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/node_modules/punycode/punycode.js +530 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/package.json +63 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/public-suffix.txt +5229 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/test.js +1340 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tunnel-agent/LICENSE +55 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tunnel-agent/README.md +4 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tunnel-agent/index.js +227 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tunnel-agent/package.json +45 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/package.json +74 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/request.js +1244 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/package.json +34 -0
- data/node_modules/freezerwatch/node_modules/optparse/README.md +163 -0
- data/node_modules/freezerwatch/node_modules/optparse/TODO +1 -0
- data/node_modules/freezerwatch/node_modules/optparse/examples/browser-test.html +75 -0
- data/node_modules/freezerwatch/node_modules/optparse/examples/nodejs-test.js +86 -0
- data/node_modules/freezerwatch/node_modules/optparse/lib/optparse.js +309 -0
- data/node_modules/freezerwatch/node_modules/optparse/package.json +46 -0
- data/node_modules/freezerwatch/node_modules/optparse/seed.yml +5 -0
- data/node_modules/freezerwatch/node_modules/osenv/.npmignore +13 -0
- data/node_modules/freezerwatch/node_modules/osenv/.travis.yml +9 -0
- data/node_modules/freezerwatch/node_modules/osenv/LICENSE +15 -0
- data/node_modules/freezerwatch/node_modules/osenv/README.md +63 -0
- data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-homedir/index.js +24 -0
- data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-homedir/license +21 -0
- data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-homedir/package.json +70 -0
- data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-homedir/readme.md +33 -0
- data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-tmpdir/index.js +25 -0
- data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-tmpdir/license +21 -0
- data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-tmpdir/package.json +70 -0
- data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-tmpdir/readme.md +36 -0
- data/node_modules/freezerwatch/node_modules/osenv/osenv.js +72 -0
- data/node_modules/freezerwatch/node_modules/osenv/package.json +76 -0
- data/node_modules/freezerwatch/node_modules/osenv/test/unix.js +71 -0
- data/node_modules/freezerwatch/node_modules/osenv/test/windows.js +74 -0
- data/node_modules/freezerwatch/node_modules/osenv/x.tap +39 -0
- data/node_modules/freezerwatch/package.json +37 -0
- metadata +384 -0
@@ -0,0 +1,241 @@
|
|
1
|
+
'\" te
|
2
|
+
.\" Copyright (c) 2011, Robert Mustacchi. All Rights Reserved.
|
3
|
+
.\" Copyright (c) 2011, Joyent, Inc. All Rights Reserved.
|
4
|
+
.\"
|
5
|
+
.\" Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
.\" of this software and associated documentation files (the "Software"), to
|
7
|
+
.\" deal in the Software without restriction, including without limitation the
|
8
|
+
.\" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
9
|
+
.\" sell copies of the Software, and to permit persons to whom the Software is
|
10
|
+
.\" furnished to do so, subject to the following conditions:
|
11
|
+
.\"
|
12
|
+
.\" The above copyright notice and this permission notice shall be included in
|
13
|
+
.\" all copies or substantial portions of the Software.
|
14
|
+
.\"
|
15
|
+
.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
.\" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
.\" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
.\" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
.\" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20
|
+
.\" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
21
|
+
.\" IN THE SOFTWARE.
|
22
|
+
.TH CTIO 3CTYPE "December 12, 2011"
|
23
|
+
.SH NAME
|
24
|
+
ctio, ruint8, ruint16, ruint32, ruint64, wuint8, wuint16, wuint32, wuint64,
|
25
|
+
rsint8, rsint16, rsint32, rsint64, wsint8, wsint16, wsint32, wsint64, rfloat,
|
26
|
+
rdouble, wfloat, wdouble \- integer and float operations
|
27
|
+
.SH SYNOPSIS
|
28
|
+
.LP
|
29
|
+
.nf
|
30
|
+
var mod_ctype = require('ctype');
|
31
|
+
|
32
|
+
\fBNumber\fR \fBmod_ctype.ruint8\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
|
33
|
+
.fi
|
34
|
+
|
35
|
+
.LP
|
36
|
+
.nf
|
37
|
+
\fBNumber\fR \fBmod_ctype.ruint16\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
|
38
|
+
.fi
|
39
|
+
|
40
|
+
.LP
|
41
|
+
.nf
|
42
|
+
\fBNumber\fR \fBmod_ctype.ruint32\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
|
43
|
+
.fi
|
44
|
+
|
45
|
+
.LP
|
46
|
+
.nf
|
47
|
+
\fBNumber[2]\fR \fBmod_ctype.ruint64\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
|
48
|
+
.fi
|
49
|
+
|
50
|
+
.LP
|
51
|
+
.nf
|
52
|
+
\fBNumber\fR \fBmod_ctype.rsint8\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
|
53
|
+
.fi
|
54
|
+
|
55
|
+
.LP
|
56
|
+
.nf
|
57
|
+
\fBNumber\fR \fBmod_ctype.rsint16\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
|
58
|
+
.fi
|
59
|
+
|
60
|
+
.LP
|
61
|
+
.nf
|
62
|
+
\fBNumber\fR \fBmod_ctype.rsint32\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
|
63
|
+
.fi
|
64
|
+
|
65
|
+
.LP
|
66
|
+
.nf
|
67
|
+
\fBNumber[2]\fR \fBmod_ctype.rsint64\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
|
68
|
+
.fi
|
69
|
+
|
70
|
+
.LP
|
71
|
+
.nf
|
72
|
+
\fBNumber\fR \fBmod_ctype.rfloat\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
|
73
|
+
.fi
|
74
|
+
|
75
|
+
.LP
|
76
|
+
.nf
|
77
|
+
\fBNumber\fR \fBmod_ctype.rdouble\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
|
78
|
+
.fi
|
79
|
+
|
80
|
+
.LP
|
81
|
+
.nf
|
82
|
+
\fBvoid\fR \fBmod_ctype.wuint8\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
|
83
|
+
.fi
|
84
|
+
|
85
|
+
.LP
|
86
|
+
.nf
|
87
|
+
\fBvoid\fR \fBmod_ctype.wuint16\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
|
88
|
+
.fi
|
89
|
+
|
90
|
+
.LP
|
91
|
+
.nf
|
92
|
+
\fBvoid\fR \fBmod_ctype.wuint32\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
|
93
|
+
.fi
|
94
|
+
|
95
|
+
.LP
|
96
|
+
.nf
|
97
|
+
\fBvoid\fR \fBmod_ctype.wuint64\fR(\fBNumber[2]\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
|
98
|
+
.fi
|
99
|
+
|
100
|
+
.LP
|
101
|
+
.nf
|
102
|
+
\fBvoid\fR \fBmod_ctype.wsint8\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
|
103
|
+
.fi
|
104
|
+
|
105
|
+
.LP
|
106
|
+
.nf
|
107
|
+
\fBvoid\fR \fBmod_ctype.wsint16\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
|
108
|
+
.fi
|
109
|
+
|
110
|
+
.LP
|
111
|
+
.nf
|
112
|
+
\fBvoid\fR \fBmod_ctype.wsint32\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
|
113
|
+
.fi
|
114
|
+
|
115
|
+
.LP
|
116
|
+
.nf
|
117
|
+
\fBvoid\fR \fBmod_ctype.wsint64\fR(\fBNumber[2]\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
|
118
|
+
.fi
|
119
|
+
|
120
|
+
.LP
|
121
|
+
.nf
|
122
|
+
\fBvoid\fR \fBmod_ctype.wfloat\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
|
123
|
+
.fi
|
124
|
+
|
125
|
+
.LP
|
126
|
+
.nf
|
127
|
+
\fBvoid\fR \fBmod_ctype.wdouble\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
|
128
|
+
.fi
|
129
|
+
|
130
|
+
.SH DESCRIPTION
|
131
|
+
.sp
|
132
|
+
.LP
|
133
|
+
The argument \fIbuf\fR refers to a valid buffer (from calling new Buffer()). The
|
134
|
+
argument \fIendian\fR is either the string 'big' or 'little' and controls
|
135
|
+
whether the data in the buffer is interpreted as big or little endian. The argument
|
136
|
+
\fIoffset\fR indicates the starting index into the buffer to read or write. All
|
137
|
+
functions ensure that starting at \fIoffset\fR does not overflow the end of the
|
138
|
+
buffer. The argument \fIvalue\fR is a Number that is the valid type for the
|
139
|
+
specific function. All functions that take \fIvalue\fR as an argument, verify
|
140
|
+
that the passed value is valid.
|
141
|
+
|
142
|
+
.SS "\fBruint8()\fR, \fBruint16()\fR, \fBruint32()\fR"
|
143
|
+
.sp
|
144
|
+
.LP
|
145
|
+
The \fBruint8()\fR, \fBruint16()\fR, and \fBruint32()\fR functions read an 8,
|
146
|
+
16, and 32-bit unsigned value from \fIbuf\fR and return it. The value read is
|
147
|
+
influenced by the values of \fIoffset\fR and \fRendian\fI.
|
148
|
+
|
149
|
+
|
150
|
+
.SS "\fBrsint8()\fR, \fBrsint16()\fR, \fBrsint32()\fR"
|
151
|
+
.sp
|
152
|
+
.LP
|
153
|
+
The \fBruint8()\fR, \fBruint16()\fR, and \fBruint32()\fR functions work just as
|
154
|
+
\fBruint8()\fR, \fBruint16()\fR, and \fBruint32()\fR, except they return signed
|
155
|
+
integers.
|
156
|
+
|
157
|
+
.SS "\fBruint64()\fR, \fBrsint64()\fR"
|
158
|
+
.sp
|
159
|
+
.LP
|
160
|
+
The \fBruint64()\fR and \fBrsint64()\fR functions read unsigned and signed 64
|
161
|
+
bit integers respectively from \fBbuf\fR. Due to the limitations of ECMAScript's
|
162
|
+
\fBNumber\fR type, they cannot be stored as one value without a loss of
|
163
|
+
precision. Instead of returning the values as a single \fBNumber\fR, the
|
164
|
+
functions return an array of two numbers. The first entry always contains the
|
165
|
+
upper 32-bits and the second value contains the lower 32-bits. The lossy
|
166
|
+
transformation into a number would be \fIres[0]*Math.pow(2,32)+res[1]\fR.
|
167
|
+
Note that, unless an entry is zero, both array entries are guaranteed to have
|
168
|
+
the same sign.
|
169
|
+
|
170
|
+
.SS "\fBwuint8()\fR, \fBwuint16()\fR, \fBwuint32()\fR"
|
171
|
+
.sp
|
172
|
+
.LP
|
173
|
+
The functions \fBwuint8()\fR, \fBwuint16()\fR, and \fBwuint32()\fR modify the
|
174
|
+
contents of \fBbuf\fR by writing an 8, 16, and 32-bit unsigned integer
|
175
|
+
respectively to \fBbuf\fR. It is illegal to pass a number that is not an integer
|
176
|
+
within the domain of the integer size, for example, for \fBwuint8()\fR the valid
|
177
|
+
range is \fB[0, 255]\fR. The value will be written in either big or little
|
178
|
+
endian format based upon the value of \fBendian\fR.
|
179
|
+
|
180
|
+
|
181
|
+
.SS "\fBwsint8()\fR, \fBwsint16()\fR, \fBwsint32()\fR"
|
182
|
+
.sp
|
183
|
+
.LP
|
184
|
+
The functions \fBwsint8()\fR, \fBwsint16()\fR, and \fBwsint32()\fR function
|
185
|
+
identically to the functions \fBwuint8()\fR, \fBwuint16()\fR, and
|
186
|
+
\fBwuint32()\fR except that they the valid domain for \fBvalue\fR is that of a
|
187
|
+
signed number instead of an unsigned number. For example the \fBwsint8()\fR has
|
188
|
+
a domain of \fB[-128, 127]\fR.
|
189
|
+
|
190
|
+
.SS "\fBwuint64()\fR, \fBwsint64()\fR"
|
191
|
+
.sp
|
192
|
+
.LP
|
193
|
+
The functions \fBwuint64()\fR and \fBswint64()\fR write out 64-bit unsigned and
|
194
|
+
signed integers to \fBbuf\fR. The \fBvalue\fR argument must be in the same
|
195
|
+
format as described in \fBruint64()\fR and \fBrsint64()\fR.
|
196
|
+
|
197
|
+
.SS "\fBrfloat()\fR, \fBrdouble()\fR"
|
198
|
+
.sp
|
199
|
+
.LP
|
200
|
+
The functions "\fBrfloat()\fR and \fBrdouble()\fR" work like the other read
|
201
|
+
functions, except that they read a single precision and double precision
|
202
|
+
IEEE-754 floating point value instead.
|
203
|
+
|
204
|
+
.SS "\fBwfloat()\fR, \fBwdouble()\fR"
|
205
|
+
.sp
|
206
|
+
.LP
|
207
|
+
The functions "\fBrfloat()\fR and \fBrdouble()\fR" work like the other write
|
208
|
+
functions, except that the domain for a float is that of a single precision 4
|
209
|
+
byte value. The domain for a double is any \fBNumber\fR in ECMAScript, which is
|
210
|
+
defined to be represented by a double.
|
211
|
+
|
212
|
+
.SH ATTRIBUTES
|
213
|
+
.sp
|
214
|
+
.LP
|
215
|
+
See \fBattributes\fR(5) for descriptions of the following attributes:
|
216
|
+
.sp
|
217
|
+
|
218
|
+
.sp
|
219
|
+
.TS
|
220
|
+
box;
|
221
|
+
c | c
|
222
|
+
l | l .
|
223
|
+
ATTRIBUTE TYPE ATTRIBUTE VALUE
|
224
|
+
_
|
225
|
+
Interface Stability Committed
|
226
|
+
_
|
227
|
+
MT-Level See below.
|
228
|
+
_
|
229
|
+
Standard Not standardized.
|
230
|
+
.TE
|
231
|
+
|
232
|
+
.sp
|
233
|
+
.LP
|
234
|
+
|
235
|
+
All functions are MT-safe in so far as there aren't shared memory MT concerns in
|
236
|
+
most node programs. If one where to concoct such an environment, these functions
|
237
|
+
wouldn't be MT-safe.
|
238
|
+
|
239
|
+
.SH SEE ALSO
|
240
|
+
.sp
|
241
|
+
.LP
|
@@ -0,0 +1,42 @@
|
|
1
|
+
{
|
2
|
+
"name": "ctype",
|
3
|
+
"version": "0.5.3",
|
4
|
+
"description": "read and write binary structures and data types",
|
5
|
+
"homepage": "https://github.com/rmustacc/node-ctype",
|
6
|
+
"author": {
|
7
|
+
"name": "Robert Mustacchi",
|
8
|
+
"email": "rm@fingolfin.org"
|
9
|
+
},
|
10
|
+
"engines": {
|
11
|
+
"node": ">= 0.4"
|
12
|
+
},
|
13
|
+
"main": "ctype.js",
|
14
|
+
"repository": {
|
15
|
+
"type": "git",
|
16
|
+
"url": "git+https://github.com/rmustacc/node-ctype.git"
|
17
|
+
},
|
18
|
+
"_id": "ctype@0.5.3",
|
19
|
+
"dist": {
|
20
|
+
"shasum": "82c18c2461f74114ef16c135224ad0b9144ca12f",
|
21
|
+
"tarball": "http://registry.npmjs.org/ctype/-/ctype-0.5.3.tgz"
|
22
|
+
},
|
23
|
+
"_npmVersion": "1.1.59",
|
24
|
+
"_npmUser": {
|
25
|
+
"name": "rm",
|
26
|
+
"email": "rm@fingolfin.org"
|
27
|
+
},
|
28
|
+
"maintainers": [
|
29
|
+
{
|
30
|
+
"name": "rm",
|
31
|
+
"email": "rm@fingolfin.org"
|
32
|
+
}
|
33
|
+
],
|
34
|
+
"directories": {},
|
35
|
+
"_shasum": "82c18c2461f74114ef16c135224ad0b9144ca12f",
|
36
|
+
"_resolved": "https://registry.npmjs.org/ctype/-/ctype-0.5.3.tgz",
|
37
|
+
"_from": "ctype@0.5.3",
|
38
|
+
"bugs": {
|
39
|
+
"url": "https://github.com/rmustacc/node-ctype/issues"
|
40
|
+
},
|
41
|
+
"readme": "ERROR: No README data found!"
|
42
|
+
}
|
@@ -0,0 +1,129 @@
|
|
1
|
+
#
|
2
|
+
# Configuration File for JavaScript Lint 0.3.0
|
3
|
+
# Developed by Matthias Miller (http://www.JavaScriptLint.com)
|
4
|
+
#
|
5
|
+
# This configuration file can be used to lint a collection of scripts, or to enable
|
6
|
+
# or disable warnings for scripts that are linted via the command line.
|
7
|
+
#
|
8
|
+
|
9
|
+
### Warnings
|
10
|
+
# Enable or disable warnings based on requirements.
|
11
|
+
# Use "+WarningName" to display or "-WarningName" to suppress.
|
12
|
+
#
|
13
|
+
+no_return_value # function {0} does not always return a value
|
14
|
+
+duplicate_formal # duplicate formal argument {0}
|
15
|
+
+equal_as_assign # test for equality (==) mistyped as assignment (=)?{0}
|
16
|
+
+var_hides_arg # variable {0} hides argument
|
17
|
+
+redeclared_var # redeclaration of {0} {1}
|
18
|
+
+anon_no_return_value # anonymous function does not always return a value
|
19
|
+
+missing_semicolon # missing semicolon
|
20
|
+
+meaningless_block # meaningless block; curly braces have no impact
|
21
|
+
+comma_separated_stmts # multiple statements separated by commas (use semicolons?)
|
22
|
+
+unreachable_code # unreachable code
|
23
|
+
+missing_break # missing break statement
|
24
|
+
+missing_break_for_last_case # missing break statement for last case in switch
|
25
|
+
+comparison_type_conv # comparisons against null, 0, true, false, or an empty string allowing implicit type conversion (use === or !==)
|
26
|
+
-inc_dec_within_stmt # increment (++) and decrement (--) operators used as part of greater statement
|
27
|
+
+useless_void # use of the void type may be unnecessary (void is always undefined)
|
28
|
+
-useless_quotes # quotation marks are unnecessary
|
29
|
+
+multiple_plus_minus # unknown order of operations for successive plus (e.g. x+++y) or minus (e.g. x---y) signs
|
30
|
+
+use_of_label # use of label
|
31
|
+
-block_without_braces # block statement without curly braces
|
32
|
+
+leading_decimal_point # leading decimal point may indicate a number or an object member
|
33
|
+
+trailing_decimal_point # trailing decimal point may indicate a number or an object member
|
34
|
+
-octal_number # leading zeros make an octal number
|
35
|
+
+nested_comment # nested comment
|
36
|
+
+misplaced_regex # regular expressions should be preceded by a left parenthesis, assignment, colon, or comma
|
37
|
+
+ambiguous_newline # unexpected end of line; it is ambiguous whether these lines are part of the same statement
|
38
|
+
+empty_statement # empty statement or extra semicolon
|
39
|
+
-missing_option_explicit # the "option explicit" control comment is missing
|
40
|
+
+partial_option_explicit # the "option explicit" control comment, if used, must be in the first script tag
|
41
|
+
+dup_option_explicit # duplicate "option explicit" control comment
|
42
|
+
+useless_assign # useless assignment
|
43
|
+
+ambiguous_nested_stmt # block statements containing block statements should use curly braces to resolve ambiguity
|
44
|
+
+ambiguous_else_stmt # the else statement could be matched with one of multiple if statements (use curly braces to indicate intent)
|
45
|
+
+missing_default_case # missing default case in switch statement
|
46
|
+
+duplicate_case_in_switch # duplicate case in switch statements
|
47
|
+
+default_not_at_end # the default case is not at the end of the switch statement
|
48
|
+
+legacy_cc_not_understood # couldn't understand control comment using /*@keyword@*/ syntax
|
49
|
+
+jsl_cc_not_understood # couldn't understand control comment using /*jsl:keyword*/ syntax
|
50
|
+
+useless_comparison # useless comparison; comparing identical expressions
|
51
|
+
+with_statement # with statement hides undeclared variables; use temporary variable instead
|
52
|
+
+trailing_comma_in_array # extra comma is not recommended in array initializers
|
53
|
+
+assign_to_function_call # assignment to a function call
|
54
|
+
+parseint_missing_radix # parseInt missing radix parameter
|
55
|
+
-unreferenced_argument # argument declared but never referenced: {name}
|
56
|
+
|
57
|
+
### Output format
|
58
|
+
# Customize the format of the error message.
|
59
|
+
# __FILE__ indicates current file path
|
60
|
+
# __FILENAME__ indicates current file name
|
61
|
+
# __LINE__ indicates current line
|
62
|
+
# __ERROR__ indicates error message
|
63
|
+
#
|
64
|
+
# Visual Studio syntax (default):
|
65
|
+
+output-format __FILE__(__LINE__): __ERROR__
|
66
|
+
# Alternative syntax:
|
67
|
+
#+output-format __FILE__:__LINE__: __ERROR__
|
68
|
+
|
69
|
+
|
70
|
+
### Context
|
71
|
+
# Show the in-line position of the error.
|
72
|
+
# Use "+context" to display or "-context" to suppress.
|
73
|
+
#
|
74
|
+
+context
|
75
|
+
|
76
|
+
|
77
|
+
### Semicolons
|
78
|
+
# By default, assignments of an anonymous function to a variable or
|
79
|
+
# property (such as a function prototype) must be followed by a semicolon.
|
80
|
+
#
|
81
|
+
#+lambda_assign_requires_semicolon # deprecated setting
|
82
|
+
|
83
|
+
|
84
|
+
### Control Comments
|
85
|
+
# Both JavaScript Lint and the JScript interpreter confuse each other with the syntax for
|
86
|
+
# the /*@keyword@*/ control comments and JScript conditional comments. (The latter is
|
87
|
+
# enabled in JScript with @cc_on@). The /*jsl:keyword*/ syntax is preferred for this reason,
|
88
|
+
# although legacy control comments are enabled by default for backward compatibility.
|
89
|
+
#
|
90
|
+
+legacy_control_comments
|
91
|
+
|
92
|
+
|
93
|
+
### JScript Function Extensions
|
94
|
+
# JScript allows member functions to be defined like this:
|
95
|
+
# function MyObj() { /*constructor*/ }
|
96
|
+
# function MyObj.prototype.go() { /*member function*/ }
|
97
|
+
#
|
98
|
+
# It also allows events to be attached like this:
|
99
|
+
# function window::onload() { /*init page*/ }
|
100
|
+
#
|
101
|
+
# This is a Microsoft-only JavaScript extension. Enable this setting to allow them.
|
102
|
+
#
|
103
|
+
#-jscript_function_extensions # deprecated setting
|
104
|
+
|
105
|
+
|
106
|
+
### Defining identifiers
|
107
|
+
# By default, "option explicit" is enabled on a per-file basis.
|
108
|
+
# To enable this for all files, use "+always_use_option_explicit"
|
109
|
+
-always_use_option_explicit
|
110
|
+
|
111
|
+
# Define certain identifiers of which the lint is not aware.
|
112
|
+
# (Use this in conjunction with the "undeclared identifier" warning.)
|
113
|
+
#
|
114
|
+
# Common uses for webpages might be:
|
115
|
+
#+define window
|
116
|
+
#+define document
|
117
|
+
+define require
|
118
|
+
+define exports
|
119
|
+
+define console
|
120
|
+
+define Buffer
|
121
|
+
+define JSON
|
122
|
+
|
123
|
+
### Files
|
124
|
+
# Specify which files to lint
|
125
|
+
# Use "+recurse" to enable recursion (disabled by default).
|
126
|
+
# To add a set of files, use "+process FileName", "+process Folder\Path\*.js",
|
127
|
+
# or "+process Folder\Path\*.htm".
|
128
|
+
#
|
129
|
+
#+process jsl-test.js
|
@@ -0,0 +1,839 @@
|
|
1
|
+
#!/usr/bin/env perl
|
2
|
+
#
|
3
|
+
# CDDL HEADER START
|
4
|
+
#
|
5
|
+
# The contents of this file are subject to the terms of the
|
6
|
+
# Common Development and Distribution License (the "License").
|
7
|
+
# You may not use this file except in compliance with the License.
|
8
|
+
#
|
9
|
+
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
10
|
+
# or http://www.opensolaris.org/os/licensing.
|
11
|
+
# See the License for the specific language governing permissions
|
12
|
+
# and limitations under the License.
|
13
|
+
#
|
14
|
+
# When distributing Covered Code, include this CDDL HEADER in each
|
15
|
+
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
16
|
+
# If applicable, add the following below this CDDL HEADER, with the
|
17
|
+
# fields enclosed by brackets "[]" replaced with your own identifying
|
18
|
+
# information: Portions Copyright [yyyy] [name of copyright owner]
|
19
|
+
#
|
20
|
+
# CDDL HEADER END
|
21
|
+
#
|
22
|
+
#
|
23
|
+
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
|
24
|
+
# Use is subject to license terms.
|
25
|
+
#
|
26
|
+
# Copyright 2011 Joyent, Inc. All rights reserved.
|
27
|
+
#
|
28
|
+
# jsstyle - check for some common stylistic errors.
|
29
|
+
#
|
30
|
+
# jsstyle is a sort of "lint" for Javascript coding style. This tool is
|
31
|
+
# derived from the cstyle tool, used to check for the style used in the
|
32
|
+
# Solaris kernel, sometimes known as "Bill Joy Normal Form".
|
33
|
+
#
|
34
|
+
# There's a lot this can't check for, like proper indentation of code
|
35
|
+
# blocks. There's also a lot more this could check for.
|
36
|
+
#
|
37
|
+
# A note to the non perl literate:
|
38
|
+
#
|
39
|
+
# perl regular expressions are pretty much like egrep
|
40
|
+
# regular expressions, with the following special symbols
|
41
|
+
#
|
42
|
+
# \s any space character
|
43
|
+
# \S any non-space character
|
44
|
+
# \w any "word" character [a-zA-Z0-9_]
|
45
|
+
# \W any non-word character
|
46
|
+
# \d a digit [0-9]
|
47
|
+
# \D a non-digit
|
48
|
+
# \b word boundary (between \w and \W)
|
49
|
+
# \B non-word boundary
|
50
|
+
#
|
51
|
+
|
52
|
+
require 5.0;
|
53
|
+
use IO::File;
|
54
|
+
use Getopt::Std;
|
55
|
+
use strict;
|
56
|
+
|
57
|
+
my $usage =
|
58
|
+
"usage: jsstyle [-chvC] [-o constructs] file ...
|
59
|
+
-c check continuation indentation inside functions
|
60
|
+
-h perform heuristic checks that are sometimes wrong
|
61
|
+
-v verbose
|
62
|
+
-C don't check anything in header block comments
|
63
|
+
-o constructs
|
64
|
+
allow a comma-seperated list of optional constructs:
|
65
|
+
doxygen allow doxygen-style block comments (/** /*!)
|
66
|
+
splint allow splint-style lint comments (/*@ ... @*/)
|
67
|
+
";
|
68
|
+
|
69
|
+
my %opts;
|
70
|
+
|
71
|
+
if (!getopts("cho:vC", \%opts)) {
|
72
|
+
print $usage;
|
73
|
+
exit 2;
|
74
|
+
}
|
75
|
+
|
76
|
+
my $check_continuation = $opts{'c'};
|
77
|
+
my $heuristic = $opts{'h'};
|
78
|
+
my $verbose = $opts{'v'};
|
79
|
+
my $ignore_hdr_comment = $opts{'C'};
|
80
|
+
|
81
|
+
my $doxygen_comments = 0;
|
82
|
+
my $splint_comments = 0;
|
83
|
+
|
84
|
+
if (defined($opts{'o'})) {
|
85
|
+
for my $x (split /,/, $opts{'o'}) {
|
86
|
+
if ($x eq "doxygen") {
|
87
|
+
$doxygen_comments = 1;
|
88
|
+
} elsif ($x eq "splint") {
|
89
|
+
$splint_comments = 1;
|
90
|
+
} else {
|
91
|
+
print "jsstyle: unrecognized construct \"$x\"\n";
|
92
|
+
print $usage;
|
93
|
+
exit 2;
|
94
|
+
}
|
95
|
+
}
|
96
|
+
}
|
97
|
+
|
98
|
+
my ($filename, $line, $prev); # shared globals
|
99
|
+
|
100
|
+
my $fmt;
|
101
|
+
my $hdr_comment_start;
|
102
|
+
|
103
|
+
if ($verbose) {
|
104
|
+
$fmt = "%s: %d: %s\n%s\n";
|
105
|
+
} else {
|
106
|
+
$fmt = "%s: %d: %s\n";
|
107
|
+
}
|
108
|
+
|
109
|
+
if ($doxygen_comments) {
|
110
|
+
# doxygen comments look like "/*!" or "/**"; allow them.
|
111
|
+
$hdr_comment_start = qr/^\s*\/\*[\!\*]?$/;
|
112
|
+
} else {
|
113
|
+
$hdr_comment_start = qr/^\s*\/\*$/;
|
114
|
+
}
|
115
|
+
|
116
|
+
# Note, following must be in single quotes so that \s and \w work right.
|
117
|
+
my $lint_re = qr/\/\*(?:
|
118
|
+
jsl:\w+?|ARGSUSED[0-9]*|NOTREACHED|LINTLIBRARY|VARARGS[0-9]*|
|
119
|
+
CONSTCOND|CONSTANTCOND|CONSTANTCONDITION|EMPTY|
|
120
|
+
FALLTHRU|FALLTHROUGH|LINTED.*?|PRINTFLIKE[0-9]*|
|
121
|
+
PROTOLIB[0-9]*|SCANFLIKE[0-9]*|JSSTYLED.*?
|
122
|
+
)\*\//x;
|
123
|
+
|
124
|
+
my $splint_re = qr/\/\*@.*?@\*\//x;
|
125
|
+
|
126
|
+
my $err_stat = 0; # exit status
|
127
|
+
|
128
|
+
if ($#ARGV >= 0) {
|
129
|
+
foreach my $arg (@ARGV) {
|
130
|
+
my $fh = new IO::File $arg, "r";
|
131
|
+
if (!defined($fh)) {
|
132
|
+
printf "%s: cannot open\n", $arg;
|
133
|
+
} else {
|
134
|
+
&jsstyle($arg, $fh);
|
135
|
+
close $fh;
|
136
|
+
}
|
137
|
+
}
|
138
|
+
} else {
|
139
|
+
&jsstyle("<stdin>", *STDIN);
|
140
|
+
}
|
141
|
+
exit $err_stat;
|
142
|
+
|
143
|
+
my $no_errs = 0; # set for JSSTYLED-protected lines
|
144
|
+
|
145
|
+
sub err($) {
|
146
|
+
my ($error) = @_;
|
147
|
+
unless ($no_errs) {
|
148
|
+
printf $fmt, $filename, $., $error, $line;
|
149
|
+
$err_stat = 1;
|
150
|
+
}
|
151
|
+
}
|
152
|
+
|
153
|
+
sub err_prefix($$) {
|
154
|
+
my ($prevline, $error) = @_;
|
155
|
+
my $out = $prevline."\n".$line;
|
156
|
+
unless ($no_errs) {
|
157
|
+
printf $fmt, $filename, $., $error, $out;
|
158
|
+
$err_stat = 1;
|
159
|
+
}
|
160
|
+
}
|
161
|
+
|
162
|
+
sub err_prev($) {
|
163
|
+
my ($error) = @_;
|
164
|
+
unless ($no_errs) {
|
165
|
+
printf $fmt, $filename, $. - 1, $error, $prev;
|
166
|
+
$err_stat = 1;
|
167
|
+
}
|
168
|
+
}
|
169
|
+
|
170
|
+
sub jsstyle($$) {
|
171
|
+
|
172
|
+
my ($fn, $filehandle) = @_;
|
173
|
+
$filename = $fn; # share it globally
|
174
|
+
|
175
|
+
my $in_cpp = 0;
|
176
|
+
my $next_in_cpp = 0;
|
177
|
+
|
178
|
+
my $in_comment = 0;
|
179
|
+
my $in_header_comment = 0;
|
180
|
+
my $comment_done = 0;
|
181
|
+
my $in_function = 0;
|
182
|
+
my $in_function_header = 0;
|
183
|
+
my $in_declaration = 0;
|
184
|
+
my $note_level = 0;
|
185
|
+
my $nextok = 0;
|
186
|
+
my $nocheck = 0;
|
187
|
+
|
188
|
+
my $in_string = 0;
|
189
|
+
|
190
|
+
my ($okmsg, $comment_prefix);
|
191
|
+
|
192
|
+
$line = '';
|
193
|
+
$prev = '';
|
194
|
+
reset_indent();
|
195
|
+
|
196
|
+
line: while (<$filehandle>) {
|
197
|
+
s/\r?\n$//; # strip return and newline
|
198
|
+
|
199
|
+
# save the original line, then remove all text from within
|
200
|
+
# double or single quotes, we do not want to check such text.
|
201
|
+
|
202
|
+
$line = $_;
|
203
|
+
|
204
|
+
#
|
205
|
+
# C allows strings to be continued with a backslash at the end of
|
206
|
+
# the line. We translate that into a quoted string on the previous
|
207
|
+
# line followed by an initial quote on the next line.
|
208
|
+
#
|
209
|
+
# (we assume that no-one will use backslash-continuation with character
|
210
|
+
# constants)
|
211
|
+
#
|
212
|
+
$_ = '"' . $_ if ($in_string && !$nocheck && !$in_comment);
|
213
|
+
|
214
|
+
#
|
215
|
+
# normal strings and characters
|
216
|
+
#
|
217
|
+
s/'([^\\']|\\.)*'/\'\'/g;
|
218
|
+
s/"([^\\"]|\\.)*"/\"\"/g;
|
219
|
+
|
220
|
+
#
|
221
|
+
# detect string continuation
|
222
|
+
#
|
223
|
+
if ($nocheck || $in_comment) {
|
224
|
+
$in_string = 0;
|
225
|
+
} else {
|
226
|
+
#
|
227
|
+
# Now that all full strings are replaced with "", we check
|
228
|
+
# for unfinished strings continuing onto the next line.
|
229
|
+
#
|
230
|
+
$in_string =
|
231
|
+
(s/([^"](?:"")*)"([^\\"]|\\.)*\\$/$1""/ ||
|
232
|
+
s/^("")*"([^\\"]|\\.)*\\$/""/);
|
233
|
+
}
|
234
|
+
|
235
|
+
#
|
236
|
+
# figure out if we are in a cpp directive
|
237
|
+
#
|
238
|
+
$in_cpp = $next_in_cpp || /^\s*#/; # continued or started
|
239
|
+
$next_in_cpp = $in_cpp && /\\$/; # only if continued
|
240
|
+
|
241
|
+
# strip off trailing backslashes, which appear in long macros
|
242
|
+
s/\s*\\$//;
|
243
|
+
|
244
|
+
# an /* END JSSTYLED */ comment ends a no-check block.
|
245
|
+
if ($nocheck) {
|
246
|
+
if (/\/\* *END *JSSTYLED *\*\//) {
|
247
|
+
$nocheck = 0;
|
248
|
+
} else {
|
249
|
+
reset_indent();
|
250
|
+
next line;
|
251
|
+
}
|
252
|
+
}
|
253
|
+
|
254
|
+
# a /*JSSTYLED*/ comment indicates that the next line is ok.
|
255
|
+
if ($nextok) {
|
256
|
+
if ($okmsg) {
|
257
|
+
err($okmsg);
|
258
|
+
}
|
259
|
+
$nextok = 0;
|
260
|
+
$okmsg = 0;
|
261
|
+
if (/\/\* *JSSTYLED.*\*\//) {
|
262
|
+
/^.*\/\* *JSSTYLED *(.*) *\*\/.*$/;
|
263
|
+
$okmsg = $1;
|
264
|
+
$nextok = 1;
|
265
|
+
}
|
266
|
+
$no_errs = 1;
|
267
|
+
} elsif ($no_errs) {
|
268
|
+
$no_errs = 0;
|
269
|
+
}
|
270
|
+
|
271
|
+
# check length of line.
|
272
|
+
# first, a quick check to see if there is any chance of being too long.
|
273
|
+
if (($line =~ tr/\t/\t/) * 7 + length($line) > 80) {
|
274
|
+
# yes, there is a chance.
|
275
|
+
# replace tabs with spaces and check again.
|
276
|
+
my $eline = $line;
|
277
|
+
1 while $eline =~
|
278
|
+
s/\t+/' ' x (length($&) * 8 - length($`) % 8)/e;
|
279
|
+
if (length($eline) > 80) {
|
280
|
+
err("line > 80 characters");
|
281
|
+
}
|
282
|
+
}
|
283
|
+
|
284
|
+
# ignore NOTE(...) annotations (assumes NOTE is on lines by itself).
|
285
|
+
if ($note_level || /\b_?NOTE\s*\(/) { # if in NOTE or this is NOTE
|
286
|
+
s/[^()]//g; # eliminate all non-parens
|
287
|
+
$note_level += s/\(//g - length; # update paren nest level
|
288
|
+
next;
|
289
|
+
}
|
290
|
+
|
291
|
+
# a /* BEGIN JSSTYLED */ comment starts a no-check block.
|
292
|
+
if (/\/\* *BEGIN *JSSTYLED *\*\//) {
|
293
|
+
$nocheck = 1;
|
294
|
+
}
|
295
|
+
|
296
|
+
# a /*JSSTYLED*/ comment indicates that the next line is ok.
|
297
|
+
if (/\/\* *JSSTYLED.*\*\//) {
|
298
|
+
/^.*\/\* *JSSTYLED *(.*) *\*\/.*$/;
|
299
|
+
$okmsg = $1;
|
300
|
+
$nextok = 1;
|
301
|
+
}
|
302
|
+
if (/\/\/ *JSSTYLED/) {
|
303
|
+
/^.*\/\/ *JSSTYLED *(.*)$/;
|
304
|
+
$okmsg = $1;
|
305
|
+
$nextok = 1;
|
306
|
+
}
|
307
|
+
|
308
|
+
# universal checks; apply to everything
|
309
|
+
if (/\t +\t/) {
|
310
|
+
err("spaces between tabs");
|
311
|
+
}
|
312
|
+
if (/ \t+ /) {
|
313
|
+
err("tabs between spaces");
|
314
|
+
}
|
315
|
+
if (/\s$/) {
|
316
|
+
err("space or tab at end of line");
|
317
|
+
}
|
318
|
+
if (/[^ \t(]\/\*/ && !/\w\(\/\*.*\*\/\);/) {
|
319
|
+
err("comment preceded by non-blank");
|
320
|
+
}
|
321
|
+
|
322
|
+
# is this the beginning or ending of a function?
|
323
|
+
# (not if "struct foo\n{\n")
|
324
|
+
if (/^{$/ && $prev =~ /\)\s*(const\s*)?(\/\*.*\*\/\s*)?\\?$/) {
|
325
|
+
$in_function = 1;
|
326
|
+
$in_declaration = 1;
|
327
|
+
$in_function_header = 0;
|
328
|
+
$prev = $line;
|
329
|
+
next line;
|
330
|
+
}
|
331
|
+
if (/^}\s*(\/\*.*\*\/\s*)*$/) {
|
332
|
+
if ($prev =~ /^\s*return\s*;/) {
|
333
|
+
err_prev("unneeded return at end of function");
|
334
|
+
}
|
335
|
+
$in_function = 0;
|
336
|
+
reset_indent(); # we don't check between functions
|
337
|
+
$prev = $line;
|
338
|
+
next line;
|
339
|
+
}
|
340
|
+
if (/^\w*\($/) {
|
341
|
+
$in_function_header = 1;
|
342
|
+
}
|
343
|
+
|
344
|
+
# a blank line terminates the declarations within a function.
|
345
|
+
# XXX - but still a problem in sub-blocks.
|
346
|
+
if ($in_declaration && /^$/) {
|
347
|
+
$in_declaration = 0;
|
348
|
+
}
|
349
|
+
|
350
|
+
if ($comment_done) {
|
351
|
+
$in_comment = 0;
|
352
|
+
$in_header_comment = 0;
|
353
|
+
$comment_done = 0;
|
354
|
+
}
|
355
|
+
# does this looks like the start of a block comment?
|
356
|
+
if (/$hdr_comment_start/) {
|
357
|
+
if (!/^\t*\/\*/) {
|
358
|
+
err("block comment not indented by tabs");
|
359
|
+
}
|
360
|
+
$in_comment = 1;
|
361
|
+
/^(\s*)\//;
|
362
|
+
$comment_prefix = $1;
|
363
|
+
if ($comment_prefix eq "") {
|
364
|
+
$in_header_comment = 1;
|
365
|
+
}
|
366
|
+
$prev = $line;
|
367
|
+
next line;
|
368
|
+
}
|
369
|
+
# are we still in the block comment?
|
370
|
+
if ($in_comment) {
|
371
|
+
if (/^$comment_prefix \*\/$/) {
|
372
|
+
$comment_done = 1;
|
373
|
+
} elsif (/\*\//) {
|
374
|
+
$comment_done = 1;
|
375
|
+
err("improper block comment close")
|
376
|
+
unless ($ignore_hdr_comment && $in_header_comment);
|
377
|
+
} elsif (!/^$comment_prefix \*[ \t]/ &&
|
378
|
+
!/^$comment_prefix \*$/) {
|
379
|
+
err("improper block comment")
|
380
|
+
unless ($ignore_hdr_comment && $in_header_comment);
|
381
|
+
}
|
382
|
+
}
|
383
|
+
|
384
|
+
if ($in_header_comment && $ignore_hdr_comment) {
|
385
|
+
$prev = $line;
|
386
|
+
next line;
|
387
|
+
}
|
388
|
+
|
389
|
+
# check for errors that might occur in comments and in code.
|
390
|
+
|
391
|
+
# allow spaces to be used to draw pictures in header comments.
|
392
|
+
#if (/[^ ] / && !/".* .*"/ && !$in_header_comment) {
|
393
|
+
# err("spaces instead of tabs");
|
394
|
+
#}
|
395
|
+
#if (/^ / && !/^ \*[ \t\/]/ && !/^ \*$/ &&
|
396
|
+
# (!/^ \w/ || $in_function != 0)) {
|
397
|
+
# err("indent by spaces instead of tabs");
|
398
|
+
#}
|
399
|
+
if (/^ {2,}/ && !/^ [^ ]/) {
|
400
|
+
err("indent by spaces instead of tabs");
|
401
|
+
}
|
402
|
+
if (/^\t+ [^ \t\*]/ || /^\t+ \S/ || /^\t+ \S/) {
|
403
|
+
err("continuation line not indented by 4 spaces");
|
404
|
+
}
|
405
|
+
|
406
|
+
if (/^\s*\/\*./ && !/^\s*\/\*.*\*\// && !/$hdr_comment_start/) {
|
407
|
+
err("improper first line of block comment");
|
408
|
+
}
|
409
|
+
|
410
|
+
if ($in_comment) { # still in comment, don't do further checks
|
411
|
+
$prev = $line;
|
412
|
+
next line;
|
413
|
+
}
|
414
|
+
|
415
|
+
if ((/[^(]\/\*\S/ || /^\/\*\S/) &&
|
416
|
+
!(/$lint_re/ || ($splint_comments && /$splint_re/))) {
|
417
|
+
err("missing blank after open comment");
|
418
|
+
}
|
419
|
+
if (/\S\*\/[^)]|\S\*\/$/ &&
|
420
|
+
!(/$lint_re/ || ($splint_comments && /$splint_re/))) {
|
421
|
+
err("missing blank before close comment");
|
422
|
+
}
|
423
|
+
if (/\/\/\S/) { # C++ comments
|
424
|
+
err("missing blank after start comment");
|
425
|
+
}
|
426
|
+
# check for unterminated single line comments, but allow them when
|
427
|
+
# they are used to comment out the argument list of a function
|
428
|
+
# declaration.
|
429
|
+
if (/\S.*\/\*/ && !/\S.*\/\*.*\*\// && !/\(\/\*/) {
|
430
|
+
err("unterminated single line comment");
|
431
|
+
}
|
432
|
+
|
433
|
+
if (/^(#else|#endif|#include)(.*)$/) {
|
434
|
+
$prev = $line;
|
435
|
+
next line;
|
436
|
+
}
|
437
|
+
|
438
|
+
#
|
439
|
+
# delete any comments and check everything else. Note that
|
440
|
+
# ".*?" is a non-greedy match, so that we don't get confused by
|
441
|
+
# multiple comments on the same line.
|
442
|
+
#
|
443
|
+
s/\/\*.*?\*\///g;
|
444
|
+
s/\/\/.*$//; # C++ comments
|
445
|
+
|
446
|
+
# delete any trailing whitespace; we have already checked for that.
|
447
|
+
s/\s*$//;
|
448
|
+
|
449
|
+
# following checks do not apply to text in comments.
|
450
|
+
if (/"/) {
|
451
|
+
err("literal string using double-quote instead of single");
|
452
|
+
}
|
453
|
+
|
454
|
+
if (/[^=!<>\s][!<>=]=/ || /[^<>!=][!<>=]==?[^\s,=]/ ||
|
455
|
+
(/[^->]>[^,=>\s]/ && !/[^->]>$/) ||
|
456
|
+
(/[^<]<[^,=<\s]/ && !/[^<]<$/) ||
|
457
|
+
/[^<\s]<[^<]/ || /[^->\s]>[^>]/) {
|
458
|
+
err("missing space around relational operator");
|
459
|
+
}
|
460
|
+
if (/\S>>=/ || /\S<<=/ || />>=\S/ || /<<=\S/ || /\S[-+*\/&|^%]=/ ||
|
461
|
+
(/[^-+*\/&|^%!<>=\s]=[^=]/ && !/[^-+*\/&|^%!<>=\s]=$/) ||
|
462
|
+
(/[^!<>=]=[^=\s]/ && !/[^!<>=]=$/)) {
|
463
|
+
# XXX - should only check this for C++ code
|
464
|
+
# XXX - there are probably other forms that should be allowed
|
465
|
+
if (!/\soperator=/) {
|
466
|
+
err("missing space around assignment operator");
|
467
|
+
}
|
468
|
+
}
|
469
|
+
if (/[,;]\S/ && !/\bfor \(;;\)/) {
|
470
|
+
err("comma or semicolon followed by non-blank");
|
471
|
+
}
|
472
|
+
# allow "for" statements to have empty "while" clauses
|
473
|
+
if (/\s[,;]/ && !/^[\t]+;$/ && !/^\s*for \([^;]*; ;[^;]*\)/) {
|
474
|
+
err("comma or semicolon preceded by blank");
|
475
|
+
}
|
476
|
+
if (/^\s*(&&|\|\|)/) {
|
477
|
+
err("improper boolean continuation");
|
478
|
+
}
|
479
|
+
if (/\S *(&&|\|\|)/ || /(&&|\|\|) *\S/) {
|
480
|
+
err("more than one space around boolean operator");
|
481
|
+
}
|
482
|
+
if (/\b(delete|typeof|instanceOf|throw|with|catch|new|function|in|for|if|while|switch|return|case)\(/) {
|
483
|
+
err("missing space between keyword and paren");
|
484
|
+
}
|
485
|
+
if (/(\b(catch|for|if|with|while|switch|return)\b.*){2,}/) {
|
486
|
+
# multiple "case" and "sizeof" allowed
|
487
|
+
err("more than one keyword on line");
|
488
|
+
}
|
489
|
+
if (/\b(delete|typeof|instanceOf|with|throw|catch|new|function|in|for|if|while|switch|return|case)\s\s+\(/ &&
|
490
|
+
!/^#if\s+\(/) {
|
491
|
+
err("extra space between keyword and paren");
|
492
|
+
}
|
493
|
+
# try to detect "func (x)" but not "if (x)" or
|
494
|
+
# "#define foo (x)" or "int (*func)();"
|
495
|
+
if (/\w\s\(/) {
|
496
|
+
my $s = $_;
|
497
|
+
# strip off all keywords on the line
|
498
|
+
s/\b(delete|typeof|instanceOf|throw|with|catch|new|function|in|for|if|while|switch|return|case)\s\(/XXX(/g;
|
499
|
+
s/#elif\s\(/XXX(/g;
|
500
|
+
s/^#define\s+\w+\s+\(/XXX(/;
|
501
|
+
# do not match things like "void (*f)();"
|
502
|
+
# or "typedef void (func_t)();"
|
503
|
+
s/\w\s\(+\*/XXX(*/g;
|
504
|
+
s/\b(void)\s+\(+/XXX(/og;
|
505
|
+
if (/\w\s\(/) {
|
506
|
+
err("extra space between function name and left paren");
|
507
|
+
}
|
508
|
+
$_ = $s;
|
509
|
+
}
|
510
|
+
|
511
|
+
if (/^\s*return\W[^;]*;/ && !/^\s*return\s*\(.*\);/) {
|
512
|
+
err("unparenthesized return expression");
|
513
|
+
}
|
514
|
+
if (/\btypeof\b/ && !/\btypeof\s*\(.*\)/) {
|
515
|
+
err("unparenthesized typeof expression");
|
516
|
+
}
|
517
|
+
if (/\(\s/) {
|
518
|
+
err("whitespace after left paren");
|
519
|
+
}
|
520
|
+
# allow "for" statements to have empty "continue" clauses
|
521
|
+
if (/\s\)/ && !/^\s*for \([^;]*;[^;]*; \)/) {
|
522
|
+
err("whitespace before right paren");
|
523
|
+
}
|
524
|
+
if (/^\s*\(void\)[^ ]/) {
|
525
|
+
err("missing space after (void) cast");
|
526
|
+
}
|
527
|
+
if (/\S{/ && !/({|\(){/) {
|
528
|
+
err("missing space before left brace");
|
529
|
+
}
|
530
|
+
if ($in_function && /^\s+{/ &&
|
531
|
+
($prev =~ /\)\s*$/ || $prev =~ /\bstruct\s+\w+$/)) {
|
532
|
+
err("left brace starting a line");
|
533
|
+
}
|
534
|
+
if (/}(else|while)/) {
|
535
|
+
err("missing space after right brace");
|
536
|
+
}
|
537
|
+
if (/}\s\s+(else|while)/) {
|
538
|
+
err("extra space after right brace");
|
539
|
+
}
|
540
|
+
if (/^\s+#/) {
|
541
|
+
err("preprocessor statement not in column 1");
|
542
|
+
}
|
543
|
+
if (/^#\s/) {
|
544
|
+
err("blank after preprocessor #");
|
545
|
+
}
|
546
|
+
|
547
|
+
#
|
548
|
+
# We completely ignore, for purposes of indentation:
|
549
|
+
# * lines outside of functions
|
550
|
+
# * preprocessor lines
|
551
|
+
#
|
552
|
+
if ($check_continuation && $in_function && !$in_cpp) {
|
553
|
+
process_indent($_);
|
554
|
+
}
|
555
|
+
|
556
|
+
if ($heuristic) {
|
557
|
+
# cannot check this everywhere due to "struct {\n...\n} foo;"
|
558
|
+
if ($in_function && !$in_declaration &&
|
559
|
+
/}./ && !/}\s+=/ && !/{.*}[;,]$/ && !/}(\s|)*$/ &&
|
560
|
+
!/} (else|while)/ && !/}}/) {
|
561
|
+
err("possible bad text following right brace");
|
562
|
+
}
|
563
|
+
# cannot check this because sub-blocks in
|
564
|
+
# the middle of code are ok
|
565
|
+
if ($in_function && /^\s+{/) {
|
566
|
+
err("possible left brace starting a line");
|
567
|
+
}
|
568
|
+
}
|
569
|
+
if (/^\s*else\W/) {
|
570
|
+
if ($prev =~ /^\s*}$/) {
|
571
|
+
err_prefix($prev,
|
572
|
+
"else and right brace should be on same line");
|
573
|
+
}
|
574
|
+
}
|
575
|
+
$prev = $line;
|
576
|
+
}
|
577
|
+
|
578
|
+
if ($prev eq "") {
|
579
|
+
err("last line in file is blank");
|
580
|
+
}
|
581
|
+
|
582
|
+
}
|
583
|
+
|
584
|
+
#
|
585
|
+
# Continuation-line checking
|
586
|
+
#
|
587
|
+
# The rest of this file contains the code for the continuation checking
|
588
|
+
# engine. It's a pretty simple state machine which tracks the expression
|
589
|
+
# depth (unmatched '('s and '['s).
|
590
|
+
#
|
591
|
+
# Keep in mind that the argument to process_indent() has already been heavily
|
592
|
+
# processed; all comments have been replaced by control-A, and the contents of
|
593
|
+
# strings and character constants have been elided.
|
594
|
+
#
|
595
|
+
|
596
|
+
my $cont_in; # currently inside of a continuation
|
597
|
+
my $cont_off; # skipping an initializer or definition
|
598
|
+
my $cont_noerr; # suppress cascading errors
|
599
|
+
my $cont_start; # the line being continued
|
600
|
+
my $cont_base; # the base indentation
|
601
|
+
my $cont_first; # this is the first line of a statement
|
602
|
+
my $cont_multiseg; # this continuation has multiple segments
|
603
|
+
|
604
|
+
my $cont_special; # this is a C statement (if, for, etc.)
|
605
|
+
my $cont_macro; # this is a macro
|
606
|
+
my $cont_case; # this is a multi-line case
|
607
|
+
|
608
|
+
my @cont_paren; # the stack of unmatched ( and [s we've seen
|
609
|
+
|
610
|
+
sub
|
611
|
+
reset_indent()
|
612
|
+
{
|
613
|
+
$cont_in = 0;
|
614
|
+
$cont_off = 0;
|
615
|
+
}
|
616
|
+
|
617
|
+
sub
|
618
|
+
delabel($)
|
619
|
+
{
|
620
|
+
#
|
621
|
+
# replace labels with tabs. Note that there may be multiple
|
622
|
+
# labels on a line.
|
623
|
+
#
|
624
|
+
local $_ = $_[0];
|
625
|
+
|
626
|
+
while (/^(\t*)( *(?:(?:\w+\s*)|(?:case\b[^:]*)): *)(.*)$/) {
|
627
|
+
my ($pre_tabs, $label, $rest) = ($1, $2, $3);
|
628
|
+
$_ = $pre_tabs;
|
629
|
+
while ($label =~ s/^([^\t]*)(\t+)//) {
|
630
|
+
$_ .= "\t" x (length($2) + length($1) / 8);
|
631
|
+
}
|
632
|
+
$_ .= ("\t" x (length($label) / 8)).$rest;
|
633
|
+
}
|
634
|
+
|
635
|
+
return ($_);
|
636
|
+
}
|
637
|
+
|
638
|
+
sub
|
639
|
+
process_indent($)
|
640
|
+
{
|
641
|
+
require strict;
|
642
|
+
local $_ = $_[0]; # preserve the global $_
|
643
|
+
|
644
|
+
s///g; # No comments
|
645
|
+
s/\s+$//; # Strip trailing whitespace
|
646
|
+
|
647
|
+
return if (/^$/); # skip empty lines
|
648
|
+
|
649
|
+
# regexps used below; keywords taking (), macros, and continued cases
|
650
|
+
my $special = '(?:(?:\}\s*)?else\s+)?(?:if|for|while|switch)\b';
|
651
|
+
my $macro = '[A-Z_][A-Z_0-9]*\(';
|
652
|
+
my $case = 'case\b[^:]*$';
|
653
|
+
|
654
|
+
# skip over enumerations, array definitions, initializers, etc.
|
655
|
+
if ($cont_off <= 0 && !/^\s*$special/ &&
|
656
|
+
(/(?:(?:\b(?:enum|struct|union)\s*[^\{]*)|(?:\s+=\s*)){/ ||
|
657
|
+
(/^\s*{/ && $prev =~ /=\s*(?:\/\*.*\*\/\s*)*$/))) {
|
658
|
+
$cont_in = 0;
|
659
|
+
$cont_off = tr/{/{/ - tr/}/}/;
|
660
|
+
return;
|
661
|
+
}
|
662
|
+
if ($cont_off) {
|
663
|
+
$cont_off += tr/{/{/ - tr/}/}/;
|
664
|
+
return;
|
665
|
+
}
|
666
|
+
|
667
|
+
if (!$cont_in) {
|
668
|
+
$cont_start = $line;
|
669
|
+
|
670
|
+
if (/^\t* /) {
|
671
|
+
err("non-continuation indented 4 spaces");
|
672
|
+
$cont_noerr = 1; # stop reporting
|
673
|
+
}
|
674
|
+
$_ = delabel($_); # replace labels with tabs
|
675
|
+
|
676
|
+
# check if the statement is complete
|
677
|
+
return if (/^\s*\}?$/);
|
678
|
+
return if (/^\s*\}?\s*else\s*\{?$/);
|
679
|
+
return if (/^\s*do\s*\{?$/);
|
680
|
+
return if (/{$/);
|
681
|
+
return if (/}[,;]?$/);
|
682
|
+
|
683
|
+
# Allow macros on their own lines
|
684
|
+
return if (/^\s*[A-Z_][A-Z_0-9]*$/);
|
685
|
+
|
686
|
+
# cases we don't deal with, generally non-kosher
|
687
|
+
if (/{/) {
|
688
|
+
err("stuff after {");
|
689
|
+
return;
|
690
|
+
}
|
691
|
+
|
692
|
+
# Get the base line, and set up the state machine
|
693
|
+
/^(\t*)/;
|
694
|
+
$cont_base = $1;
|
695
|
+
$cont_in = 1;
|
696
|
+
@cont_paren = ();
|
697
|
+
$cont_first = 1;
|
698
|
+
$cont_multiseg = 0;
|
699
|
+
|
700
|
+
# certain things need special processing
|
701
|
+
$cont_special = /^\s*$special/? 1 : 0;
|
702
|
+
$cont_macro = /^\s*$macro/? 1 : 0;
|
703
|
+
$cont_case = /^\s*$case/? 1 : 0;
|
704
|
+
} else {
|
705
|
+
$cont_first = 0;
|
706
|
+
|
707
|
+
# Strings may be pulled back to an earlier (half-)tabstop
|
708
|
+
unless ($cont_noerr || /^$cont_base / ||
|
709
|
+
(/^\t*(?: )?(?:gettext\()?\"/ && !/^$cont_base\t/)) {
|
710
|
+
err_prefix($cont_start,
|
711
|
+
"continuation should be indented 4 spaces");
|
712
|
+
}
|
713
|
+
}
|
714
|
+
|
715
|
+
my $rest = $_; # keeps the remainder of the line
|
716
|
+
|
717
|
+
#
|
718
|
+
# The split matches 0 characters, so that each 'special' character
|
719
|
+
# is processed separately. Parens and brackets are pushed and
|
720
|
+
# popped off the @cont_paren stack. For normal processing, we wait
|
721
|
+
# until a ; or { terminates the statement. "special" processing
|
722
|
+
# (if/for/while/switch) is allowed to stop when the stack empties,
|
723
|
+
# as is macro processing. Case statements are terminated with a :
|
724
|
+
# and an empty paren stack.
|
725
|
+
#
|
726
|
+
foreach $_ (split /[^\(\)\[\]\{\}\;\:]*/) {
|
727
|
+
next if (length($_) == 0);
|
728
|
+
|
729
|
+
# rest contains the remainder of the line
|
730
|
+
my $rxp = "[^\Q$_\E]*\Q$_\E";
|
731
|
+
$rest =~ s/^$rxp//;
|
732
|
+
|
733
|
+
if (/\(/ || /\[/) {
|
734
|
+
push @cont_paren, $_;
|
735
|
+
} elsif (/\)/ || /\]/) {
|
736
|
+
my $cur = $_;
|
737
|
+
tr/\)\]/\(\[/;
|
738
|
+
|
739
|
+
my $old = (pop @cont_paren);
|
740
|
+
if (!defined($old)) {
|
741
|
+
err("unexpected '$cur'");
|
742
|
+
$cont_in = 0;
|
743
|
+
last;
|
744
|
+
} elsif ($old ne $_) {
|
745
|
+
err("'$cur' mismatched with '$old'");
|
746
|
+
$cont_in = 0;
|
747
|
+
last;
|
748
|
+
}
|
749
|
+
|
750
|
+
#
|
751
|
+
# If the stack is now empty, do special processing
|
752
|
+
# for if/for/while/switch and macro statements.
|
753
|
+
#
|
754
|
+
next if (@cont_paren != 0);
|
755
|
+
if ($cont_special) {
|
756
|
+
if ($rest =~ /^\s*{?$/) {
|
757
|
+
$cont_in = 0;
|
758
|
+
last;
|
759
|
+
}
|
760
|
+
if ($rest =~ /^\s*;$/) {
|
761
|
+
err("empty if/for/while body ".
|
762
|
+
"not on its own line");
|
763
|
+
$cont_in = 0;
|
764
|
+
last;
|
765
|
+
}
|
766
|
+
if (!$cont_first && $cont_multiseg == 1) {
|
767
|
+
err_prefix($cont_start,
|
768
|
+
"multiple statements continued ".
|
769
|
+
"over multiple lines");
|
770
|
+
$cont_multiseg = 2;
|
771
|
+
} elsif ($cont_multiseg == 0) {
|
772
|
+
$cont_multiseg = 1;
|
773
|
+
}
|
774
|
+
# We've finished this section, start
|
775
|
+
# processing the next.
|
776
|
+
goto section_ended;
|
777
|
+
}
|
778
|
+
if ($cont_macro) {
|
779
|
+
if ($rest =~ /^$/) {
|
780
|
+
$cont_in = 0;
|
781
|
+
last;
|
782
|
+
}
|
783
|
+
}
|
784
|
+
} elsif (/\;/) {
|
785
|
+
if ($cont_case) {
|
786
|
+
err("unexpected ;");
|
787
|
+
} elsif (!$cont_special) {
|
788
|
+
err("unexpected ;") if (@cont_paren != 0);
|
789
|
+
if (!$cont_first && $cont_multiseg == 1) {
|
790
|
+
err_prefix($cont_start,
|
791
|
+
"multiple statements continued ".
|
792
|
+
"over multiple lines");
|
793
|
+
$cont_multiseg = 2;
|
794
|
+
} elsif ($cont_multiseg == 0) {
|
795
|
+
$cont_multiseg = 1;
|
796
|
+
}
|
797
|
+
if ($rest =~ /^$/) {
|
798
|
+
$cont_in = 0;
|
799
|
+
last;
|
800
|
+
}
|
801
|
+
if ($rest =~ /^\s*special/) {
|
802
|
+
err("if/for/while/switch not started ".
|
803
|
+
"on its own line");
|
804
|
+
}
|
805
|
+
goto section_ended;
|
806
|
+
}
|
807
|
+
} elsif (/\{/) {
|
808
|
+
err("{ while in parens/brackets") if (@cont_paren != 0);
|
809
|
+
err("stuff after {") if ($rest =~ /[^\s}]/);
|
810
|
+
$cont_in = 0;
|
811
|
+
last;
|
812
|
+
} elsif (/\}/) {
|
813
|
+
err("} while in parens/brackets") if (@cont_paren != 0);
|
814
|
+
if (!$cont_special && $rest !~ /^\s*(while|else)\b/) {
|
815
|
+
if ($rest =~ /^$/) {
|
816
|
+
err("unexpected }");
|
817
|
+
} else {
|
818
|
+
err("stuff after }");
|
819
|
+
}
|
820
|
+
$cont_in = 0;
|
821
|
+
last;
|
822
|
+
}
|
823
|
+
} elsif (/\:/ && $cont_case && @cont_paren == 0) {
|
824
|
+
err("stuff after multi-line case") if ($rest !~ /$^/);
|
825
|
+
$cont_in = 0;
|
826
|
+
last;
|
827
|
+
}
|
828
|
+
next;
|
829
|
+
section_ended:
|
830
|
+
# End of a statement or if/while/for loop. Reset
|
831
|
+
# cont_special and cont_macro based on the rest of the
|
832
|
+
# line.
|
833
|
+
$cont_special = ($rest =~ /^\s*$special/)? 1 : 0;
|
834
|
+
$cont_macro = ($rest =~ /^\s*$macro/)? 1 : 0;
|
835
|
+
$cont_case = 0;
|
836
|
+
next;
|
837
|
+
}
|
838
|
+
$cont_noerr = 0 if (!$cont_in);
|
839
|
+
}
|