Commit Graph
951 Commits
Author SHA1 Message Date
José Valim 3b4954b652 Merge pull request #1643 from pminten/elixirc-silent
Add --verbose to elixirc
2013-08-24 11:15:21 -07:00
José Valim fb30101632 Merge pull request #1645 from vanstee/string-split-repeats
Keep empty strings when splitting
2013-08-24 05:21:14 -07:00
Peter Minten 4c28f325e3 Supress 'Compiled' msg by default in elixirc
Adds a --verbose option to elixirc

This fixes #1618
2013-08-24 13:30:34 +02:00
José Valim da50584060 Deprecate def/4 and friends in favor of def/2 with unquote and friends 2013-08-23 19:42:20 +02:00
vanstee 891564f114 Keep empty strings when splitting
To stay consistent with both `String.split/2` and `:binary.split` we
need to keep around empty strings that are accumulated while splitting.
In the future we could support the `:trim` option to consistently remove
these in call calls to `String.split`.

Fixes #1636
2013-08-23 12:37:02 -04:00
José Valim a6cdc835a1 No need to wrap quote do: nil in a block 2013-08-23 11:22:11 +02:00
José Valim 0510512375 Deprecate to_binary in favor of to_string
We also rename Binary.Chars to String.Chars.

As Binary.Chars was the protocol used for interpolation,
it is semantically correct to have a protocol that works
on strings, instead of raw binaries.
2013-08-22 12:19:30 +02:00
José Valim 0e1aac32f5 import accept :functions and :macros as values in :only
This commit removes the previous ambiguous syntax:

    import :functions, Foo

In favor of:

    import Foo, only: :functions
2013-08-22 10:34:45 +02:00
José Valim 308d5a35eb Merge pull request #1629 from Raynes/is_it_even_odd
Add a pair of even and odd checking functions
2013-08-21 23:48:59 -07:00
Anthony Grimes fcc37030e2 Add a pair of even and odd checking functions. 2013-08-21 11:08:20 -07:00
José Valim 2f63c745a3 Merge pull request #1630 from Raynes/chunks_by
Add chunks_by
2013-08-21 01:30:26 -07:00
José Valim 29f030bb28 Update CHANGELOG 2013-08-20 23:57:59 +02:00
José Valim 8b02a2a7a0 Convert external functions into quoted expressions 2013-08-20 23:52:00 +02:00
Anthony Grimes f7e6b29e86 Add chunks_by. 2013-08-20 14:30:45 -07:00
José Valim c6a12f5039 Improve checks of functions inside records 2013-08-20 19:31:10 +02:00
José Valim 20418a14f7 Refactor Enum.chunks to use Enumerable.reduce/3, avoiding starting lazy collections twice 2013-08-20 14:08:27 +02:00
José Valim 3e1099830a Properly handle @file that comes from warnings 2013-08-20 11:39:29 +02:00
Anthony Grimes 7f00aded18 Add Enum.chunks. 2013-08-20 00:48:42 -07:00
José Valim 84a2b31221 Add Macro.to_string/2 2013-08-19 18:21:42 +02:00
José Valim f84b4121ce Allow << _ :: utf8 >> <> binary in matches, closes #1619 2013-08-18 14:36:54 +02:00
José Valim ff2af55e1d Improve warning for ungrouped clauses 2013-08-18 10:05:36 +02:00
José Valim a45a2c9d93 Allow erlang options when compiling elixir regexes 2013-08-17 11:57:17 +02:00
José Valim aaebf84440 Always stop on --, even for parse 2013-08-16 09:28:58 +02:00
Peter Minten 081dbceeee Macro.to_string: don't add unneeded binop parens
This changes the `Macro.to_string` output of (quoted) `1+2+3+4` from
`((1 + 2) + 3) + 4` to `1 + 2 + 3 + 4`.
2013-08-15 14:05:37 +02:00
José Valim eb9753ddd1 Limit inspect by default, closes #1595 2013-08-15 10:35:04 +02:00
Eric Meadows-Jonsson 35af4348ae Macro.to_string handles access and kw-lists nicer 2013-08-14 22:10:48 +02:00
José Valim 6ac280e17c Clean up and expose are more complete API in Exception 2013-08-14 12:55:13 +02:00
José Valim db47bd56b4 Add Path.relative_to_cwd and rely on it when generating stacktraces 2013-08-14 12:36:54 +02:00
José Valim cea31f69dc Review and deprecate list <-> binary conversion 2013-08-14 11:16:37 +02:00
José Valim 8affa706b7 Merge pull request #1593 from vanstee/string-justification-functions
Implement string justification functions
2013-08-13 23:27:04 -07:00
vanstee 0850430768 Only accept a single character as padding 2013-08-13 11:07:02 -04:00
vanstee b14617ca90 Do not truncate strings when justifying 2013-08-13 10:53:27 -04:00
vanstee 0276419f4e Implement rjust and ljust string functions
To provide string justification, the following functions were
implemented:

  * `String.rjust/2`
  * `String.rjust/3`
  * `String.ljust/2`
  * `String.ljust/3`
