Merge branch 'trunk' into fix-walk-backwards

This commit is contained in:
Richard Feldman 2021-04-11 12:11:34 -04:00 committed by GitHub
commit 6ce060bd25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
34 changed files with 105 additions and 61 deletions

View File

@ -1,11 +1,11 @@
[package]
name = "roc_cli"
version = "0.1.0"
authors = ["Richard Feldman <oss@rtfeldman.com>"]
authors = ["The Roc Contributors"]
license = "Apache-2.0"
repository = "https://github.com/rtfeldman/roc"
edition = "2018"
description = "A CLI for Roc"
license = "Apache-2.0"
default-run = "roc"
[[bin]]

View File

@ -1,11 +1,11 @@
[package]
name = "arena-pool"
version = "0.1.0"
authors = ["Richard Feldman <oss@rtfeldman.com>"]
authors = ["The Roc Contributors"]
license = "Apache-2.0"
repository = "https://github.com/rtfeldman/roc"
edition = "2018"
description = "A CLI for Roc"
license = "Apache-2.0"
[dev-dependencies]
pretty_assertions = "0.5.1"

View File

@ -1,9 +1,9 @@
[package]
name = "roc_build"
version = "0.1.0"
authors = ["Richard Feldman <oss@rtfeldman.com>"]
edition = "2018"
authors = ["The Roc Contributors"]
license = "Apache-2.0"
edition = "2018"
[dependencies]
roc_collections = { path = "../collections" }

View File

@ -1,9 +1,9 @@
[package]
name = "roc_builtins"
version = "0.1.0"
authors = ["Richard Feldman <oss@rtfeldman.com>"]
edition = "2018"
authors = ["The Roc Contributors"]
license = "Apache-2.0"
edition = "2018"
[dependencies]
roc_collections = { path = "../collections" }

View File

@ -1,5 +1,5 @@
interface Str
exposes [ Str, decimal, split, isEmpty, startsWith, endsWith, contains, anyGraphemes, allGraphemes, join, joinWith, padGraphemesStart, padGraphemesEnd, graphemes, reverseGraphemes, isCaseInsensitiveEq, isCaseInsensitiveNeq, walkGraphemes, isCapitalized, isAllUppercase, isAllLowercase, toUtf8, toUtf16, toUtf32, walkUtf8, walkUtf16, walkUtf32, walkRevUtf8, walkRevUtf16, walkRevUtf32 ]
exposes [ Str, decimal, split, isEmpty, startsWith, endsWith, contains, anyGraphemes, allGraphemes, join, joinWith, padGraphemesStart, padGraphemesEnd, graphemes, reverseGraphemes, isCaseInsensitiveEq, isCaseInsensitiveNeq, walkGraphemes, isCapitalized, isAllUppercase, isAllLowercase, toUtf8, toUtf16, toUtf32, trim, walkUtf8, walkUtf16, walkUtf32, walkRevUtf8, walkRevUtf16, walkRevUtf32 ]
imports []
## # Types
@ -343,6 +343,10 @@ toUtf16 : Str -> List U16
## without creating a #List, see #Str.walkUtf32 and #Str.walkRevUtf32.
toUtf32 : Str -> List U32
## Return the string with any blank spaces removed from both the beginning
## as well as the end.
trim : Str -> Str
## Walk through the string's #U8 UTF-8 [code units](https://unicode.org/glossary/#code_unit)
## to build up a state.
## (If you want a `step` function which receives a #Str instead of an #U8, see #Str.walkGraphemes.)

View File

@ -1,9 +1,9 @@
[package]
name = "roc_can"
version = "0.1.0"
authors = ["Richard Feldman <oss@rtfeldman.com>"]
edition = "2018"
authors = ["The Roc Contributors"]
license = "Apache-2.0"
edition = "2018"
[dependencies]
roc_collections = { path = "../collections" }

View File

@ -1,7 +1,8 @@
[package]
name = "roc_collections"
version = "0.1.0"
authors = ["Richard Feldman <oss@rtfeldman.com>"]
authors = ["The Roc Contributors"]
license = "Apache-2.0"
edition = "2018"
[dependencies]

View File

@ -1,9 +1,9 @@
[package]
name = "roc_constrain"
version = "0.1.0"
authors = ["Richard Feldman <oss@rtfeldman.com>"]
edition = "2018"
authors = ["The Roc Contributors"]
license = "Apache-2.0"
edition = "2018"
[dependencies]
roc_collections = { path = "../collections" }

View File

