Commit Graph

487 Commits

Author SHA1 Message Date
Felix S. Klock II
9d8897ba60 extend file regexp to match files with embedded spaces. 2013-08-26 02:28:27 +02:00
Felix S. Klock II
fe7092dafb revisions to emacs compilation regexp, more readable and robust. 2013-08-25 14:38:12 +02:00
Felix S. Klock II
521fb049be compilation error regexp specific to rustc.
Fix #6887.
2013-08-25 14:15:03 +02:00
bors
0c6cc11e05 auto merge of #8445 : Florob/rust/unicode, r=graydon
This adds support for performing Unicode Normalization Forms D and KD on strings.
To enable this the decomposition and canonical combining class properties are added to std::unicode.
On my system this increases libstd's size by ~250KiB.
2013-08-21 11:01:44 -07:00
Florian Zeitz
2675f3e9e7 Add canonical combining class to std::unicode 2013-08-21 11:50:07 +02:00
Florian Zeitz
83f4bee44f Add Unicode decomposition mappings to std::unicode 2013-08-21 11:50:07 +02:00
bors
c87d798fb0 auto merge of #8585 : jankobler/rust/extract-grammar-01, r=catamorphism
This fixes some errors which extract_grammar.py reports, when called with

python2.7 src/etc/extract_grammar.py <doc/rust.md
2013-08-21 02:22:25 -07:00
Jan Kobler
87761c1f99 extract_grammar symnames
add missing symnames

