Skip to content

Commit 9e1407e

Browse files
committed
Reimplement to make sure Unicode library isn't compiled
1 parent 5db611f commit 9e1407e

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

7+
## [unreleased]
8+
### Added
9+
- Reimplement `String.split_at/2` to make sure Unicode library isn't compiled
10+
711
## [0.30.0] - 2017-08-15
812

913
### Added

lib/elixir_script/lib/string.ex

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,4 +198,21 @@ defmodule ElixirScript.String do
198198
def valid?(str) do
199199
is_binary(str)
200200
end
201+
202+
def split_at(value, position) when position < 0 do
203+
position = length(value) + position
204+
205+
if position >= 0 do
206+
split_at(value, position)
207+
else
208+
{"", value}
209+
end
210+
end
211+
212+
def split_at(value, position) do
213+
{
214+
value.substring(0, position),
215+
value.substring(position),
216+
}
217+
end
201218
end

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ defmodule ElixirScript.Mixfile do
44
def project do
55
[
66
app: :elixir_script,
7-
version: "0.30.0",
7+
version: "0.31.0-dev",
88
elixir: "~> 1.5",
99
elixirc_paths: elixirc_paths(Mix.env),
1010
deps: deps(),

0 commit comments

Comments
 (0)