Rename bang->apply
! syntax item has been referred to as "bang" instead of "apply" in some places, this is fixed Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -12,7 +12,7 @@ lazy_static! {
|
||||
| (?P<lquote>\[)
|
||||
| (?P<rquote>\])
|
||||
| (?P<colon>:)
|
||||
| (?P<bang>!)
|
||||
| (?P<apply>!)
|
||||
| (?P<str>"([^"\\]|\\["'\\ntrb])*")
|
||||
)"#
|
||||
)
|
||||
@@ -103,8 +103,8 @@ impl<'t> Lexer<'t> {
|
||||
self.make_token(Token::RQuote)
|
||||
} else if let Some(_) = cap.name("colon") {
|
||||
self.make_token(Token::Colon)
|
||||
} else if let Some(_) = cap.name("bang") {
|
||||
self.make_token(Token::Bang)
|
||||
} else if let Some(_) = cap.name("apply") {
|
||||
self.make_token(Token::Apply)
|
||||
} else {
|
||||
panic!(
|
||||
"matched lex pattern, but did not catch this capture: {:?}",
|
||||
|
||||
@@ -117,7 +117,7 @@ impl<'t> Parser<'t> {
|
||||
|
||||
pub fn next_atom(&mut self) -> Result<SpAtom> {
|
||||
use Token::*;
|
||||
let token = self.expect_any_token(&[Assign, Word, Float, Int, Str, Bang])?;
|
||||
let token = self.expect_any_token(&[Assign, Word, Float, Int, Str, Apply])?;
|
||||
Ok(self.token_to_atom(token))
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ impl<'t> Parser<'t> {
|
||||
Token::Float => Atom::Float(text.parse().unwrap()),
|
||||
Token::Int => Atom::Int(text.parse().unwrap()),
|
||||
Token::Str => Atom::Str(unescape_string(text)),
|
||||
Token::Bang => Atom::Apply,
|
||||
Token::Apply => Atom::Apply,
|
||||
_ => panic!("invalid token specified for token_to_atom, it should be an atom"),
|
||||
};
|
||||
SpAtom::new(span, atom)
|
||||
|
||||
@@ -27,8 +27,8 @@ pub enum Token {
|
||||
/// Colon.
|
||||
Colon,
|
||||
|
||||
/// Bang (apply).
|
||||
Bang,
|
||||
/// Apply.
|
||||
Apply,
|
||||
}
|
||||
|
||||
impl Token {
|
||||
@@ -43,7 +43,7 @@ impl Token {
|
||||
LQuote => "quote begin",
|
||||
RQuote => "quote end",
|
||||
Colon => "colon",
|
||||
Bang => "bang",
|
||||
Apply => "apply",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ pub struct NativeFrame {
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct QuoteFrame {
|
||||
locals: BTreeMap<Word, Option<Value>>,
|
||||
code: Rc<Vec<Inst>>, // TODO - deduplicate this with some kind of shared pointer
|
||||
code: Rc<Vec<Inst>>,
|
||||
pc: usize,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user