Commit Graph

851 Commits

Author SHA1 Message Date
Brian Anderson
2d79bfa415 vim: Add MutableSeq 2014-07-23 13:20:16 -07:00
Chris Morgan
0a0c6da564 Fix :syn-include usage of Vim filetype.
Here’s what the Vim manual says in *:syn-include*:

    :sy[ntax] include [@{grouplist-name}] {file-name}

	All syntax items declared in the included file will have the
	"contained" flag added.  In addition, if a group list is
	specified, all top-level syntax items in the included file will
	be added to that list.

We had two rules for `rustModPath`, one `contained` and the other not.
The effect was that the second (now renamed to `rustModPathInUse`) was
being included in the group list, and thus that all identifiers were
being highlighted as `Include`, which is definitely not what we wanted.
2014-07-21 13:14:34 +10:00
Chris Morgan
ca6ffac4e4 Highlight $(…)* and $foo in Vim. 2014-07-21 13:13:51 +10:00
bors
175f113cba auto merge of #15573 : michaelwoerister/rust/lldb-tests-rebased-09-Jul, r=alexcrichton
This PR adds the LLDB autotests to the debuginfo test suite so I don't have to keep rebasing them locally. They are still disabled by default in `tests.mk`. One of the commits also contains a Python pretty printer which can make LLDB print values with Rust syntax. This was mainly added to deal with output format differences between LLDB versions but you can also use it for your normal LLDB debugging sessions.
```
// The following LLDB commands will load and activate the Rust printers
command script import ./src/etc/lldb_rust_formatters.py
type summary add --no-value --python-function lldb_rust_formatters.print_val -x .* --category Rust
type category enable Rust
```
Expect some rough edges with these, they have not been tested apart from there use in the autotests...
2014-07-16 17:16:20 +00:00
bors
316719e625 auto merge of #15476 : kballard/rust/more_vim_tweaks, r=chris
Tweak the text editing settings (softtabstop, textwidth, etc).

Add some settings to turn on folding and colorcolumn.

Add the undo_ftplugin changes that my previous patch forgot.
2014-07-16 15:36:21 +00:00
Michael Woerister
b56ef794a0 debuginfo: Remove atexit()-debugger shutdown from lldb_batchmode.py
The shutdown call would always result in an exception being printed to standard error.
2014-07-16 09:27:06 +02:00
Michael Woerister
83fe455e3c debuginfo: Add python formatters that allow LLDB to print values with Rust syntax 2014-07-16 09:27:05 +02:00
kwantam
cf432b8f8f add Graphemes iterator; tidy unicode exports
- Graphemes and GraphemeIndices structs implement iterators over
  grapheme clusters analogous to the Chars and CharOffsets for chars in
  a string. Iterator and DoubleEndedIterator are available for both.

- tidied up the exports for libunicode. crate root exports are now moved
  into more appropriate module locations:
  - UnicodeStrSlice, Words, Graphemes, GraphemeIndices are in str module
  - UnicodeChar exported from char instead of crate root
  - canonical_combining_class is exported from str rather than crate root

Since libunicode's exports have changed, programs that previously relied
on the old export locations will need to change their `use` statements
to reflect the new ones. See above for more information on where the new
exports live.

closes #7043
[breaking-change]
2014-07-14 19:53:46 -04:00
bors
f2d251d12e auto merge of #15610 : brson/rust/0.12.0, r=alexcrichton 2014-07-12 18:06:36 +00:00
bors
8a2b7a5c19 auto merge of #15597 : brson/rust/ldconfig, r=pcwalton
If ldconfig fails it emits a warning. This is very possible when installing
to a non-system directory, so the warning tries to indicate that it may
not be a problem.
2014-07-12 04:16:44 +00:00
Brian Anderson
9641856964 Only run ldconfig on Linux 2014-07-11 21:13:40 -07:00
Brian Anderson
a9cf3233f7 Bump version to 0.12.0-pre 2014-07-11 11:26:58 -07:00
Brian Anderson
5ee270a148 install: Run ldconfig when installing on Unix. Closes #15596.
If ldconfig fails it emits a warning. This is very possible when installing
to a non-system directory, so the warning tries to indicate that it may
not be a problem.
2014-07-10 18:27:21 -07:00
Brian Anderson
ad82cb5621 install: Make the LD_LIRARY_PATH warning more aesthetic 2014-07-10 18:16:48 -07:00
Yuri Albuquerque
175d215eb6 Some documentation fixes and improvements 2014-07-10 19:51:11 -04:00
bors
942c72e117 auto merge of #15550 : alexcrichton/rust/install-script, r=brson
This adds detection of the relevant LD_LIBRARY_PATH-like environment variable
and appropriately sets it when testing whether binaries can run or not.
Additionally, the installation prints a recommended value if one is necessary.

