tamer: asg::air::meta: Use term "metalinguistic" over "metasyntactic"
The term "metasyntactic" made sense literally---it's a variable in a metalanguage that expands into a context that is able to contribute to the language's syntax. But, the term has a different conventional use in programming that is misleading. The term "metalinguistic" is used in mathematics, to describe a metalanguage or schema atop of a language. This is more fitting. DEV-13163main
parent
b4bbc0d8f0
commit
d2d29d8957
|
@ -223,7 +223,7 @@ impl ParseState for AirAggregate {
|
|||
(PkgTpl(tplst), AirBind(ttok)) => ctx.proxy(tplst, ttok),
|
||||
(PkgTpl(tplst), AirDoc(ttok)) => ctx.proxy(tplst, ttok),
|
||||
|
||||
// Metasyntactic variables (metavariables)
|
||||
// Metavariables
|
||||
(st @ (PkgTpl(_) | PkgExpr(_)), tok @ AirMeta(..)) => {
|
||||
ctx.ret_or_transfer(st, tok, AirMetaAggregate::new())
|
||||
}
|
||||
|
|
|
@ -670,7 +670,7 @@ sum_ir! {
|
|||
/// Subset of [`Air`] tokens for defining [`Tpl`]s.
|
||||
///
|
||||
/// Templates serve as containers for objects that reference
|
||||
/// metasyntactic variables,
|
||||
/// metavariables,
|
||||
/// defined by [`AirMeta::MetaStart`].
|
||||
///
|
||||
/// Template Application
|
||||
|
@ -771,7 +771,7 @@ sum_ir! {
|
|||
},
|
||||
}
|
||||
|
||||
/// Metasyntactic objects.
|
||||
/// Metalinguistic objects.
|
||||
///
|
||||
/// TAME's metalanguage supports the generation of lexemes using
|
||||
/// metavariables.
|
||||
|
@ -781,7 +781,7 @@ sum_ir! {
|
|||
/// yielding objects as if the user had entered the lexemes
|
||||
/// statically.
|
||||
///
|
||||
/// [`AirBind`] is able to utilize metasyntactic variables for
|
||||
/// [`AirBind`] is able to utilize metavariables for
|
||||
/// dynamically generated bindings.
|
||||
enum AirMeta {
|
||||
/// Begin a metavariable definition.
|
||||
|
@ -805,7 +805,7 @@ sum_ir! {
|
|||
span: span,
|
||||
display: |f| write!(
|
||||
f,
|
||||
"open definition of metasyntactic variable",
|
||||
"open definition of metavariable",
|
||||
),
|
||||
},
|
||||
|
||||
|
@ -823,7 +823,7 @@ sum_ir! {
|
|||
span: span,
|
||||
display: |f| write!(
|
||||
f,
|
||||
"close definition of metasyntactic variable",
|
||||
"close definition of metavariable",
|
||||
),
|
||||
},
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ use super::{
|
|||
};
|
||||
use crate::{asg::graph::object::Meta, diagnostic_todo, parse::prelude::*};
|
||||
|
||||
/// Metasyntactic variable (metavariable) parser.
|
||||
/// Metalinguistic variable (metavariable) parser.
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub enum AirMetaAggregate {
|
||||
/// Ready for the start of a metavariable.
|
||||
|
|
|
@ -363,7 +363,7 @@ object_gen! {
|
|||
/// A template definition.
|
||||
Tpl,
|
||||
|
||||
/// Metasyntactic variable (metavariable).
|
||||
/// Metalinguistic variable (metavariable).
|
||||
Meta,
|
||||
|
||||
/// Documentation.
|
||||
|
|
|
@ -151,7 +151,7 @@ pub enum Ident {
|
|||
/// result of template expansion---
|
||||
/// it represents the abstract _idea_ of an identifier,
|
||||
/// to be made concrete at a later time,
|
||||
/// and is not valid outside of a metasyntactic context.
|
||||
/// and is not valid outside of a metalinguistic context.
|
||||
///
|
||||
/// The associated span represents the location that the identifier
|
||||
/// was defined,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Metasyntactic variables represented on the ASG
|
||||
// Metalinguistic objects represented on the ASG
|
||||
//
|
||||
// Copyright (C) 2014-2023 Ryan Specialty, LLC.
|
||||
//
|
||||
|
@ -17,12 +17,18 @@
|
|||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//! Metasyntactic variables on the ASG.
|
||||
//! Metalinguistic objects on the ASG.
|
||||
//!
|
||||
//! Metasyntactic variables
|
||||
//! (sometimes called "metavariables" herein for short)
|
||||
//! Metalinguistic variables[^w],
|
||||
//! called "metavariables" for short,
|
||||
//! have historically been a feature of the template system.
|
||||
//! The canonical metavariable is the template parameter.
|
||||
//!
|
||||
//! [^w]: This term comes from logic; see
|
||||
//! <https://en.wikipedia.org/wiki/Metavariable_(logic)>.
|
||||
//! The term "metasyntactic" was originally used with TAMER,
|
||||
//! but that term generally has a different meaning in programming:
|
||||
//! <https://en.wikipedia.org/wiki/Metasyntactic_variable>.
|
||||
|
||||
use super::{prelude::*, Doc, Ident};
|
||||
use crate::{
|
||||
|
@ -35,7 +41,7 @@ use crate::{
|
|||
};
|
||||
use std::fmt::Display;
|
||||
|
||||
/// Metasyntactic variable (metavariable).
|
||||
/// Metalinguistic variable (metavariable).
|
||||
///
|
||||
/// A metavariable is a lexical construct.
|
||||
/// Its value is a lexeme that represents an [`Ident`],
|
||||
|
@ -105,10 +111,10 @@ impl Display for Meta {
|
|||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||
match self {
|
||||
Self::Required(_) => {
|
||||
write!(f, "metasyntactic parameter with required value")
|
||||
write!(f, "metalinguistic parameter with required value")
|
||||
}
|
||||
Self::ConcatList(_) => {
|
||||
write!(f, "metasyntactic concatenation list")
|
||||
write!(f, "metalinguistic concatenation list")
|
||||
}
|
||||
Self::Lexeme(_, spair) => {
|
||||
write!(f, "lexeme {}", TtQuote::wrap(spair))
|
||||
|
|
Loading…
Reference in New Issue