Remove the old toy language binary.
Using the org_mode_samples integration tests through the rust test framework has removed the need for the toy language binary and I think removing it will make rust-analyzer less confused about imports. This repository is now solely a library repository.
This commit is contained in:
parent
a267f23e0f
commit
18f8e2562e
@ -3,16 +3,11 @@ name = "toy"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "0BSD"
|
license = "0BSD"
|
||||||
default-run = "toy"
|
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
name = "organic"
|
name = "organic"
|
||||||
path = "src/lib.rs"
|
path = "src/lib.rs"
|
||||||
|
|
||||||
[[bin]]
|
|
||||||
name = "toy"
|
|
||||||
path = "src/main.rs"
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
nom = "7.1.1"
|
nom = "7.1.1"
|
||||||
opentelemetry = "0.17.0"
|
opentelemetry = "0.17.0"
|
||||||
|
17
src/main.rs
17
src/main.rs
@ -1,17 +0,0 @@
|
|||||||
#![feature(round_char_boundary)]
|
|
||||||
use crate::init_tracing::init_telemetry;
|
|
||||||
use crate::init_tracing::shutdown_telemetry;
|
|
||||||
use crate::parser::document;
|
|
||||||
mod init_tracing;
|
|
||||||
mod parser;
|
|
||||||
|
|
||||||
const TEST_DOC: &'static str = include_str!("../toy_language.txt");
|
|
||||||
|
|
||||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|
||||||
init_telemetry()?;
|
|
||||||
let parsed = document(TEST_DOC);
|
|
||||||
println!("{}\n\n\n", TEST_DOC);
|
|
||||||
println!("{:#?}", parsed);
|
|
||||||
shutdown_telemetry()?;
|
|
||||||
Ok(())
|
|
||||||
}
|
|
@ -1,11 +1,63 @@
|
|||||||
use super::Context;
|
use super::Context;
|
||||||
|
use crate::parser::error::CustomError;
|
||||||
|
use crate::parser::error::MyError;
|
||||||
use crate::parser::error::Res;
|
use crate::parser::error::Res;
|
||||||
use crate::parser::greater_element::PropertyDrawer;
|
use crate::parser::greater_element::PropertyDrawer;
|
||||||
|
use crate::parser::util::immediate_in_section;
|
||||||
|
|
||||||
#[tracing::instrument(ret, level = "debug")]
|
#[tracing::instrument(ret, level = "debug")]
|
||||||
pub fn property_drawer<'r, 's>(
|
pub fn property_drawer<'r, 's>(
|
||||||
context: Context<'r, 's>,
|
context: Context<'r, 's>,
|
||||||
input: &'s str,
|
input: &'s str,
|
||||||
) -> Res<&'s str, PropertyDrawer<'s>> {
|
) -> Res<&'s str, PropertyDrawer<'s>> {
|
||||||
|
if immediate_in_section(context, "property-drawer") {
|
||||||
|
return Err(nom::Err::Error(CustomError::MyError(MyError(
|
||||||
|
"Cannot nest objects of the same element",
|
||||||
|
))));
|
||||||
|
}
|
||||||
|
// start_of_line(context, input)?;
|
||||||
|
// let (remaining, _leading_whitespace) = space0(input)?;
|
||||||
|
// let (remaining, (_open_colon, drawer_name, _close_colon, _new_line)) = tuple((
|
||||||
|
// tag(":"),
|
||||||
|
// name,
|
||||||
|
// tag(":"),
|
||||||
|
// recognize(tuple((space0, line_ending))),
|
||||||
|
// ))(remaining)?;
|
||||||
|
|
||||||
|
// let parser_context = context
|
||||||
|
// .with_additional_node(ContextElement::ConsumeTrailingWhitespace(true))
|
||||||
|
// .with_additional_node(ContextElement::Context("drawer"))
|
||||||
|
// .with_additional_node(ContextElement::ExitMatcherNode(ExitMatcherNode {
|
||||||
|
// class: ExitClass::Alpha,
|
||||||
|
// exit_matcher: &drawer_end,
|
||||||
|
// }));
|
||||||
|
|
||||||
|
// let element_matcher = parser_with_context!(element)(&parser_context);
|
||||||
|
// let exit_matcher = parser_with_context!(exit_matcher_parser)(&parser_context);
|
||||||
|
// let (remaining, children) = match consumed(many_till(blank_line, exit_matcher))(remaining) {
|
||||||
|
// Ok((remaining, (whitespace, (_children, _exit_contents)))) => (
|
||||||
|
// remaining,
|
||||||
|
// vec![Element::Paragraph(Paragraph::of_text(whitespace))],
|
||||||
|
// ),
|
||||||
|
// Err(_) => {
|
||||||
|
// let (remaining, (children, _exit_contents)) =
|
||||||
|
// many_till(element_matcher, exit_matcher)(remaining)?;
|
||||||
|
// (remaining, children)
|
||||||
|
// }
|
||||||
|
// };
|
||||||
|
// let (remaining, _end) = drawer_end(&parser_context, remaining)?;
|
||||||
|
|
||||||
|
// let (remaining, _trailing_ws) =
|
||||||
|
// maybe_consume_trailing_whitespace_if_not_exiting(context, remaining)?;
|
||||||
|
// let source = get_consumed(input, remaining);
|
||||||
|
|
||||||
|
// Ok((
|
||||||
|
// remaining,
|
||||||
|
// Drawer {
|
||||||
|
// source,
|
||||||
|
// name: drawer_name,
|
||||||
|
// children,
|
||||||
|
// },
|
||||||
|
// ))
|
||||||
todo!()
|
todo!()
|
||||||
}
|
}
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
foo
|
|
||||||
:drawername:
|
|
||||||
|
|
||||||
|
|
||||||
:end:
|
|
Loading…
x
Reference in New Issue
Block a user