Closes #15545
2014-07-09 22:06:27 +00:00
bors
fa7cbb5a46 auto merge of #15283 : kwantam/rust/master, r=alexcrichton
Add libunicode; move unicode functions from core

- created new crate, libunicode, below libstd
- split `Char` trait into `Char` (libcore) and `UnicodeChar` (libunicode)
  - Unicode-aware functions now live in libunicode
    - `is_alphabetic`, `is_XID_start`, `is_XID_continue`, `is_lowercase`,
      `is_uppercase`, `is_whitespace`, `is_alphanumeric`, `is_control`, `is_digit`,
      `to_uppercase`, `to_lowercase`
  - added `width` method in UnicodeChar trait
    - determines printed width of character in columns, or None if it is a non-NULL control character
    - takes a boolean argument indicating whether the present context is CJK or not (characters with 'A'mbiguous widths are double-wide in CJK contexts, single-wide otherwise)
- split `StrSlice` into `StrSlice` (libcore) and `UnicodeStrSlice` (libunicode)
  - functionality formerly in `StrSlice` that relied upon Unicode functionality from `Char` is now in `UnicodeStrSlice`
    - `words`, `is_whitespace`, `is_alphanumeric`, `trim`, `trim_left`, `trim_right`
  - also moved `Words` type alias into libunicode because `words` method is in `UnicodeStrSlice`
- unified Unicode tables from libcollections, libcore, and libregex into libunicode
- updated `unicode.py` in `src/etc` to generate aforementioned tables
- generated new tables based on latest Unicode data
- added `UnicodeChar` and `UnicodeStrSlice` traits to prelude
- libunicode is now the collection point for the `std::char` module, combining the libunicode functionality with the `Char` functionality from libcore
  - thus, moved doc comment for `char` from `core::char` to `unicode::char`
- libcollections remains the collection point for `std::str`

The Unicode-aware functions that previously lived in the `Char` and `StrSlice` traits are no longer available to programs that only use libcore. To regain use of these methods, include the libunicode crate and `use` the `UnicodeChar` and/or `UnicodeStrSlice` traits:

    extern crate unicode;
    use unicode::UnicodeChar;
    use unicode::UnicodeStrSlice;
    use unicode::Words; // if you want to use the words() method

NOTE: this does *not* impact programs that use libstd, since UnicodeChar and UnicodeStrSlice have been added to the prelude.

closes #15224
[breaking-change]
2014-07-09 18:36:30 +00:00
Alex Crichton
c460d38363 etc: Fix install script for rpath removal
This adds detection of the relevant LD_LIBRARY_PATH-like environment variable
and appropriately sets it when testing whether binaries can run or not.
Additionally, the installation prints a recommended value if one is necessary.
2014-07-09 07:44:49 -07:00
Richo Healey
12c334a77b std: Rename the ToStr trait to ToString, and to_str to to_string.
[breaking-change]
2014-07-08 13:01:43 -07:00
Kevin Ballard
9dc667d472 Remove rust_colorcolumn, set textwidth to 99
The latest change to aturon/rust-guidelines states that lines must not
exceed 99 characters. This gets rid of the 80/100 split, so we don't
need to customize colorcolumn amymore.
2014-07-07 22:22:25 -07:00
Kevin Ballard
94cfd1b4ad Set softtabstop, textwidth, and optionally colorcolumn
Setting softtabstop makes <Del> delete 4 spaces as if it were a tab.

Setting textwidth allows comments to be wrapped automatically. It's set
at 80, which is the recommended line length for Rust programs. There are
suggestions that it should be 79, but our current style guide says 80 so
that's what we're matching.

