Skip to content

Commit

Permalink
Removed ExtendedAscii character set
Browse files Browse the repository at this point in the history
  • Loading branch information
zesterer committed Jul 29, 2021
1 parent 150c3a2 commit e3cb394
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 62 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ A fancy compiler diagnostics crate.

## Example

# <img src="misc/example.png" alt="Ariadne supports arbitrary multi-line spans"/>
<a href = "https://github.com/zesterer/ariadne/blob/main/examples/multiline.rs">
<img src="https://raw.githubusercontent.com/zesterer/ariadne/main/misc/example.png" alt="Ariadne supports arbitrary multi-line spans"/>
</a>

See [`examples/`](examples/) for more examples.
See [`examples/`](https://github.com/zesterer/ariadne/tree/main/examples) for more examples.

## About

Expand Down Expand Up @@ -44,10 +46,10 @@ you're thinking of using `ariadne` to process your compiler's output, why not tr

## Stability

The API (should) follow [semver](https://www.semver.org/). However, this does not apply to the layout of final error messages. Minor
tweaks to the internal layout heuristics can often result in the exact format of error messages changing with labels
moving slightly. If you experience a change in layout that you believe to be a regression (either the change is
incorrect, or makes your diagnostics harder to read) then please open an issue.
The API (should) follow [semver](https://www.semver.org/). However, this does not apply to the layout of final error
messages. Minor tweaks to the internal layout heuristics can often result in the exact format of error messages changing
with labels moving slightly. If you experience a change in layout that you believe to be a regression (either the change
is incorrect, or makes your diagnostics harder to read) then please open an issue.

## Credit

Expand Down
23 changes: 0 additions & 23 deletions src/draw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,29 +73,6 @@ impl Characters {
underline: '^',
}
}

pub fn extended_ascii() -> Self {
Self {
hbar: '─',
vbar: '│',
xbar: '┼',
vbar_break: '·',
uarrow: '^',
rarrow: '>',
ltop: '┌',
mtop: 'v',
rtop: '┐',
lbot: '└',
mbot: '^',
rbot: '┘',
lbox: '[',
rbox: ']',
lcross: '├',
rcross: '┤',
underbar: '^',
underline: '^',
}
}
}

/// A trait used to add formatting attributes to displayable items.
Expand Down
33 changes: 1 addition & 32 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,33 +1,4 @@
//! A fancy compiler diagnostics crate.
//!
//! # Example
//!
//! <img src="https://raw.githubusercontent.com/zesterer/ariadne/main/misc/example.png" alt="Multi-line spans"/>
//!
//! # Features
//!
//! - Inline and multi-line labels capable of handling arbitrary configurations of spans
//! - Multi-file errors
//! - Generic across custom spans and file caches
//! - A choice of character sets to ensure compatibility
//! - Coloured labels & highlighting with 256-color support (thanks to [`yansi`](https://github.com/SergioBenitez/yansi))
//! - Label priority and ordering
//! - Compact mode for smaller diagnostics
//! - Correct handling of variable-width characters such as tabs
//! - A plethora of other options (tab width, label attach points, underlines, etc.)
//!
//! ```
//! use ariadne::{Report, ReportKind, Label, Source};
//!
//! Report::build(ReportKind::Error, (), 34)
//! .with_message("Incompatible types")
//! .with_label(Label::new(32..33).with_message("This is of type Nat"))
//! .with_label(Label::new(42..45).with_message("This is of type Str"))
//! .finish()
//! .print(Source::from(include_str!("../examples/sample.tao")))
//! .unwrap();
//!

#![doc = include_str!("../README.md")]
#![deny(missing_docs)]

mod source;
Expand Down Expand Up @@ -299,8 +270,6 @@ pub enum CharSet {
Unicode,
/// ASCII-only characters.
Ascii,
/// Extended ASCII characters.
ExtendedAscii,
}

/// A type used to configure a report
Expand Down
1 change: 0 additions & 1 deletion src/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ impl<S: Span> Report<S> {
let draw = match self.config.char_set {
CharSet::Unicode => draw::Characters::unicode(),
CharSet::Ascii => draw::Characters::ascii(),
CharSet::ExtendedAscii => draw::Characters::extended_ascii(),
};

// --- Header ---
Expand Down

4 comments on commit e3cb394

@oppiliappan
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this removed? These set of characters are present in most fonts, and I'd prefer using this over the CharSet::Unicode.

That sounds rude, but I am just curious.

@zesterer
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this removed? These set of characters are present in most fonts, and I'd prefer using this over the CharSet::Unicode.

That sounds rude, but I am just curious.

I'm happy to add something similar again later, but there are multiple different standards for "extended ASCII" and it's not exactly clear which should be targeted. If you have further thoughts about this I'd love to hear them: a halfway house between pure ASCII and Unicode would be nice!

@oppiliappan
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but there are multiple different standards for "extended ASCII" and it's not exactly clear which should be targeted

Ah I see. I personally liked the box drawing characters for the line markings, and ASCII characters for underlines/annotations. But I get what you mean, it does not follow a standard per se.

@zesterer
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but there are multiple different standards for "extended ASCII" and it's not exactly clear which should be targeted

Ah I see. I personally liked the box drawing characters for the line markings, and ASCII characters for underlines/annotations. But I get what you mean, it does not follow a standard per se.

In terms of visuals, I'll probably allow this to be customised very soon. I'm planning a fairly big rewrite in the next week or two to sort out several existing issues.

Please sign in to comment.