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-13163
main
Mike Gerwitz 2023-07-11 13:00:37 -04:00
parent b4bbc0d8f0
commit d2d29d8957
6 changed files with 22 additions and 16 deletions

View File

@ -223,7 +223,7 @@ impl ParseState for AirAggregate {
(PkgTpl(tplst), AirBind(ttok)) => ctx.proxy(tplst, ttok), (PkgTpl(tplst), AirBind(ttok)) => ctx.proxy(tplst, ttok),
(PkgTpl(tplst), AirDoc(ttok)) => ctx.proxy(tplst, ttok), (PkgTpl(tplst), AirDoc(ttok)) => ctx.proxy(tplst, ttok),
// Metasyntactic variables (metavariables) // Metavariables
(st @ (PkgTpl(_) | PkgExpr(_)), tok @ AirMeta(..)) => { (st @ (PkgTpl(_) | PkgExpr(_)), tok @ AirMeta(..)) => {
ctx.ret_or_transfer(st, tok, AirMetaAggregate::new()) ctx.ret_or_transfer(st, tok, AirMetaAggregate::new())
} }

View File

@ -670,7 +670,7 @@ sum_ir! {
/// Subset of [`Air`] tokens for defining [`Tpl`]s. /// Subset of [`Air`] tokens for defining [`Tpl`]s.
/// ///
/// Templates serve as containers for objects that reference /// Templates serve as containers for objects that reference
/// metasyntactic variables, /// metavariables,
/// defined by [`AirMeta::MetaStart`]. /// defined by [`AirMeta::MetaStart`].
/// ///
/// Template Application /// Template Application
@ -771,7 +771,7 @@ sum_ir! {
}, },
} }
/// Metasyntactic objects. /// Metalinguistic objects.
/// ///
/// TAME's metalanguage supports the generation of lexemes using /// TAME's metalanguage supports the generation of lexemes using
/// metavariables. /// metavariables.
@ -781,7 +781,7 @@ sum_ir! {
/// yielding objects as if the user had entered the lexemes /// yielding objects as if the user had entered the lexemes
/// statically. /// statically.
/// ///
/// [`AirBind`] is able to utilize metasyntactic variables for /// [`AirBind`] is able to utilize metavariables for
/// dynamically generated bindings. /// dynamically generated bindings.
enum AirMeta { enum AirMeta {
/// Begin a metavariable definition. /// Begin a metavariable definition.
@ -805,7 +805,7 @@ sum_ir! {
span: span, span: span,
display: |f| write!( display: |f| write!(
f, f,
"open definition of metasyntactic variable", "open definition of metavariable",
), ),
}, },
@ -823,7 +823,7 @@ sum_ir! {
span: span, span: span,
display: |f| write!( display: |f| write!(
f, f,
"close definition of metasyntactic variable", "close definition of metavariable",
), ),
}, },

View File

@ -28,7 +28,7 @@ use super::{
}; };
use crate::{asg::graph::object::Meta, diagnostic_todo, parse::prelude::*}; use crate::{asg::graph::object::Meta, diagnostic_todo, parse::prelude::*};
/// Metasyntactic variable (metavariable) parser. /// Metalinguistic variable (metavariable) parser.
#[derive(Debug, PartialEq)] #[derive(Debug, PartialEq)]
pub enum AirMetaAggregate { pub enum AirMetaAggregate {
/// Ready for the start of a metavariable. /// Ready for the start of a metavariable.

View File

@ -363,7 +363,7 @@ object_gen! {
/// A template definition. /// A template definition.
Tpl, Tpl,
/// Metasyntactic variable (metavariable). /// Metalinguistic variable (metavariable).
Meta, Meta,
/// Documentation. /// Documentation.

View File

@ -151,7 +151,7 @@ pub enum Ident {
/// result of template expansion--- /// result of template expansion---
/// it represents the abstract _idea_ of an identifier, /// it represents the abstract _idea_ of an identifier,
/// to be made concrete at a later time, /// 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 /// The associated span represents the location that the identifier
/// was defined, /// was defined,

View File

@ -1,4 +1,4 @@
// Metasyntactic variables represented on the ASG // Metalinguistic objects represented on the ASG
// //
// Copyright (C) 2014-2023 Ryan Specialty, LLC. // Copyright (C) 2014-2023 Ryan Specialty, LLC.
// //
@ -17,12 +17,18 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
//! Metasyntactic variables on the ASG. //! Metalinguistic objects on the ASG.
//! //!
//! Metasyntactic variables //! Metalinguistic variables[^w],
//! (sometimes called "metavariables" herein for short) //! called "metavariables" for short,
//! have historically been a feature of the template system. //! have historically been a feature of the template system.
//! The canonical metavariable is the template parameter. //! 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 super::{prelude::*, Doc, Ident};
use crate::{ use crate::{
@ -35,7 +41,7 @@ use crate::{
}; };
use std::fmt::Display; use std::fmt::Display;
/// Metasyntactic variable (metavariable). /// Metalinguistic variable (metavariable).
/// ///
/// A metavariable is a lexical construct. /// A metavariable is a lexical construct.
/// Its value is a lexeme that represents an [`Ident`], /// 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 { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self { match self {
Self::Required(_) => { Self::Required(_) => {
write!(f, "metasyntactic parameter with required value") write!(f, "metalinguistic parameter with required value")
} }
Self::ConcatList(_) => { Self::ConcatList(_) => {
write!(f, "metasyntactic concatenation list") write!(f, "metalinguistic concatenation list")
} }
Self::Lexeme(_, spair) => { Self::Lexeme(_, spair) => {
write!(f, "lexeme {}", TtQuote::wrap(spair)) write!(f, "lexeme {}", TtQuote::wrap(spair))