aboutsummaryrefslogtreecommitdiffstats
path: root/test/indent/ruby.rb (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Rename all test files to reflect source layout.Phillip Lord2015-11-241-414/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * CONTRIBUTE,Makefile.in,configure.ac: Update to reflect test directory moves. * test/file-organisation.org: New file. * test/automated/Makefile.in test/automated/data/decompress/foo.gz test/automated/data/epg/pubkey.asc test/automated/data/epg/seckey.asc test/automated/data/files-bug18141.el.gz test/automated/data/flymake/test.c test/automated/data/flymake/test.pl test/automated/data/package/archive-contents test/automated/data/package/key.pub test/automated/data/package/key.sec test/automated/data/package/multi-file-0.2.3.tar test/automated/data/package/multi-file-readme.txt test/automated/data/package/newer-versions/archive-contents test/automated/data/package/newer-versions/new-pkg-1.0.el test/automated/data/package/newer-versions/simple-single-1.4.el test/automated/data/package/package-test-server.py test/automated/data/package/signed/archive-contents test/automated/data/package/signed/archive-contents.sig test/automated/data/package/signed/signed-bad-1.0.el test/automated/data/package/signed/signed-bad-1.0.el.sig test/automated/data/package/signed/signed-good-1.0.el test/automated/data/package/signed/signed-good-1.0.el.sig test/automated/data/package/simple-depend-1.0.el test/automated/data/package/simple-single-1.3.el test/automated/data/package/simple-single-readme.txt test/automated/data/package/simple-two-depend-1.1.el test/automated/abbrev-tests.el test/automated/auto-revert-tests.el test/automated/calc-tests.el test/automated/icalendar-tests.el test/automated/character-fold-tests.el test/automated/comint-testsuite.el test/automated/descr-text-test.el test/automated/electric-tests.el test/automated/cl-generic-tests.el test/automated/cl-lib-tests.el test/automated/eieio-test-methodinvoke.el test/automated/eieio-test-persist.el test/automated/eieio-tests.el test/automated/ert-tests.el test/automated/ert-x-tests.el test/automated/generator-tests.el test/automated/let-alist.el test/automated/map-tests.el test/automated/advice-tests.el test/automated/package-test.el test/automated/pcase-tests.el test/automated/regexp-tests.el test/automated/seq-tests.el test/automated/subr-x-tests.el test/automated/tabulated-list-test.el test/automated/thunk-tests.el test/automated/timer-tests.el test/automated/epg-tests.el test/automated/eshell.el test/automated/faces-tests.el test/automated/file-notify-tests.el test/automated/auth-source-tests.el test/automated/gnus-tests.el test/automated/message-mode-tests.el test/automated/help-fns.el test/automated/imenu-test.el test/automated/info-xref.el test/automated/mule-util.el test/automated/isearch-tests.el test/automated/json-tests.el test/automated/bytecomp-tests.el test/automated/coding-tests.el test/automated/core-elisp-tests.el test/automated/decoder-tests.el test/automated/files.el test/automated/font-parse-tests.el test/automated/lexbind-tests.el test/automated/occur-tests.el test/automated/process-tests.el test/automated/syntax-tests.el test/automated/textprop-tests.el test/automated/undo-tests.el test/automated/man-tests.el test/automated/completion-tests.el test/automated/dbus-tests.el test/automated/newsticker-tests.el test/automated/sasl-scram-rfc-tests.el test/automated/tramp-tests.el test/automated/obarray-tests.el test/automated/compile-tests.el test/automated/elisp-mode-tests.el test/automated/f90.el test/automated/flymake-tests.el test/automated/python-tests.el test/automated/ruby-mode-tests.el test/automated/subword-tests.el test/automated/replace-tests.el test/automated/simple-test.el test/automated/sort-tests.el test/automated/subr-tests.el test/automated/reftex-tests.el test/automated/sgml-mode-tests.el test/automated/tildify-tests.el test/automated/thingatpt.el test/automated/url-future-tests.el test/automated/url-util-tests.el test/automated/add-log-tests.el test/automated/vc-bzr.el test/automated/vc-tests.el test/automated/xml-parse-tests.el test/BidiCharacterTest.txt test/biditest.el test/cedet/cedet-utests.el test/cedet/ede-tests.el test/cedet/semantic-ia-utest.el test/cedet/semantic-tests.el test/cedet/semantic-utest-c.el test/cedet/semantic-utest.el test/cedet/srecode-tests.el test/cedet/tests/test.c test/cedet/tests/test.el test/cedet/tests/test.make test/cedet/tests/testdoublens.cpp test/cedet/tests/testdoublens.hpp test/cedet/tests/testfriends.cpp test/cedet/tests/testjavacomp.java test/cedet/tests/testnsp.cpp test/cedet/tests/testpolymorph.cpp test/cedet/tests/testspp.c test/cedet/tests/testsppcomplete.c test/cedet/tests/testsppreplace.c test/cedet/tests/testsppreplaced.c test/cedet/tests/testsubclass.cpp test/cedet/tests/testsubclass.hh test/cedet/tests/testtypedefs.cpp test/cedet/tests/testvarnames.c test/etags/CTAGS.good test/etags/ETAGS.good_1 test/etags/ETAGS.good_2 test/etags/ETAGS.good_3 test/etags/ETAGS.good_4 test/etags/ETAGS.good_5 test/etags/ETAGS.good_6 test/etags/a-src/empty.zz test/etags/a-src/empty.zz.gz test/etags/ada-src/2ataspri.adb test/etags/ada-src/2ataspri.ads test/etags/ada-src/etags-test-for.ada test/etags/ada-src/waroquiers.ada test/etags/c-src/a/b/b.c test/etags/c-src/abbrev.c test/etags/c-src/c.c test/etags/c-src/dostorture.c test/etags/c-src/emacs/src/gmalloc.c test/etags/c-src/emacs/src/keyboard.c test/etags/c-src/emacs/src/lisp.h test/etags/c-src/emacs/src/regex.h test/etags/c-src/etags.c test/etags/c-src/exit.c test/etags/c-src/exit.strange_suffix test/etags/c-src/fail.c test/etags/c-src/getopt.h test/etags/c-src/h.h test/etags/c-src/machsyscalls.c test/etags/c-src/machsyscalls.h test/etags/c-src/sysdep.h test/etags/c-src/tab.c test/etags/c-src/torture.c test/etags/cp-src/MDiagArray2.h test/etags/cp-src/Range.h test/etags/cp-src/burton.cpp test/etags/cp-src/c.C test/etags/cp-src/clheir.cpp.gz test/etags/cp-src/clheir.hpp test/etags/cp-src/conway.cpp test/etags/cp-src/conway.hpp test/etags/cp-src/fail.C test/etags/cp-src/functions.cpp test/etags/cp-src/screen.cpp test/etags/cp-src/screen.hpp test/etags/cp-src/x.cc test/etags/el-src/TAGTEST.EL test/etags/el-src/emacs/lisp/progmodes/etags.el test/etags/erl-src/gs_dialog.erl test/etags/f-src/entry.for test/etags/f-src/entry.strange.gz test/etags/f-src/entry.strange_suffix test/etags/forth-src/test-forth.fth test/etags/html-src/algrthms.html test/etags/html-src/index.shtml test/etags/html-src/software.html test/etags/html-src/softwarelibero.html test/etags/lua-src/allegro.lua test/etags/objc-src/PackInsp.h test/etags/objc-src/PackInsp.m test/etags/objc-src/Subprocess.h test/etags/objc-src/Subprocess.m test/etags/objcpp-src/SimpleCalc.H test/etags/objcpp-src/SimpleCalc.M test/etags/pas-src/common.pas test/etags/perl-src/htlmify-cystic test/etags/perl-src/kai-test.pl test/etags/perl-src/yagrip.pl test/etags/php-src/lce_functions.php test/etags/php-src/ptest.php test/etags/php-src/sendmail.php test/etags/prol-src/natded.prolog test/etags/prol-src/ordsets.prolog test/etags/ps-src/rfc1245.ps test/etags/pyt-src/server.py test/etags/tex-src/gzip.texi test/etags/tex-src/nonewline.tex test/etags/tex-src/testenv.tex test/etags/tex-src/texinfo.tex test/etags/y-src/atest.y test/etags/y-src/cccp.c test/etags/y-src/cccp.y test/etags/y-src/parse.c test/etags/y-src/parse.y test/indent/css-mode.css test/indent/js-indent-init-dynamic.js test/indent/js-indent-init-t.js test/indent/js-jsx.js test/indent/js.js test/indent/latex-mode.tex test/indent/modula2.mod test/indent/nxml.xml test/indent/octave.m test/indent/pascal.pas test/indent/perl.perl test/indent/prolog.prolog test/indent/ps-mode.ps test/indent/ruby.rb test/indent/scheme.scm test/indent/scss-mode.scss test/indent/sgml-mode-attribute.html test/indent/shell.rc test/indent/shell.sh test/redisplay-testsuite.el test/rmailmm.el test/automated/buffer-tests.el test/automated/cmds-tests.el test/automated/data-tests.el test/automated/finalizer-tests.el test/automated/fns-tests.el test/automated/inotify-test.el test/automated/keymap-tests.el test/automated/print-tests.el test/automated/libxml-tests.el test/automated/zlib-tests.el: Files Moved.
* Add an indent test example for bug#20026Dmitry Gutov2015-03-081-0/+4
| | | | * test/indent/ruby.rb: Add an example for bug#20026.
* * test/indent/ps-mode.ps: New file.Stefan Monnier2014-05-271-0/+4
| | | | | | | * test/automated/core-elisp-tests.el (core-elisp-test-window-configurations): New test. * test/indent/octave.m: Add a few more tests. * test/indent/ruby.rb: Add one more test.
* * lisp/emacs-lisp/nadvice.el: Support adding a given function multiple times.Stefan Monnier2014-05-101-0/+3
| | | | | | | | | (advice--member-p): If name is given, only compare the name. (advice--remove-function): Don't stop at the first match. (advice--normalize-place): New function. (add-function, remove-function): Use it. (advice--add-function): Pass the name, if any, to advice--remove-function.
* Fix bug#17097Dmitry Gutov2014-03-271-0/+5
| | | | | | * lisp/progmodes/ruby-mode.el (ruby-syntax-propertize-function): Don't propertize `?' or `!' as symbol constituent when after colon.
* Fix bug#17050Dmitry Gutov2014-03-211-0/+17
| | | | | * lisp/progmodes/ruby-mode.el (ruby-smie-rules): Add indentation rule for ` @ '.
* * lisp/progmodes/ruby-mode.el (ruby-font-lock-keywords): HighlightDmitry Gutov2014-03-021-0/+4
| | | | | | regexp options. Fixes: debbugs:16914
* Spelling fix.Paul Eggert2014-02-251-1/+1
|
* * lisp/progmodes/ruby-mode.el (ruby-smie-rules): Handle theDmitry Gutov2014-02-231-0/+7
| | | | | | | inconsistent second element of the list returned by `smie-indent--parent'. (ruby-font-lock-keywords): Disqualify any identifier before `=' as method call.
* * lisp/progmodes/ruby-mode.el (ruby-smie-rules): Don't indent speciallyDmitry Gutov2014-02-231-1/+7
| | | | | | after `=>'. Fixes: debbugs:16811
* Fix bug#16609Dmitry Gutov2014-02-011-0/+7
| | | | | | | * lisp/progmodes/ruby-mode.el (ruby-smie--implicit-semi-p): Check for `:' before binary operators. Don't check for `:' before `[' and `(', or their syntax status. A percent literal can't end with either.
* Implement user option ruby-align-chained-callsDmitry Gutov2014-01-311-4/+4
| | | | | | | | | | | | | | * lisp/progmodes/ruby-mode.el (ruby-align-chained-calls): New option. (ruby-smie-grammar): Make "." right-associative. Make its priority lower than the ternary and all binary operators. (ruby-smie-rules): Indent "(" relative to the first non-"." parent, or the first "." parent at indentation. Use `ruby-align-chained-calls' for indentation of "." tokens. * test/automated/ruby-mode-tests.el (ruby-align-chained-calls): New test. Fixes: debbugs:16593
* ruby-mode: Align def...end to the beginning of statementDmitry Gutov2014-01-171-0/+4
| | | | | | | | | | * lisp/progmodes/ruby-mode.el (ruby-alignable-keywords): New constant. (ruby-align-to-stmt-keywords): Change the default value. Use `ruby-alignable-keywords' to generate the possible customization choices. (ruby-smie-rules): Instead of using a hardcoded list of alignable keywords, check against the value of `ruby-alignable-keywords' (http://lists.gnu.org/archive/html/emacs-devel/2014-01/msg01439.html).
* * lisp/progmodes/ruby-mode.el (ruby-smie--implicit-semi-p): Return tDmitry Gutov2013-12-221-0/+1
| | | | | after `{'. We need it after block openers, and it doesn't seem to hurt after hash openers.
* * lisp/progmodes/ruby-mode.el (ruby-align-to-stmt-keywords): Tweak theDmitry Gutov2013-12-221-0/+6
| | | | | docstring. (ruby-smie-rules): Indent plus one level after `=>'.
* * lisp/progmodes/ruby-mode.el (ruby-align-to-stmt-keywords): NewDmitry Gutov2013-12-201-21/+16
| | | | | | | | | | | | | | | | | | option. (ruby-smie--indent-to-stmt-p): Use it. (ruby-smie-rules): Revert the logic in the handling of `when'. Expand the `begin' clause to handle `ruby-align-to-stmt-keywords'. (ruby-deep-arglist, ruby-deep-indent-paren) (ruby-deep-indent-paren-style): Update docstrings to note that the vars don't have any effect with SMIE. * test/automated/ruby-mode-tests.el: Add tests for `ruby-align-to-stmt-keywords'. * test/indent/ruby.rb: Update examples to reflect the lack of change in default indentation of `begin' blocks. Fixes: debbugs:16182
* * lisp/progmodes/ruby-mode.el (ruby-smie-rules): Indent middle-of-blockDmitry Gutov2013-12-191-0/+4
| | | | keywords to their parent.
* * lisp/progmodes/ruby-mode.el (ruby-smie--args-separator-p): Allow theDmitry Gutov2013-12-191-6/+17
| | | | | | | | | | | | | | first arg to be a string (fixed dead code), or an operator symbol. (ruby-smie--forward-token): Tokenize ` @ ' before strings and operator symbols. (ruby-smie-rules): Remove parent token check in the `.' clause, it did nothing. Don't respond to `(:after ".")', it will be called with :before anyway. Remove the ` @ ' rule, it didn't seem to change anything. Only return indentation for binary operators when they are hanging. De-dent opening paren when its parent is `.', otherwise it looks bad when the dot is not at bol or eol. Fixes: debbugs:16182
* * lisp/progmodes/ruby-mode.el (ruby-smie-rules): Indent ternary if.Dmitry Gutov2013-12-171-0/+4
|
* Fix bug#16116Dmitry Gutov2013-12-171-6/+3
| | | | | | | | | | * lisp/emacs-lisp/smie.el (smie-indent--rule): Extract `smie-indent--rule-1'. (smie-indent-close): Call `smie-indent--rule-1' with METHOD :close-all, to see which indentation method to use. (smie-rules-function): Document the method :close-all. * test/indent/ruby.rb: Update examples according to the change in `smie-indent-close'.
* Fix bug#16118Dmitry Gutov2013-12-141-4/+35
| | | | | | | | | | * lisp/progmodes/ruby-mode.el (ruby-smie-rules): Return nil before open-paren tokens when preceded by a open-paren, too. (ruby-smie-rules): Handle virtual indentation after open-paren tokens specially. If there is code between it and eol, return the column where is starts. * test/indent/ruby.rb: New examples.
* * lisp/progmodes/ruby-mode.el (ruby-smie--implicit-semi-p): Return tDmitry Gutov2013-12-091-0/+3
| | | | after the end of a percent literal.
* * lisp/progmodes/ruby-mode.el (ruby-smie-grammar): Disambiguate betweenDmitry Gutov2013-11-121-0/+3
| | | | | | | | | binary "|" operator and closing block args delimiter. Remove FIXME comment referring to Ruby 1.8-only syntax. (ruby-smie--implicit-semi-p): Not after "|" operator. (ruby-smie--closing-pipe-p): New function. (ruby-smie--forward-token, ruby-smie--backward-token): Use it. (ruby-smie-rules): Indent after "|".
* * lisp/progmodes/ruby-mode.el (ruby-smie--implicit-semi-p):Dmitry Gutov2013-11-091-2/+7
| | | | | | Not after "||". (ruby-smie-rules): Indent non-hanging "begin" blocks as part of their parent.
* * indent/ruby.rb: New exampleDmitry Gutov2013-11-081-0/+7
|
* * lisp/progmodes/ruby-mode.el (ruby-smie-grammar): Improve precedencesDmitry Gutov2013-11-081-2/+29
| | | | | | | | | | | | | | | | | of "and", "or", "&&" and "||". (ruby-smie--args-separator-p): Prohibit keyword "do" as the first argument. Prohibit opening curly brace because it could only be a block opener in that position. (ruby-smie--forward-token, ruby-smie--backward-token): Separate "|" from "&" or "*" going after it. That can happen in block arguments. (ruby-smie--indent-to-stmt): New function, seeks the end of previous statement or beginning of buffer. (ruby-smie-rules): Use it. (ruby-smie-rules): Check if there's a ":" before a curly block opener candidate; if there is, it's a hash. * test/indent/ruby.rb: New examples.
* * lisp/progmodes/ruby-mode.el (ruby-smie--implicit-semi-p):Dmitry Gutov2013-11-071-0/+12
| | | | | | | | | | No implicit semi after "^", "and" or "or". (ruby-smie-grammar): New tokens: "and" and "or". (ruby-smie--args-separator-p): Fix the check for tokens at POS. Exclude "and" and "or". Remove "do" in order to work around token priorities. (ruby-smie-rules): Add all infix tokens. Handle the case of beginning-of-buffer.
* * lisp/progmodes/ruby-mode.el (ruby-smie-grammar): Lower priority ofDmitry Gutov2013-11-071-3/+1
| | | | "." compared to "do".
* * test/indent/ruby.rb: Move a now-successful example.Dmitry Gutov2013-11-041-4/+4
|
* * lisp/progmodes/ruby-mode.el (ruby-smie--forward-token)Dmitry Gutov2013-11-041-0/+1
| | | | | | | | (ruby-smie--backward-token): Tokenize heredocs as semicolons. * test/automated/ruby-mode-tests.el: Remove outdated comment. * test/indent/ruby.rb: Add a statement on the line after heredoc.
* * lisp/progmodes/ruby-mode.el (ruby-smie--rule-parent-skip-assign): NewDmitry Gutov2013-11-021-0/+8
| | | | | | function, replacement for `smie-rule-parent' for when we want to skip over our direct parent if it's an assignment token.. (ruby-smie-rules): Use it.
* * lisp/progmodes/ruby-mode.el (ruby-smie--bosp): Anything that goesDmitry Gutov2013-10-271-0/+5
| | | | after `=' is probably a new expression.
* * test/indent/ruby.rb: New failing example.Dmitry Gutov2013-10-261-0/+4
|
* * lisp/progmodes/ruby-mode.el (ruby-smie--args-separator-p): Be moreDmitry Gutov2013-10-261-12/+13
| | | | | | | | | specific in what the first arg can be: a non-keyword word, string/regexp/percent literal opener, opening paren, or unary operator followed directly by word. * test/automated/ruby-mode-tests.el (ruby-toggle-block-to-brace): Fix the test, in respect to adding the space after the curly.
* * lisp/progmodes/ruby-mode.el (ruby-smie-rules): Fix the "curly blockDmitry Gutov2013-10-241-1/+1
| | | | | | | with parameters" example. Simplify the "is it block or is it hash" check, but also make it more thorough. * test/indent/ruby.rb: Fix syntax error in the latest example.
* * lisp/progmodes/ruby-mode.el (ruby-smie-rules): Only align with parent ofStefan Monnier2013-10-231-0/+4
| | | | { if it is hanging.
* * test/indent/ruby.rb: Move two examples to "working" section, add oneDmitry Gutov2013-10-231-7/+11
| | | | more.
* * lisp/progmodes/ruby-mode.el (ruby-smie-grammar): Remove outdatedDmitry Gutov2013-10-221-3/+14
| | | | | | | | | | | TODO. Add "." after " @ ". (ruby-smie--at-dot-call): New function. Checks if point at method call with explicit target. (ruby-smie--forward-token, ruby-smie--backward-token): Prepend "." to the method name tokens when it precedes them. (ruby-smie--backward-id, ruby-smie--forward-id): Remove. (ruby-smie-rules): Add rule for indentation before and after "." token.
* * lisp/progmodes/ruby-mode.el (ruby-smie-rules): Indent after + used asStefan Monnier2013-10-211-2/+2
| | | | an instruction.
* * indent/ruby.rb: Fix a typoDmitry Gutov2013-10-211-1/+1
|
* * lisp/progmodes/ruby-mode.el (ruby-smie-grammar): Add (almost) allDmitry Gutov2013-10-211-4/+4
| | | | | infix operators. (ruby-smie--implicit-semi-p): Add new operator chars.
* * lisp/progmodes/ruby-mode.el (ruby-mode-map): Add binding forDmitry Gutov2013-10-211-8/+17
| | | | | | | | | | | | `smie-down-list'. (ruby-smie--args-separator-p): Check that there's no newline between method call and its arguments. (ruby-smie-rules): Handle new cases: curly block with and without parameters, hash surrounded with parens, block passed to paren-less method call. * test/indent/ruby.rb: New examples for indentation of blocks. Example of hash inside parens that inflooped before this commit.
* * indent/ruby.rb: Fix an example, remove wrong example, and add two more.Dmitry Gutov2013-10-151-4/+9
|
* * lisp/progmodes/ruby-mode.el (ruby-smie--args-separator-p): HandleDmitry Gutov2013-10-141-3/+24
| | | | | | | methods ending with `?' and `!'. * test/indent/ruby.rb: More examples for bug#15594, both failing and now passing.
* * lisp/progmodes/ruby-mode.el (ruby-smie-grammar): Add rule for paren-freeStefan Monnier2013-10-121-0/+4
| | | | | | | method calls (bug#bug#15594). (ruby-smie--args-separator-p): New function. (ruby-smie--forward-token, ruby-smie--backward-token): Use it to recognize paren-free method calls.
* * test/indent/ruby.rb: Add two more cases.Dmitry Gutov2013-10-111-0/+7
|
* * lisp/progmodes/ruby-mode.el (ruby-smie--implicit-semi-p): Split theDmitry Gutov2013-10-111-0/+4
| | | | | | | cases of ? and =. (ruby-smie-rules): Simplify the "do" rule. The cases when the predicate would return nil are almost non-existent. (ruby-smie--redundant-do-p): Include "until" and "for" statements.
* * lisp/progmodes/ruby-mode.el (ruby-smie-rules): Indent after hangingDmitry Gutov2013-10-091-2/+6
| | | | | | | | | iuwu-mod token. (ruby-smie--implicit-semi-p): Prohibit implicit semicolon after hanging iuwu-mod token. (ruby-smie--forward-token): Do not include a dot after a token in that token. (ruby-smie--backward-token): Likewise.
* * lisp/progmodes/ruby-mode.el (ruby-smie--implicit-semi-p): Handle theDmitry Gutov2013-10-081-2/+2
| | | | | case of the dot in a chained method call being on the following line.
* * test/indent/ruby.rb: Fix a spurious change, add more failing examples.Dmitry Gutov2013-10-071-3/+17
|