@ -1,9 +1,9 @@
[package]
name = "roc_fmt"
version = "0.1.0"
authors = ["Richard Feldman <oss@rtfeldman.com>"]
edition = "2018"
authors = ["The Roc Contributors"]
license = "Apache-2.0"
edition = "2018"
[dependencies]
roc_collections = { path = "../collections" }

View File

@ -1,9 +1,9 @@
[package]
name = "roc_gen"
version = "0.1.0"
authors = ["Richard Feldman <oss@rtfeldman.com>"]
edition = "2018"
authors = ["The Roc Contributors"]
license = "Apache-2.0"
edition = "2018"
[dependencies]
roc_collections = { path = "../collections" }

View File

@ -1,9 +1,9 @@
[package]
name = "roc_gen_dev"
version = "0.1.0"
authors = ["Richard Feldman <oss@rtfeldman.com>"]
edition = "2018"
authors = ["The Roc Contributors"]
license = "Apache-2.0"
edition = "2018"
[dependencies]
roc_collections = { path = "../collections" }

View File

@ -1,9 +1,9 @@
[package]
name = "roc_load"
version = "0.1.0"
authors = ["Richard Feldman <oss@rtfeldman.com>"]
edition = "2018"
authors = ["The Roc Contributors"]
license = "Apache-2.0"
edition = "2018"
[dependencies]
roc_collections = { path = "../collections" }

View File

@ -1,7 +1,7 @@
[package]
name = "roc_module"
version = "0.1.0"
authors = ["Richard Feldman <oss@rtfeldman.com>"]
authors = ["The Roc Contributors"]
edition = "2018"
license = "Apache-2.0"

View File

@ -1,9 +1,9 @@
[package]
name = "roc_mono"
version = "0.1.0"
authors = ["Richard Feldman <oss@rtfeldman.com>"]
edition = "2018"
authors = ["The Roc Contributors"]
license = "Apache-2.0"
edition = "2018"
[dependencies]
roc_collections = { path = "../collections" }

View File

@ -1,9 +1,9 @@
[package]
name = "roc_parse"
version = "0.1.0"
authors = ["Richard Feldman <oss@rtfeldman.com>"]
edition = "2018"
authors = ["The Roc Contributors"]
license = "Apache-2.0"
edition = "2018"
[dependencies]
roc_collections = { path = "../collections" }

View File

@ -71,6 +71,7 @@ pub struct InterfaceHeader<'a> {
pub imports: Vec<'a, Loc<ImportsEntry<'a>>>,
// Potential comments and newlines - these will typically all be empty.
pub before_header: &'a [CommentOrNewline<'a>],
pub after_interface_keyword: &'a [CommentOrNewline<'a>],
pub before_exposes: &'a [CommentOrNewline<'a>],
pub after_exposes: &'a [CommentOrNewline<'a>],
@ -93,6 +94,7 @@ pub struct AppHeader<'a> {
pub to: Loc<To<'a>>,
// Potential comments and newlines - these will typically all be empty.
pub before_header: &'a [CommentOrNewline<'a>],
pub after_app_keyword: &'a [CommentOrNewline<'a>],
pub before_packages: &'a [CommentOrNewline<'a>],
pub after_packages: &'a [CommentOrNewline<'a>],
@ -112,6 +114,7 @@ pub struct PackageHeader<'a> {
pub imports: Vec<'a, Loc<ImportsEntry<'a>>>,
// Potential comments and newlines - these will typically all be empty.
pub before_header: &'a [CommentOrNewline<'a>],
pub after_package_keyword: &'a [CommentOrNewline<'a>],
pub before_exposes: &'a [CommentOrNewline<'a>],
pub after_exposes: &'a [CommentOrNewline<'a>],
@ -132,6 +135,7 @@ pub struct PlatformHeader<'a> {
pub effects: Effects<'a>,
// Potential comments and newlines - these will typically all be empty.
pub before_header: &'a [CommentOrNewline<'a>],
pub after_platform_keyword: &'a [CommentOrNewline<'a>],
pub before_requires: &'a [CommentOrNewline<'a>],
pub after_requires: &'a [CommentOrNewline<'a>],

View File

