Skip to content

Commit

Permalink
Rename nickel-lang to nickel-lang-lib and nickel-lang-cli to nickel-lang
Browse files Browse the repository at this point in the history
  • Loading branch information
vkleen committed Jun 14, 2023
1 parent 636957a commit b08dd47
Show file tree
Hide file tree
Showing 357 changed files with 89 additions and 89 deletions.
34 changes: 17 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[workspace]
resolver = "2"
members = [
"nickel-lang",
"nickel-lang-lib",
"nickel-lang-cli",
"lsp/nls",
"utilities",
Expand Down
4 changes: 2 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
in
rec {
inherit cargoArtifacts;
nickel-lang = buildPackage { pname = "nickel-lang"; };
nickel-lang-lib = buildPackage { pname = "nickel-lang-lib"; };
nickel-lang-cli = buildPackage { pname = "nickel-lang-cli"; };
lsp-nls = buildPackage { pname = "nickel-lang-lsp"; };

Expand Down Expand Up @@ -481,7 +481,7 @@
checkRustDoc
lsp-nls
nickel-lang-cli
nickel-lang
nickel-lang-lib
rustfmt;
# An optimizing release build is long: eschew optimizations in checks by
# building a dev profile
Expand Down
2 changes: 1 addition & 1 deletion lsp/nls/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ lsp-types = "0.88"
log = "0.4"
env_logger = "0.9"
anyhow = "1.0"
nickel-lang = {path = "../../nickel-lang", version = "1.0.0"}
nickel-lang-lib = {path = "../../nickel-lang-lib", version = "1.0.0"}
derive_more = "0.99"
lazy_static = "1"
csv = "1"
Expand Down
2 changes: 1 addition & 1 deletion lsp/nls/src/cache.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::{collections::HashMap, ffi::OsString, io};

use codespan::FileId;
use nickel_lang::{
use nickel_lang_lib::{
cache::{Cache, CacheError, CacheOp, CachedTerm, EntryState},
error::{Error, ImportError},
typecheck::{self, linearization::Linearization},
Expand Down
2 changes: 1 addition & 1 deletion lsp/nls/src/files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use lsp_types::{
notification::{DidOpenTextDocument, Notification},
DidChangeTextDocumentParams, DidOpenTextDocumentParams, PublishDiagnosticsParams, Url,
};
use nickel_lang::{
use nickel_lang_lib::{
cache::{CacheError, CacheOp},
error::IntoDiagnostics,
};
Expand Down
2 changes: 1 addition & 1 deletion lsp/nls/src/linearization/building.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::{collections::HashMap, mem};

use codespan::FileId;
use log::debug;
use nickel_lang::{
use nickel_lang_lib::{
cache::Cache,
identifier::Ident,
position::TermPos,
Expand Down
2 changes: 1 addition & 1 deletion lsp/nls/src/linearization/completed.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::collections::HashMap;

use codespan::{ByteIndex, FileId};
use nickel_lang::{
use nickel_lang_lib::{
position::TermPos, term::record::FieldMetadata, typecheck::linearization::LinearizationState,
};

Expand Down
6 changes: 3 additions & 3 deletions lsp/nls/src/linearization/interface.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use std::collections::HashMap;

use nickel_lang::{identifier::Ident, typecheck::UnifType, types::Types};
use nickel_lang_lib::{identifier::Ident, typecheck::UnifType, types::Types};

use super::ItemId;

pub trait ResolutionState {}
/// Types are available as [nickel_lang::typecheck::UnifType] only during recording. They are
/// resolved after typechecking as [nickel_lang::types::Types]
/// Types are available as [nickel_lang_lib::typecheck::UnifType] only during recording. They are
/// resolved after typechecking as [nickel_lang_lib::types::Types]
pub type Unresolved = UnifType;
impl ResolutionState for Unresolved {}

Expand Down
8 changes: 4 additions & 4 deletions lsp/nls/src/linearization/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::{collections::HashMap, marker::PhantomData};

use codespan::FileId;
use log::debug;
use nickel_lang::{
use nickel_lang_lib::{
cache::ImportResolver,
identifier::Ident,
position::TermPos,
Expand All @@ -28,7 +28,7 @@ pub mod building;
pub mod completed;
pub mod interface;

pub type Environment = nickel_lang::environment::Environment<Ident, ItemId>;
pub type Environment = nickel_lang_lib::environment::Environment<Ident, ItemId>;

#[derive(PartialEq, Copy, Debug, Clone, Eq, Hash)]
pub struct ItemId {
Expand Down Expand Up @@ -95,8 +95,8 @@ impl<'a> AnalysisHost<'a> {
}
}

use nickel_lang::typecheck::Extra;
use nickel_lang::types::Types;
use nickel_lang_lib::typecheck::Extra;
use nickel_lang_lib::types::Types;
impl<'a> Linearizer for AnalysisHost<'a> {
type Building = Building<'a>;
type Completed = Completed;
Expand Down
8 changes: 4 additions & 4 deletions lsp/nls/src/requests/completion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use lsp_server::{RequestId, Response, ResponseError};
use lsp_types::{
CompletionItem, CompletionItemKind, CompletionParams, Documentation, MarkupContent, MarkupKind,
};
use nickel_lang::{
use nickel_lang_lib::{
identifier::Ident,
term::{
record::{Field, FieldMetadata},
Expand Down Expand Up @@ -365,7 +365,7 @@ fn find_fields_from_term(

lazy_static! {
// unwraps are safe here because we know these are correct regexes.
// This regexp must be the same as the regex for identifiers in the lexer (nickel_lang::parser::lexer)
// This regexp must be the same as the regex for identifiers in the lexer (nickel_lang_lib::parser::lexer)
static ref RE_IDENTIFIER: regex::Regex = regex::Regex::new(r"_?[a-zA-Z][_a-zA-Z0-9-']*").unwrap();
static ref RE_SPACE: regex::Regex = regex::Regex::new(r"\s+").unwrap();
}
Expand Down Expand Up @@ -723,7 +723,7 @@ mod tests {
use super::*;
use crate::linearization::Environment;
use codespan::Files;
use nickel_lang::{position::TermPos, term::MergePriority};
use nickel_lang_lib::{position::TermPos, term::MergePriority};
use std::collections::{HashMap, HashSet};

fn make_lin_item(
Expand Down Expand Up @@ -825,7 +825,7 @@ mod tests {

#[test]
fn test_extract_ident_with_path() {
use nickel_lang::{mk_uty_record, mk_uty_row};
use nickel_lang_lib::{mk_uty_record, mk_uty_row};
use std::convert::TryInto;

// Representing the type: {a: {b : {c1 : Num, c2: Num}}}
Expand Down
2 changes: 1 addition & 1 deletion lsp/nls/src/requests/goto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use lsp_server::{RequestId, Response, ResponseError};
use lsp_types::{
GotoDefinitionParams, GotoDefinitionResponse, Location, Range, ReferenceParams, Url,
};
use nickel_lang::position::RawSpan;
use nickel_lang_lib::position::RawSpan;
use serde_json::Value;

use crate::{
Expand Down
2 changes: 1 addition & 1 deletion lsp/nls/src/requests/hover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use codespan_lsp::position_to_byte_index;
use log::debug;
use lsp_server::{RequestId, Response, ResponseError};
use lsp_types::{Hover, HoverContents, HoverParams, LanguageString, MarkedString, Range};
use nickel_lang::position::TermPos;
use nickel_lang_lib::position::TermPos;
use serde_json::Value;

use crate::{
Expand Down
4 changes: 2 additions & 2 deletions lsp/nls/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ use lsp_types::{
WorkDoneProgressOptions,
};

use nickel_lang::{
use nickel_lang_lib::{
cache::{Cache, ErrorTolerance},
identifier::Ident,
stdlib::StdlibModule,
};
use nickel_lang::{stdlib, typecheck::Context};
use nickel_lang_lib::{stdlib, typecheck::Context};

use crate::{
cache::CacheExt,
Expand Down
2 changes: 1 addition & 1 deletion lsp/nls/src/term.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::ops::Range;

use codespan::FileId;
use nickel_lang::position::RawSpan;
use nickel_lang_lib::position::RawSpan;

pub trait RawSpanExt {
fn to_range(self) -> (FileId, Range<usize>);
Expand Down
8 changes: 4 additions & 4 deletions nickel-lang-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "nickel-lang-cli"
name = "nickel-lang"
description = "Common helper functions for the tests and benchmarks of the nickel-lang crate."
authors.workspace = true
edition.workspace = true
Expand All @@ -16,11 +16,11 @@ bench = false

[features]
default = ["repl", "doc"]
repl = ["nickel-lang/repl"]
doc = ["nickel-lang/doc"]
repl = ["nickel-lang-lib/repl"]
doc = ["nickel-lang-lib/doc"]

[dependencies]
nickel-lang = { version = "1.0.0", path = "../nickel-lang", features = [ "markdown" ], default-features = false }
nickel-lang-lib = { version = "1.0.0", path = "../nickel-lang-lib", features = [ "markdown" ], default-features = false }
clap = { version = "4.3", features = ["derive"] }
serde = { version = "1.0.154", features = ["derive"] }

Expand Down
14 changes: 7 additions & 7 deletions nickel-lang-cli/bin/nickel.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//! Entry point of the program.
use core::fmt;
use nickel_lang::error::{Error, IOError};
use nickel_lang::eval::cache::CacheImpl;
use nickel_lang::program::Program;
use nickel_lang::repl::query_print;
use nickel_lang_lib::error::{Error, IOError};
use nickel_lang_lib::eval::cache::CacheImpl;
use nickel_lang_lib::program::Program;
use nickel_lang_lib::repl::query_print;
#[cfg(feature = "repl")]
use nickel_lang::repl::rustyline_frontend;
use nickel_lang::term::RichTerm;
use nickel_lang::{serialize, serialize::ExportFormat};
use nickel_lang_lib::repl::rustyline_frontend;
use nickel_lang_lib::term::RichTerm;
use nickel_lang_lib::{serialize, serialize::ExportFormat};
use std::path::{Path, PathBuf};
use std::{
fs::{self, File},
Expand Down
2 changes: 1 addition & 1 deletion nickel-lang/Cargo.toml → nickel-lang-lib/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "nickel-lang"
name = "nickel-lang-lib"
readme = "README.md"
description = "Programmable configuration files."
authors.workspace = true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::rc::Rc;

use criterion::{criterion_main, Criterion};
use nickel_lang::term::{
use nickel_lang_lib::term::{
array::{Array, ArrayAttrs},
Number, RichTerm, Term,
};
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use criterion::{criterion_group, criterion_main, Criterion};
use pprof::criterion::{Output, PProfProfiler};

use nickel_lang::cache::{Cache, ErrorTolerance};
use nickel_lang_lib::cache::{Cache, ErrorTolerance};

pub fn typecheck_stdlib(c: &mut Criterion) {
let mut cache = Cache::new(ErrorTolerance::Strict);
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ mod tests {
use std::io::Cursor;

use nickel_lang_utilities::{
nickel_lang::{deserialize::RustDeserializationError, term::RichTerm},
nickel_lang_lib::{deserialize::RustDeserializationError, term::RichTerm},
test_program::TestProgram,
};
use serde::Deserialize;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -1705,7 +1705,7 @@ impl std::fmt::Display for RichTerm {
///
/// It is used somehow as a match statement, going from
/// ```
/// # use nickel_lang::term::{RichTerm, Term};
/// # use nickel_lang_lib::term::{RichTerm, Term};
/// let rt = RichTerm::from(Term::Bool(true));
///
/// match rt.term.into_owned() {
Expand All @@ -1716,8 +1716,8 @@ impl std::fmt::Display for RichTerm {
/// ```
/// to
/// ```
/// # use nickel_lang::term::{RichTerm, Term};
/// # use nickel_lang::match_sharedterm;
/// # use nickel_lang_lib::term::{RichTerm, Term};
/// # use nickel_lang_lib::match_sharedterm;
/// let rt = RichTerm::from(Term::Bool(true));
///
/// match_sharedterm!{rt.term, with {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use assert_matches::assert_matches;
use nickel_lang::error::{Error, EvalError};
use nickel_lang_lib::error::{Error, EvalError};
use nickel_lang_utilities::{
annotated_test::{read_annotated_test_case, TestCase},
project_root::project_root,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use assert_matches::assert_matches;
use codespan::Files;
use nickel_lang::error::{Error, EvalError, IntoDiagnostics};
use nickel_lang_lib::error::{Error, EvalError, IntoDiagnostics};

use nickel_lang_utilities::test_program::eval;

#[test]
fn array_contracts_label_path_is_set_correctly() {
use nickel_lang::label::ty_path::Elem;
use nickel_lang_lib::label::ty_path::Elem;

let res = eval("%force% ([{a = [1]}] | Array {a: Array String}) false");
match &res {
Expand Down Expand Up @@ -42,7 +42,7 @@ fn array_contracts_label_path_is_set_correctly() {

#[test]
fn dictionary_contracts_label_path_is_set_correctly() {
use nickel_lang::label::ty_path::Elem;
use nickel_lang_lib::label::ty_path::Elem;

let res = eval("%force% ({foo = 1} | {_ | String}) false");
match &res {
Expand Down
Loading

0 comments on commit b08dd47

Please sign in to comment.