2013-08-13 10:28:40 -04:00
vanstee b710ebd5e6 Return an empty string from slice with valid index
To keep in line with ruby semantics of
[`String#slice`](http://ruby-doc.org/core-2.0/String.html#method-i-slice)
slice should return an empty string instead of nil when the starting
index is valid even if the length is 0.

Fixes #1591
2013-08-13 09:45:08 -04:00
José Valim 52188fab89 Move from unicode to list to String.to_char_list 2013-08-13 08:39:16 +02:00
José Valim 19ac199b06 Move from unicode to binary to String.from_char_list 2013-08-13 08:39:16 +02:00
José Valim 82d8d2ad63 Deprecate Dict.update/3 in favor of Dict.update!/3
A non-raising version that yields nil will be added in
upcoming releases.
2013-08-13 08:39:16 +02:00
vanstee 742219339c Support removing unicode characters with strip
Thanks for the suggested fix @josevalim
2013-08-11 16:49:15 -04:00
José Valim 9daa0bc3a2 Support IO.stream/2 and IO.binstream/2 and deprecate current IO.sream/1 and IO.binstream/1
Closes #1582
2013-08-11 15:48:31 +02:00
José Valim b0317a8e18 Allow capture on anonymous function calls 2013-08-11 15:16:00 +02:00
José Valim d3cb41614b Merge pull request #1561 from thmzlt/option-parser-invalid-options
Improve OptionParser switch validation
2013-08-11 02:54:18 -07:00
vanstee ad67e4935a Return error when tokenizing oversized atom
When "atomizing" an unsafe string, we need to make sure the atom length
is going to be less than the system limit (255). Any function calling
`unsafe_to_atom` checks for an error and returns it if present.
2013-08-10 17:10:47 -04:00
José Valim de72fa2012 Merge pull request #1579 from pminten/add-location-of-overridden-def
Add location of overridden def in warning message
2013-08-10 06:42:38 -07:00
José Valim 55de57ced6 Ensure proper line on interpolations inside heredocs, closes #1581 2013-08-10 15:40:02 +02:00
José Valim 70421e79b1 Fix bug on sorting algorithm on certain branches, closes #1580 2013-08-10 13:28:29 +02:00
Peter Minten a538e86c0c Put overridden def test in warning_test.exs
This removes the need for a separate fixture.
2013-08-10 13:18:34 +02:00
Peter Minten e18ae5e335 Add test for overridden def warning 2013-08-10 11:59:50 +02:00
Guillermo Iguaran ed7965e257 Add Enum.flat_map
Returns a new collection appending the result of invoking `fun`
on each corresponding item of `collection`.
2013-08-10 02:36:16 -05:00
Thomaz Leite abbbcdf659 Update OptionParser test for permanent invalid list 2013-08-09 09:52:15 -07:00
Thomaz Leite 06bc04a7bf Improve OptionParser switch validation
This adds a third element to the tuple returned from OptionParser.parse/2 when the value for an option doesn't match its switch type.
2013-08-09 09:52:15 -07:00