@ -57,16 +57,37 @@ fn header<'a>() -> impl Parser<'a, Module<'a>, EHeader<'a>> {
one_of![
map!(
skip_first!(keyword_e("app", EHeader::Start), app_header()),
|header| { Module::App { header } }
and!(
space0_e(0, EHeader::Space, EHeader::IndentStart),
skip_first!(keyword_e("app", EHeader::Start), app_header())
),
|(spaces, mut header): (&'a [CommentOrNewline], AppHeader<'a>)| {
header.before_header = spaces;
Module::App { header }
}
),
map!(
skip_first!(keyword_e("platform", EHeader::Start), platform_header()),
|header| { Module::Platform { header } }
and!(
space0_e(0, EHeader::Space, EHeader::IndentStart),
skip_first!(keyword_e("platform", EHeader::Start), platform_header())
),
|(spaces, mut header): (&'a [CommentOrNewline], PlatformHeader<'a>)| {
header.before_header = spaces;
Module::Platform { header }
}
),
map!(
skip_first!(keyword_e("interface", EHeader::Start), interface_header()),
|header| { Module::Interface { header } }
and!(
space0_e(0, EHeader::Space, EHeader::IndentStart),
skip_first!(keyword_e("interface", EHeader::Start), interface_header())
),
|(spaces, mut header): (&'a [CommentOrNewline], InterfaceHeader<'a>)| {
header.before_header = spaces;
Module::Interface { header }
}
)
]
}
@ -89,6 +110,7 @@ fn interface_header<'a>() -> impl Parser<'a, InterfaceHeader<'a>, EHeader<'a>> {
name,
exposes,
imports,
before_header: &[] as &[_],
after_interface_keyword,
before_exposes,
after_exposes,
@ -210,6 +232,7 @@ fn app_header<'a>() -> impl Parser<'a, AppHeader<'a>, EHeader<'a>> {
imports,
provides: provides.entries,
to: provides.to,
before_header: &[] as &[_],
after_app_keyword,
before_packages,
after_packages,
@ -259,6 +282,7 @@ fn platform_header<'a>() -> impl Parser<'a, PlatformHeader<'a>, EHeader<'a>> {
imports,
provides,
effects,
before_header: &[] as &[_],
after_platform_keyword,
before_requires,
after_requires,

View File

@ -2947,6 +2947,7 @@ mod test_parse {
imports,
provides,
to: Located::new(0, 0, 53, 57, To::ExistingPackage("blah")),
before_header: &[],
after_app_keyword: &[],
before_packages: &[],
after_packages: &[],
@ -2981,6 +2982,7 @@ mod test_parse {
let provides = Vec::new_in(&arena);
let module_name = StrLiteral::PlainLine("test-app");
let header = AppHeader {
before_header: &[],
name: Located::new(0, 0, 4, 14, module_name),
packages,
imports,
@ -3033,6 +3035,7 @@ mod test_parse {
let module_name = StrLiteral::PlainLine("quicksort");
let header = AppHeader {
before_header: &[],
name: Located::new(0, 0, 4, 15, module_name),
packages,
imports,
@ -3082,6 +3085,7 @@ mod test_parse {
spaces_after_type_name: &[],
};
let header = PlatformHeader {
before_header: &[],
name: Located::new(0, 0, 9, 23, pkg_name),
requires: Vec::new_in(&arena),
exposes: Vec::new_in(&arena),
@ -3141,6 +3145,7 @@ mod test_parse {
spaces_after_type_name: &[],
};
let header = PlatformHeader {
before_header: &[],
name: Located::new(0, 0, 9, 19, pkg_name),
requires: Vec::new_in(&arena),
exposes: Vec::new_in(&arena),
@ -3187,6 +3192,7 @@ mod test_parse {
let imports = Vec::new_in(&arena);
let module_name = ModuleName::new("Foo");
let header = InterfaceHeader {
before_header: &[],
name: Located::new(0, 0, 10, 13, module_name),
exposes,
imports,
@ -3218,6 +3224,7 @@ mod test_parse {
let imports = Vec::new_in(&arena);
let module_name = ModuleName::new("Foo.Bar.Baz");
let header = InterfaceHeader {
before_header: &[],
name: Located::new(0, 0, 10, 21, module_name),
exposes,
imports,

View File

@ -1,9 +1,9 @@
[package]
name = "roc_problem"
version = "0.1.0"
authors = ["Richard Feldman <oss@rtfeldman.com>"]
edition = "2018"
authors = ["The Roc Contributors"]
license = "Apache-2.0"
edition = "2018"
[dependencies]
roc_collections = { path = "../collections" }

View File

@ -1,7 +1,6 @@
[package]
name = "roc_region"
version = "0.1.0"
authors = ["Richard Feldman <oss@rtfeldman.com>"]
edition = "2018"
authors = ["The Roc Contributors"]
license = "Apache-2.0"
edition = "2018"

View File

@ -1,9 +1,9 @@
[package]
name = "roc_reporting"
version = "0.1.0"
authors = ["Richard Feldman <oss@rtfeldman.com>"]
edition = "2018"
authors = ["The Roc Contributors"]
license = "Apache-2.0"
edition = "2018"
[dependencies]
roc_collections = { path = "../collections" }

View File

@ -1,9 +1,9 @@
[package]
name = "roc_solve"
version = "0.1.0"
authors = ["Richard Feldman <oss@rtfeldman.com>"]
edition = "2018"
authors = ["The Roc Contributors"]
license = "Apache-2.0"
edition = "2018"
[dependencies]
roc_collections = { path = "../collections" }

View File

@ -1,9 +1,9 @@
[package]
name = "roc_str"
version = "0.1.0"
authors = ["Richard Feldman <oss@rtfeldman.com>"]
edition = "2018"
authors = ["The Roc Contributors"]
license = "Apache-2.0"
edition = "2018"
[dependencies]
roc_collections = { path = "../collections" }

View File

@ -1,9 +1,9 @@
[package]
name = "test_gen"
version = "0.1.0"
authors = ["Richard Feldman <oss@rtfeldman.com>"]
edition = "2018"
authors = ["The Roc Contributors"]
license = "Apache-2.0"
edition = "2018"
[dependencies]
roc_gen = { path = "../gen" }
@ -59,4 +59,3 @@ quickcheck = "0.8"
quickcheck_macros = "0.8"
tokio = { version = "0.2", features = ["blocking", "fs", "sync", "rt-threaded"] }
bumpalo = { version = "3.2", features = ["collections"] }

View File

@ -1,9 +1,9 @@
[package]
name = "roc_types"
version = "0.1.0"
authors = ["Richard Feldman <oss@rtfeldman.com>"]
edition = "2018"
authors = ["The Roc Contributors"]
license = "Apache-2.0"
edition = "2018"
[dependencies]
roc_collections = { path = "../collections" }

View File

@ -1,9 +1,9 @@
[package]
name = "roc_unify"
version = "0.1.0"
authors = ["Richard Feldman <oss@rtfeldman.com>"]
edition = "2018"
authors = ["The Roc Contributors"]
license = "Apache-2.0"
edition = "2018"
[dependencies]
roc_collections = { path = "../collections" }

View File

@ -1,7 +1,8 @@
[package]
name = "roc_docs"
version = "0.1.0"
authors = ["Pablo Hirafuji <pablohirafuji@gmail.com>"]
license = "Apache-2.0"
authors = ["The Roc Contributors"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -1,10 +1,10 @@
[package]
name = "roc_editor"
version = "0.1.0"
authors = ["Richard Feldman <oss@rtfeldman.com>"]
authors = ["The Roc Contributors"]
license = "Apache-2.0"
edition = "2018"
description = "An editor for Roc"
license = "Apache-2.0"
exclude = ["src/shaders/*.spv"]
[dependencies]

View File

@ -1,7 +1,8 @@
[package]
name = "host"
version = "0.1.0"
authors = ["Richard Feldman <oss@rtfeldman.com>"]
authors = ["The Roc Contributors"]
license = "Apache-2.0"
edition = "2018"
[lib]

View File

@ -1,7 +1,8 @@
[package]
name = "host"
version = "0.1.0"
authors = ["Richard Feldman <oss@rtfeldman.com>"]
authors = ["The Roc Contributors"]
license = "Apache-2.0"
edition = "2018"
[lib]

View File

@ -1,7 +1,8 @@
[package]
name = "host"
version = "0.1.0"
authors = ["Richard Feldman <oss@rtfeldman.com>"]
authors = ["The Roc Contributors"]
license = "Apache-2.0"
edition = "2018"
[lib]

View File

@ -1,7 +1,8 @@
[package]
name = "host"
version = "0.1.0"
authors = ["Richard Feldman <oss@rtfeldman.com>"]
authors = ["The Roc Contributors"]
license = "Apache-2.0"
edition = "2018"
[lib]

View File

@ -1,7 +1,8 @@
[package]
name = "host"
version = "0.1.0"
authors = ["Richard Feldman <oss@rtfeldman.com>"]
authors = ["The Roc Contributors"]
license = "Apache-2.0"
edition = "2018"
[lib]

View File

@ -1,12 +1,12 @@
[package]
name = "roc_std"
version = "0.1.0"
authors = ["Richard Feldman <oss@rtfeldman.com>"]
authors = ["The Roc Contributors"]
license = "Apache-2.0"
repository = "https://github.com/rtfeldman/roc"
readme = "README.md"
edition = "2018"
description = "Rust representations of Roc data structures"
license = "Apache-2.0"
[dependencies]
libc = "0.2"