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:
2022-01-12 22:14:54 -08:00
parent 90f27a4108
commit 88080c750b
4 changed files with 9 additions and 9 deletions

View File

@@ -12,7 +12,7 @@ lazy_static! {
| (?P<lquote>\[) | (?P<lquote>\[)
| (?P<rquote>\]) | (?P<rquote>\])
| (?P<colon>:) | (?P<colon>:)
| (?P<bang>!) | (?P<apply>!)
| (?P<str>"([^"\\]|\\["'\\ntrb])*") | (?P<str>"([^"\\]|\\["'\\ntrb])*")
)"# )"#
) )
@@ -103,8 +103,8 @@ impl<'t> Lexer<'t> {
self.make_token(Token::RQuote) self.make_token(Token::RQuote)
} else if let Some(_) = cap.name("colon") { } else if let Some(_) = cap.name("colon") {
self.make_token(Token::Colon) self.make_token(Token::Colon)
} else if let Some(_) = cap.name("bang") { } else if let Some(_) = cap.name("apply") {
self.make_token(Token::Bang) self.make_token(Token::Apply)
} else { } else {
panic!( panic!(
"matched lex pattern, but did not catch this capture: {:?}", "matched lex pattern, but did not catch this capture: {:?}",

View File

@@ -117,7 +117,7 @@ impl<'t> Parser<'t> {
pub fn next_atom(&mut self) -> Result<SpAtom> { pub fn next_atom(&mut self) -> Result<SpAtom> {
use Token::*; 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)) Ok(self.token_to_atom(token))
} }
@@ -131,7 +131,7 @@ impl<'t> Parser<'t> {
Token::Float => Atom::Float(text.parse().unwrap()), Token::Float => Atom::Float(text.parse().unwrap()),
Token::Int => Atom::Int(text.parse().unwrap()), Token::Int => Atom::Int(text.parse().unwrap()),
Token::Str => Atom::Str(unescape_string(text)), 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"), _ => panic!("invalid token specified for token_to_atom, it should be an atom"),
}; };
SpAtom::new(span, atom) SpAtom::new(span, atom)

View File

@@ -27,8 +27,8 @@ pub enum Token {
/// Colon. /// Colon.
Colon, Colon,
/// Bang (apply). /// Apply.
Bang, Apply,
} }
impl Token { impl Token {
@@ -43,7 +43,7 @@ impl Token {
LQuote => "quote begin", LQuote => "quote begin",
RQuote => "quote end", RQuote => "quote end",
Colon => "colon", Colon => "colon",
Bang => "bang", Apply => "apply",
} }
} }
} }

View File

@@ -34,7 +34,7 @@ pub struct NativeFrame {
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct QuoteFrame { pub struct QuoteFrame {
locals: BTreeMap<Word, Option<Value>>, locals: BTreeMap<Word, Option<Value>>,
code: Rc<Vec<Inst>>, // TODO - deduplicate this with some kind of shared pointer code: Rc<Vec<Inst>>,
pc: usize, pc: usize,
} }