A new setting g:rust_colorcolumn sets colorcolumn as well, to +1,101.
This indicates both the textwidth and the second stricter line length of
100 that our style guide lists.
2014-07-07 22:18:27 -07:00
Kevin Ballard
c6492040b2 Define a new setting g:rust_fold
g:rust_fold allows folding to be enabled. This lets the user turn on
folding without having to define autocommands.
2014-07-07 22:18:27 -07:00
kwantam
5d4238b6fc Add libunicode; move unicode functions from core
- created new crate, libunicode, below libstd
- split Char trait into Char (libcore) and UnicodeChar (libunicode)
  - Unicode-aware functions now live in libunicode
    - is_alphabetic, is_XID_start, is_XID_continue, is_lowercase,
      is_uppercase, is_whitespace, is_alphanumeric, is_control,
      is_digit, to_uppercase, to_lowercase
  - added width method in UnicodeChar trait
    - determines printed width of character in columns, or None if it is
      a non-NULL control character
    - takes a boolean argument indicating whether the present context is
      CJK or not (characters with 'A'mbiguous widths are double-wide in
      CJK contexts, single-wide otherwise)
- split StrSlice into StrSlice (libcore) and UnicodeStrSlice
  (libunicode)
  - functionality formerly in StrSlice that relied upon Unicode
    functionality from Char is now in UnicodeStrSlice
    - words, is_whitespace, is_alphanumeric, trim, trim_left, trim_right
  - also moved Words type alias into libunicode because words method is
    in UnicodeStrSlice
- unified Unicode tables from libcollections, libcore, and libregex into
  libunicode
- updated unicode.py in src/etc to generate aforementioned tables
- generated new tables based on latest Unicode data
- added UnicodeChar and UnicodeStrSlice traits to prelude
- libunicode is now the collection point for the std::char module,
  combining the libunicode functionality with the Char functionality
  from libcore
  - thus, moved doc comment for char from core::char to unicode::char
- libcollections remains the collection point for std::str

The Unicode-aware functions that previously lived in the Char and
StrSlice traits are no longer available to programs that only use
libcore. To regain use of these methods, include the libunicode crate
and use the UnicodeChar and/or UnicodeStrSlice traits:

    extern crate unicode;
    use unicode::UnicodeChar;
    use unicode::UnicodeStrSlice;
    use unicode::Words; // if you want to use the words() method

NOTE: this does *not* impact programs that use libstd, since UnicodeChar
and UnicodeStrSlice have been added to the prelude.

closes #15224
[breaking-change]
2014-07-07 14:52:24 -04:00
Patrick Walton
7e4e99123a librustc (RFC #34): Implement the new Index and IndexMut traits.
This will break code that used the old `Index` trait. Change this code
to use the new `Index` traits. For reference, here are their signatures:

    pub trait Index<Index,Result> {
        fn index<'a>(&'a self, index: &Index) -> &'a Result;
    }
    pub trait IndexMut<Index,Result> {
        fn index_mut<'a>(&'a mut self, index: &Index) -> &'a mut Result;
    }

Closes #6515.

[breaking-change]
2014-07-07 11:43:23 -07:00
Kevin Ballard
4c1fdd065b vim: set Rust tab conventions 2014-07-04 14:09:47 -07:00
bors
5b11610ced auto merge of #15343 : alexcrichton/rust/0.11.0-release, r=brson 2014-07-04 01:21:19 +00:00
Ruud van Asseldonk
5d36005066 remove duplicated slash in install script path 2014-07-03 12:54:51 -07:00
Mike Boutin
ccd7aaf17a install: Correct libdir for Windows installs.
Platform-detection code from `configure` copied over to `install.sh`
in order to special case the lib dir being `bin` on Windows instead
of `lib`.

Short-term fix for #13810.
2014-07-02 20:03:10 -04:00
Alex Crichton
ff1dd44b40 Merge remote-tracking branch 'origin/master' into 0.11.0-release
Conflicts:
	src/libstd/lib.rs
2014-07-02 11:08:21 -07:00
bors
380657557c auto merge of #15295 : TeXitoi/rust/relicense-shootout-mandelbrot, r=brson
Part of #14248

Main authors:
- @Ryman: OK
- @TeXitoi: OK
- @pcwalton: OK

Minor authors:
- @brson: OK
- @alexcrichton: OK
- @kballard: OK

Remark: @tedhorst was a main contributor, but its contribution
disapear with @pcwalton rewrite at af4ea11

@brson OK?
2014-07-02 00:21:36 +00:00
Guillaume Pinot
c9dcf8ce32 relicense shootout-mandelbrot.rs
Part of #14248

Main authors:
- @Ryman: OK
- @TeXitoi: OK
- @pcwalton: OK

Minor authors:
- @brson: OK
- @alexcrichton: OK
- @kballard: OK

