-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate lexer submodule to separate nix-lexer crate
- Loading branch information
1 parent
76d99ed
commit 2f05fb2
Showing
21 changed files
with
74 additions
and
58 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
[package] | ||
name = "nix-lexer" | ||
version = "0.1.0" | ||
authors = ["Eyal Kalderon <ebkalderon@gmail.com>"] | ||
edition = "2018" | ||
|
||
[features] | ||
default = [] | ||
serialization = ["codespan/serialization", "serde"] | ||
|
||
[dependencies] | ||
codespan = "0.9.1" | ||
nom = { version = "5.1", default-features = false } | ||
nom_locate = "2.0" | ||
smallvec = "1.2" | ||
|
||
serde = { version = "1.0", features = ["derive"], optional = true } | ||
|
||
[dev-dependencies] | ||
criterion = "0.3" | ||
nix-parser = { path = "../nix-parser" } | ||
serde_json = "1.0" | ||
|
||
[[bench]] | ||
name = "lexer" | ||
harness = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,2 @@ | ||
use codespan::Span; | ||
|
||
pub mod ast; | ||
pub mod error; | ||
pub mod lexer; | ||
|
||
/// A trait for converting a value to a `codespan::Span`. | ||
/// | ||
/// This is helpful for getting spanned types from external crates to interoperate with `codespan`. | ||
pub trait ToSpan { | ||
/// Converts the given value to a `Span`. | ||
fn to_span(&self) -> Span; | ||
} | ||
|
||
impl ToSpan for Span { | ||
fn to_span(&self) -> Span { | ||
*self | ||
} | ||
} | ||
|
||
impl<'a, T: ToSpan> ToSpan for &'a T { | ||
fn to_span(&self) -> Span { | ||
(*self).to_span() | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.