From d2d29d89575cc6f816ebc401559934888d8d7f71 Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Tue, 11 Jul 2023 13:00:37 -0400 Subject: [PATCH] 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 --- tamer/src/asg/air.rs | 2 +- tamer/src/asg/air/ir.rs | 10 +++++----- tamer/src/asg/air/meta.rs | 2 +- tamer/src/asg/graph/object.rs | 2 +- tamer/src/asg/graph/object/ident.rs | 2 +- tamer/src/asg/graph/object/meta.rs | 20 +++++++++++++------- 6 files changed, 22 insertions(+), 16 deletions(-) diff --git a/tamer/src/asg/air.rs b/tamer/src/asg/air.rs index 9fe576e0..70b96529 100644 --- a/tamer/src/asg/air.rs +++ b/tamer/src/asg/air.rs @@ -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()) } diff --git a/tamer/src/asg/air/ir.rs b/tamer/src/asg/air/ir.rs index 290f11dd..3361e341 100644 --- a/tamer/src/asg/air/ir.rs +++ b/tamer/src/asg/air/ir.rs @@ -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", ), }, diff --git a/tamer/src/asg/air/meta.rs b/tamer/src/asg/air/meta.rs index 30f4c234..c808895f 100644 --- a/tamer/src/asg/air/meta.rs +++ b/tamer/src/asg/air/meta.rs @@ -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. diff --git a/tamer/src/asg/graph/object.rs b/tamer/src/asg/graph/object.rs index 475a4031..8c59073f 100644 --- a/tamer/src/asg/graph/object.rs +++ b/tamer/src/asg/graph/object.rs @@ -363,7 +363,7 @@ object_gen! { /// A template definition. Tpl, - /// Metasyntactic variable (metavariable). + /// Metalinguistic variable (metavariable). Meta, /// Documentation. diff --git a/tamer/src/asg/graph/object/ident.rs b/tamer/src/asg/graph/object/ident.rs index 30a539f9..5eafedb7 100644 --- a/tamer/src/asg/graph/object/ident.rs +++ b/tamer/src/asg/graph/object/ident.rs @@ -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, diff --git a/tamer/src/asg/graph/object/meta.rs b/tamer/src/asg/graph/object/meta.rs index 814e9bd4..4934b72c 100644 --- a/tamer/src/asg/graph/object/meta.rs +++ b/tamer/src/asg/graph/object/meta.rs @@ -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 . -//! 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 +//! . +//! The term "metasyntactic" was originally used with TAMER, +//! but that term generally has a different meaning in programming: +//! . 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))