Signed-off-by: Jan Kobler <eng1@koblersystems.de>
2013-08-18 07:25:54 +02:00
Huon Wilson
72fd02d939 doc: convert remaining uses of core:: to std::. 2013-08-16 15:54:14 +10:00
bors
1785841a5b auto merge of #8410 : luqmana/rust/mcpu, r=sanxiyn
Adds `--target-cpu` flag which lets you choose a more specific target cpu instead of just passing the default, `generic`. It's more or less akin to `-mcpu`/`-mtune` in clang/gcc.
2013-08-11 20:50:14 -07:00
Luqman Aden
fcfd6e7c79 rustc: Add --target-cpu flag to select a more specific processor instead of the default, 'generic'. 2013-08-10 17:03:43 -04:00
Erick Tryzelaar
b19c2ed8f3 Merge branch 'master' of https://github.com/p2j4d2c/rust into rollup 2013-08-10 13:02:44 -07:00
Paul Collins
3596f666bb rust-mode: make indentation customizable
Add new variable rust-indent-offset, defaulting to
the old value, and use it.
2013-08-08 19:25:21 +12:00
Simon Sapin
240f8f03c9 Gedit/gtksourceview language spec: add 'in' keyword 2013-08-07 22:41:14 -04:00
Daniel Micay
b49d026ecd Merge pull request #8284 from huonw/emacs-in-kw
etc: add the `in` keyword to the emacs mode.
2013-08-04 12:49:11 -07:00
bors
5cf69d5bf8 auto merge of #8254 : brson/rust/libuv-mac-supp, r=pcwalton
I suspect that this is a race between process exit and the termination of
worker threads used by libuv (if I sleep before exit it doesn't leak). This
isn't going to cause any real problems but should probably be fixed at
some point.

r? @pcwalton

cc #8253
2013-08-04 05:28:57 -07:00
bors
fbeeeebf47 auto merge of #8264 : thestinger/rust/snapshot, r=Aatch 2013-08-03 23:25:55 -07:00
Daniel Micay
1008945528 remove obsolete foreach keyword
this has been replaced by `for`
2013-08-03 22:48:02 -04:00
Huon Wilson
cdad7f6f3b etc: add the in keyword to the emacs mode. 2013-08-03 18:31:23 +10:00
Chris Morgan
ceb651671a Vim highlighting: remove foreach keyword 2013-08-03 15:56:18 +10:00
Brian Anderson
8f9c1724d0 Suppress a libuv leak on mac
I suspect that this is a race between process exit and the termination of
worker threads used by libuv (if I sleep before exit it doesn't leak). This
isn't going to cause any real problems but should probably be fixed at
some point.
2013-08-02 22:05:34 -07:00
Chris Morgan
44cb1c3adb Highlight sigils and operators in Vim.
Sigil highlighting isn't perfect (especially how it handles ``&``) but
after having used it for a week I feel it to be considerably nicer than
nothing. As usual, if you don't like it, you can turn it off easily by
overriding the default highlighting.

Generics are not handled specially; this means that for something like
``S<T>``, the ``<`` and ``>`` are highlighted as operators. For myself,
I like this, and there is no way to make it properly context aware
without expanding the syntax matching enormously.

Also, special characters are highlighted properly in strings/chars, e.g.
``"\x00"`` or ``'\Ufedcba98'`` appropriately.
2013-08-03 14:36:27 +10:00
bors
aa8f79d6cf auto merge of #8067 : alexcrichton/rust/issue-3636, r=huonw
Allow some common ones that are good for examples, however.

Closes #3636
2013-07-27 07:10:36 -07:00
Alex Crichton
b782d42cba Deny all warnings by default in doc tests
Allow some common ones that are good for examples, however.
2013-07-26 18:04:20 -07:00
bors
4c4cf003ea auto merge of #8031 : graydon/rust/emacs-mode-rewrite, r=catamorphism
The previous mode did a lot of very manual char-at-a-time parsing and was quite fragile and difficult to maintain. I talked to Marijn and he suggested I'd have better luck just rewriting it from scratch. This is the result of that effort; it seems to be faster, a bit easier on the eyes and more-or-less as well behaved when indenting. The algorithm is a bit different I suspect (it was hard to tell the previous one) but I tried to keep it simple and pleasant-looking.
2013-07-26 02:04:50 -07:00
Graydon Hoare
581b3db3b3 rewrite rust-mode to use font-lock-mode and emacs builtin syntax analysis 2013-07-24 17:11:04 -07:00
bors
4a726f0573 auto merge of #8006 : emillon/rust/issue-6060, r=pcwalton
Hello,

I made a tiny change to `tidy.py` so that it uses a regexp to find `// NOTE` comments. I could not find an easy way to write an automated test for this but if this is needed and possible I'd be happy to write one.
Please note that it also removes extra empty lines that appear after each of these warnings (I believe that there were not wanted).

On the performance side, `make tidy` is now a bit slower (running it 10 times in a row takes 71s on my machine, 65s before) but I don't think that it is performance sensitive.

Thanks!
2013-07-24 16:49:36 -07:00
bors
9954409438 auto merge of #7964 : pnkfelix/rust/fsk-issue3994-readme-note, r=huonw
See #3994.
2013-07-23 15:40:53 -07:00
Etienne Millon
b128ceb161 tidy: allow arbitrary spaces between // and NOTE
`make tidy` now detects `//NOTE`, `//  NOTE`, etc.
This also removes the extra empty line emitted after each warning.

Fixes #6060
2013-07-23 21:34:02 +02:00
Felix S. Klock II
f98f3b0401 Note incompatibility with global-whitespace-mode.
See #3994.
2013-07-22 12:27:46 +02:00
Daniel Micay
fc05819181 Merge pull request #7936 from thestinger/cleanup
rm obsolete no-op lints
2013-07-21 20:04:15 -07:00
Daniel Micay
13b474dcbb rm obsolete no-op lints 2013-07-20 20:17:08 -04:00
Brian Anderson
79677f0556 mk: Remove CFG_INSTALL_SNAP logic. #2664 2013-07-19 15:35:42 -07:00
bors
929b75e220 auto merge of #7747 : chris-morgan/rust/vim-compiler-rustc, r=huonw
Note that this is not actually *used* by default; it is a matter of
configuration still, because you might want to:

- Compile all .rs files with `rustc %` (where each can be built itself)

- Compile all .rs files with `rustc some-file.rs` (where you are editing
  part of a crate)

- Compile with a different tool, such as `make`. (In this case you might
  put a `~/.vim/after/compiler/rustc.vim` to match such cases, set
  makeprg and extend errorformat as appropriate. That should probably go
  in a different compiler mode, e.g. make-rustc.)

To try using it, `:compiler rustc`. Then, `:make` on a file you would
run `rustc` on will work its magic, invoking rustc. To automate this,
you could have something like `autocmd FileType rust compiler rustc` in
your Vim config.
2013-07-18 05:07:39 -07:00
sp3d
9adad222a6 add regions, unicode idents, attributes to GtkSourceView language-spec 2013-07-14 23:44:55 -05:00
Chris Morgan
917d720f48 rustc compiler config for Vim.
Note that this is not actually *used* by default; it is a matter of
configuration still, because you might want to:

- Compile all .rs files with `rustc %` (where each can be built itself)

- Compile all .rs files with `rustc some-file.rs` (where you are editing
  part of a crate)

- Compile with a different tool, such as `make`. (In this case you might
  put a `~/.vim/after/compiler/rustc.vim` to match such cases, set
  makeprg and extend errorformat as appropriate. That should probably go
  in a different compiler mode, e.g. make-rustc.)

To try using it, `:compiler rustc`. Then, `:make` on a file you would
run `rustc` on will work its magic, invoking rustc. To automate this,
you could have something like `autocmd FileType rust compiler rustc` in
your Vim config.
2013-07-12 23:51:03 +10:00
Chris Morgan
4f67ed535b Fix problem with switching between Rust buffers.
This was also causing trouble if one didn't have delimitMate installed.
2013-07-12 16:18:48 +10:00
Chris Morgan
184fa42d33 Vim syntax: support lifetimes with delimitMate.
When it's a lifetime, a single quotation mark shouldn't have a matching
single quotation mark inserted after it, as delimitMate does by default.

Note that this is not without problems; a char literal coming after an
odd number of lifetime markers will have its quotation marks behave a
little strangely. That, however, is not my fault, but delimitMate's:
https://github.com/Raimondi/delimitMate/issues/135
2013-07-12 15:30:51 +10:00
Chris Morgan
6e75f2de9c Fix Vim indentation for inline closures. 2013-07-11 14:38:32 -04:00
Chris Morgan
1d08ceb043 Fix comment indenting properly for Vim files.
Indentation now works correctly on subsequent lines of a multi-line
comment, whether there are leaders (` * `) or not. (Formerly it was
incorrectly doing a two-space indent if there was no leader.)

By default, this no longer puts a ` * ` leader on `/*!` comments, as
that appears to be the current convention in the Rust source code, but
that can easily be re-enabled if desired:

    let g:rust_bang_comment_leader = 1
2013-07-11 14:38:24 -04:00
bors
8a7b636649 auto merge of #7637 : pnkfelix/rust/fsk-guard-against-stale-libraries-issue3225-safeguarded, r=graydon
When building Rust libraries (e.g. librustc, libstd, etc), checks for
and verbosely removes previous build products before invoking rustc.
(Also, when Make variable VERBOSE is defined, it will list all of the
libraries matching the object library's glob after the rustc
invocation has completed.)

When installing Rust libraries, checks for previous libraries in
target install directory, but does not remove them.

The thinking behind these two different modes of operation is that the
installation target, unlike the build tree, is not under the control
of this infrastructure and it is not up to this Makefile to decide if
the previous libraries should be removed.

Fixes #3225 (at least in terms of mitigating the multiple library
problem by proactively warning the user about it.)
2013-07-10 01:10:29 -07:00
Chris Morgan
121ae82be0 Do indentation properly in Vim.
The cases that this improves are clearly documented inside the
committed file, so this commit message is comparatively brief.
2013-07-10 01:33:30 +10:00
Chris Morgan
cf65870962 Add a Vim filetype plugin with useful tweaks.
This improves things like doc comment handling when you press Enter and
making using `gf` or `<C-W>f` work on a `use x;` statement in the
current directory.
2013-07-10 01:30:32 +10:00
Chris Morgan
3fa4cef876 A few slight tweaks to the Vim syntax file.
- Add fold support (NOT turned on by default)
- Highlight `::` by default
- Support the common `NOTE` as an important note
- Highlight `assert!` and `fail!` differently
- Don't highlight `deriving(...)` except in `#[...]`
2013-07-10 01:27:35 +10:00
Felix S. Klock II
25f51eeda0 Fix #3225: Incorporate feedback from Graydon.
Namely, switched in many places to using GNU make provided functions
for directory listing and text processing, rather than spawning a
shell process to do that work.

In the process of the revision, learned about Target-specific
variables, which were very applicable to INSTALL_LIB (which, on a
per-recipe basis, was always receiving the same actual arguments for
its first two formal parameters in every invocation).

  http://www.gnu.org/software/make/manual/html_node/Target_002dspecific.html

(We might be able to make use of those in future refactorings.)

----

Also adds a cleanup pass to get-snapshot.py as well, since the same
problem arises when we unpack libraries from the snapshot archive into
a build directory with a prior snapshot's artifacts.  (I put this step
into the python script rather than the makefile because I wanted to
delay the cleanup pass until after we have at least successfully
downloaded the tarball.  That way, if the download fails, you should
not destroy the previous unarchived snapshot libraries and build
products.)

