-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Significant surface language redesign
- Loading branch information
Showing
144 changed files
with
6,371 additions
and
5,297 deletions.
There are no files selected for viewing
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
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,42 @@ | ||
use crate::{Identifier, Path}; | ||
use span::Spanned; | ||
use utilities::{Atom, SmallVec}; | ||
|
||
pub type Attributes = Vec<Attribute>; | ||
pub type Attribute = Spanned<BareAttribute>; | ||
|
||
#[derive(Clone, PartialEq, Eq)] | ||
pub enum BareAttribute { | ||
Regular { | ||
binder: Identifier, | ||
arguments: SmallVec<AttributeArgument, 1>, | ||
}, | ||
Documentation, | ||
} | ||
|
||
pub type AttributeArgument = Spanned<BareAttributeArgument>; | ||
|
||
#[derive(Clone, PartialEq, Eq)] | ||
pub enum BareAttributeArgument { | ||
NumberLiteral(Atom), | ||
TextLiteral(Atom), | ||
Path(Box<Path>), | ||
Named(Box<NamedAttributeArgument>), | ||
} | ||
|
||
impl BareAttributeArgument { | ||
pub const fn name(&self) -> &'static str { | ||
match self { | ||
Self::NumberLiteral(_) => "number literal", | ||
Self::TextLiteral(_) => "text literal", | ||
Self::Path(_) => "path", | ||
Self::Named(_) => "named argument", | ||
} | ||
} | ||
} | ||
|
||
#[derive(Clone, PartialEq, Eq)] | ||
pub struct NamedAttributeArgument { | ||
pub binder: Identifier, | ||
pub value: AttributeArgument, | ||
} |
Oops, something went wrong.