Remark: @tedhorst was a main contributor, but its contribution
disapear with @pcwalton rewrite at af4ea11
2014-07-01 10:00:27 +02:00
Alexandre Gagnon
d6c988a669 Vim syntax file types and traits cleanup 2014-07-01 00:52:51 -04:00
Alex Crichton
aa1163b92d Update to 0.11.0 2014-06-27 12:50:16 -07:00
bors
7689213713 auto merge of #14952 : alexcrichton/rust/const-unsafe-pointers, r=brson
This does not yet change the compiler and libraries from `*T` to `*const T` as
it will require a snapshot to do so.

cc #7362

---

Note that the corresponding RFC, https://github.com/rust-lang/rfcs/pull/68, has not yet been accepted. It was [discussed at the last meeting](https://github.com/rust-lang/rust/wiki/Meeting-weekly-2014-06-10#rfc-pr-68-unsafe-pointers-rename-t-to-const-t) and decided to be accepted, however. I figured I'd get started on the preliminary work for the RFC that will be required regardless.
2014-06-24 04:16:53 +00:00
bors
d77cb22bb6 auto merge of #15100 : rapha/rust/master, r=alexcrichton
/usr/bin/env appears to be more portable.
2014-06-23 14:31:39 +00:00
Raphael Speyer
53ec4a6732 Change /bin/env to /usr/bin/env in helper python script, as it is more portable 2014-06-23 09:17:40 +10:00
Piotr Jawniak
0b9e4fcaff Update few files after comparison traits renaming
There were still Total{Ord,Eq} in docs and src/etc
2014-06-22 09:31:39 +02:00
Simon Sapin
108b8b6dc7 Deprecate the bytes!() macro.
Replace its usage with byte string literals, except in `bytes!()` tests.
Also add a new snapshot, to be able to use the new b"foo" syntax.

The src/etc/2014-06-rewrite-bytes-macros.py script automatically
rewrites `bytes!()` invocations into byte string literals.
Pass it filenames as arguments to generate a diff that you can inspect,
or `--apply` followed by filenames to apply the changes in place.
Diffs can be piped into `tip` or `pygmentize -l diff` for coloring.
2014-06-18 17:02:22 -07:00
Chris Morgan
b0dff7a191 Vim: highlight invalid characters in char literals. 2014-06-18 17:01:52 -07:00
Chris Morgan
31dfcf9dc1 Vim: highlight escapes for byte literals. 2014-06-18 17:01:52 -07:00
Kevin Ballard
1273f94cbb Add commands :RustEmitIr and :RustEmitAsm 2014-06-18 17:01:22 -07:00
Kevin Ballard
918eda59be Write documentation for the Rust vim plugin 2014-06-18 17:01:22 -07:00
Kevin Ballard
bd3bebcf60 Rename :Run and :Expand to :RustRun and :RustExpand 2014-06-18 17:01:22 -07:00
Kevin Ballard
303cadfbb3 vim: Add :Run and :Expand commands
Define a command :Run to compile and run the current file. This supports
unnamed buffers (by writing to a temporary file). See the comment above
the command definition for notes on usage.

Define <D-r> and <D-R> mappings for :Run to make it easier to invoke in
MacVim.

Define a command :Expand to display the --pretty expanded output for the
current file. This can be configured to use different pretty types. See
the comment above the command definition for notes on usage.

Create an autoload file and put function definitions there to speed up
load time.
2014-06-18 17:01:21 -07:00
Tom Jakubowski
23a7d24dd7 emacs: Remove outdated references to ~ in tests 2014-06-17 16:42:42 -07:00
Tom Jakubowski
77b874b68d emacs: Add shebang to test script 2014-06-17 16:39:40 -07:00
Tom Jakubowski
9175326272 emacs: Don't overwrite font lock for attributes
This addresses the font lock regression introduced by the earlier pull
request #14818 - attributes are no longer be highligted inside of comments
and strings.

Also add some font lock test infrastructure and some tests for attribute
font locking.
2014-06-17 16:38:19 -07:00
bors
feb294ca11 auto merge of #14818 : tomjakubowski/rust/emacs-attributes-key-value, r=pnkfelix
This addresses two problems noted in #14347: the highlight of `#foo]` as an attribute, and the non-highlight of `#[foo = "bar"]`.
2014-06-17 08:16:27 +00:00
bors
09967665ea auto merge of #14955 : alexcrichton/rust/rollup, r=alexcrichton 2014-06-17 02:51:53 +00:00
Brian Anderson
f4ae8a83f9 Update repo location 2014-06-16 18:16:36 -07:00