----

Also reverted whitespace changes to minimize diff.
I plan to put them back in in a dedicated commit elsewhere.
2013-07-09 13:08:50 +02:00
Brian Anderson
b0a9d8193f Bump version numbers to 0.8-pre 2013-07-08 10:25:45 -07:00
bors
6d6b1a8bfa auto merge of #7586 : g5pw/rust/master, r=cmr
This updates the script in src/etc/local_stage0.sh to copy the correct libraries
to stage0.
2013-07-07 17:59:03 -07:00
Seo Sanghyeon
20458899d5 vim: Highlight 0i as number 2013-07-05 13:03:15 +09:00
Aljaž "g5pw" Srebrnič
e9ce97cc2a Copy the correct libs when using local-rust-root
This fixes a segfault when configuring rust to use local-rust-root. The
libraries were renamed in the 0.6-0.7 transition, and the script was not copying
them all. I also removed the line referencing libcore (now libstd).
2013-07-04 16:18:05 +02:00
bors
55f155521d auto merge of #7523 : huonw/rust/uppercase-statics-lint, r=cmr
Adds a lint for `static some_lowercase_name: uint = 1;`. Warning by default since it causes confusion, e.g. `static a: uint = 1; ... let a = 2;` => `error: only refutable patterns allowed here`.
2013-07-03 04:31:50 -07:00