tamer: Introduce NIR (accepting only)
This introduces NIR, but only as an accepting grammar; it doesn't yet emit the NIR IR, beyond TODOs. This modifies `tamec` to, while copying XIR, also attempt to lower NIR to produce parser errors, if any. It does not yet fail compilation, as I just want to be cautious and observe that everything's working properly for a little while as people use it, before I potentially break builds. This is the culmination of months of supporting effort. The NIR grammar is derived from our existing TAME sources internally, which I use for now as a test case until I introduce test cases directly into TAMER later on (I'd do it now, if I hadn't spent so much time on this; I'll start introducing tests as I begin emitting NIR tokens). This is capable of fully parsing our largest system with >900 packages, as well as `core`. `tamec`'s lowering is a mess; that'll be cleaned up in future commits. The same can be said about `tameld`. NIR's grammar has some initial documentation, but this will improve over time as well. The generated docs still need some improvement, too, especially with generated identifiers; I just want to get this out here for testing. DEV-7145main
parent
c420ab2730
commit
419b24f251
|
@ -29,7 +29,7 @@ use std::{
|
|||
env,
|
||||
error::Error,
|
||||
ffi::OsStr,
|
||||
fmt::{self, Display},
|
||||
fmt::{self, Display, Write},
|
||||
fs, io,
|
||||
path::Path,
|
||||
};
|
||||
|
@ -37,8 +37,14 @@ use tamer::{
|
|||
diagnose::{
|
||||
AnnotatedSpan, Diagnostic, FsSpanResolver, Reporter, VisualReporter,
|
||||
},
|
||||
parse::{ParseError, Parsed, UnknownToken},
|
||||
xir,
|
||||
nir::{XirfToNir, XirfToNirError},
|
||||
parse::{Lower, ParseError, Parsed, ParsedObject, UnknownToken},
|
||||
xir::{
|
||||
self,
|
||||
flat::{RefinedText, XirToXirf, XirToXirfError, XirfToken},
|
||||
writer::XmlWriter,
|
||||
Error as XirError, Token as XirToken,
|
||||
},
|
||||
};
|
||||
|
||||
/// Types of commands
|
||||
|
@ -62,51 +68,85 @@ pub fn main() -> Result<(), TamecError> {
|
|||
}
|
||||
|
||||
let dest = Path::new(&output);
|
||||
let mut reporter = VisualReporter::new(FsSpanResolver);
|
||||
|
||||
Ok(())
|
||||
.and_then(|_| {
|
||||
use std::io::{BufReader, BufWriter};
|
||||
use tamer::{
|
||||
fs::{File, PathFile},
|
||||
iter::into_iter_while_ok,
|
||||
xir::{
|
||||
reader::XmlXirReader, writer::XmlWriter,
|
||||
reader::XmlXirReader,
|
||||
DefaultEscaper,
|
||||
},
|
||||
};
|
||||
|
||||
let escaper = DefaultEscaper::default();
|
||||
let mut ebuf = String::new();
|
||||
|
||||
let mut xmlwriter = Default::default();
|
||||
let mut fout = BufWriter::new(fs::File::create(dest)?);
|
||||
|
||||
let PathFile(_, file, ctx): PathFile<BufReader<fs::File>> =
|
||||
PathFile::open(source)?;
|
||||
|
||||
// TODO: This will be progressively refactored as
|
||||
// lowering is finalized.
|
||||
// Parse into XIR and re-lower into XML,
|
||||
// which is similar to a copy but proves that we're able
|
||||
// to parse source files.
|
||||
into_iter_while_ok(
|
||||
XmlXirReader::new(file, &escaper, ctx),
|
||||
let _ = Lower::<
|
||||
ParsedObject<XirToken, XirError>,
|
||||
XirToXirf<64, RefinedText>,
|
||||
>::lower::<_, TamecError>(
|
||||
// TODO: We're just echoing back out XIR,
|
||||
// which will be the same sans some formatting.
|
||||
&mut XmlXirReader::new(file, &escaper, ctx)
|
||||
.inspect(|tok_result| {
|
||||
match tok_result {
|
||||
Ok(Parsed::Object(tok)) => {
|
||||
xmlwriter = tok.write(
|
||||
&mut fout,
|
||||
xmlwriter,
|
||||
&escaper
|
||||
).unwrap();
|
||||
},
|
||||
_ => ()
|
||||
}
|
||||
}),
|
||||
|toks| {
|
||||
toks.filter_map(|parsed| match parsed {
|
||||
Parsed::Object(tok) => Some(tok),
|
||||
_ => None,
|
||||
})
|
||||
.write(&mut fout, Default::default(), &escaper)
|
||||
.map_err(TamecError::from)
|
||||
Lower::<XirToXirf<64, RefinedText>, XirfToNir>::lower(
|
||||
toks,
|
||||
|nir| {
|
||||
// TODO: These errors do not yet fail
|
||||
// compilation.
|
||||
nir.fold(Ok(()), |x, result| match result {
|
||||
Ok(_) => x,
|
||||
Err(e) => {
|
||||
// See below note about buffering.
|
||||
ebuf.clear();
|
||||
writeln!(
|
||||
ebuf,
|
||||
"{}",
|
||||
reporter.render(&e)
|
||||
)?;
|
||||
println!("{ebuf}");
|
||||
|
||||
x
|
||||
}
|
||||
})
|
||||
},
|
||||
)
|
||||
},
|
||||
)?;
|
||||
|
||||
Ok(())
|
||||
})
|
||||
.or_else(|e: TamecError| {
|
||||
let mut reporter = VisualReporter::new(FsSpanResolver);
|
||||
|
||||
// POC: Rendering to a string ensures buffering so that we don't
|
||||
// interleave output between processes,
|
||||
// but we ought to reuse a buffer when we support multiple
|
||||
// errors.
|
||||
// interleave output between processes.
|
||||
let report = reporter.render(&e).to_string();
|
||||
println!("{report}\nfatal: failed to link `{}`", output);
|
||||
println!("{report}\nfatal: failed to compile `{}`", output);
|
||||
|
||||
std::process::exit(1);
|
||||
})
|
||||
|
@ -190,6 +230,8 @@ fn parse_options(opts: Options, args: Vec<String>) -> Result<Command, Fail> {
|
|||
pub enum TamecError {
|
||||
Io(io::Error),
|
||||
XirParseError(ParseError<UnknownToken, xir::Error>),
|
||||
XirfParseError(ParseError<XirToken, XirToXirfError>),
|
||||
NirParseError(ParseError<XirfToken<RefinedText>, XirfToNirError>),
|
||||
XirWriterError(xir::writer::Error),
|
||||
Fmt(fmt::Error),
|
||||
}
|
||||
|
@ -206,6 +248,18 @@ impl From<ParseError<UnknownToken, xir::Error>> for TamecError {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<ParseError<XirToken, XirToXirfError>> for TamecError {
|
||||
fn from(e: ParseError<XirToken, XirToXirfError>) -> Self {
|
||||
Self::XirfParseError(e)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<ParseError<XirfToken<RefinedText>, XirfToNirError>> for TamecError {
|
||||
fn from(e: ParseError<XirfToken<RefinedText>, XirfToNirError>) -> Self {
|
||||
Self::NirParseError(e)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<xir::writer::Error> for TamecError {
|
||||
fn from(e: xir::writer::Error) -> Self {
|
||||
Self::XirWriterError(e)
|
||||
|
@ -223,6 +277,8 @@ impl Display for TamecError {
|
|||
match self {
|
||||
Self::Io(e) => Display::fmt(e, f),
|
||||
Self::XirParseError(e) => Display::fmt(e, f),
|
||||
Self::XirfParseError(e) => Display::fmt(e, f),
|
||||
Self::NirParseError(e) => Display::fmt(e, f),
|
||||
Self::XirWriterError(e) => Display::fmt(e, f),
|
||||
Self::Fmt(e) => Display::fmt(e, f),
|
||||
}
|
||||
|
@ -234,6 +290,8 @@ impl Error for TamecError {
|
|||
match self {
|
||||
Self::Io(e) => Some(e),
|
||||
Self::XirParseError(e) => Some(e),
|
||||
Self::XirfParseError(e) => Some(e),
|
||||
Self::NirParseError(e) => Some(e),
|
||||
Self::XirWriterError(e) => Some(e),
|
||||
Self::Fmt(e) => Some(e),
|
||||
}
|
||||
|
@ -244,6 +302,8 @@ impl Diagnostic for TamecError {
|
|||
fn describe(&self) -> Vec<AnnotatedSpan> {
|
||||
match self {
|
||||
Self::XirParseError(e) => e.describe(),
|
||||
Self::XirfParseError(e) => e.describe(),
|
||||
Self::NirParseError(e) => e.describe(),
|
||||
|
||||
// TODO (will fall back to rendering just the error `Display`)
|
||||
_ => vec![],
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
// We build docs for private items.
|
||||
#![allow(rustdoc::private_intra_doc_links)]
|
||||
// For sym::prefill recursive macro `static_symbols!`.
|
||||
#![recursion_limit = "256"]
|
||||
#![recursion_limit = "512"]
|
||||
|
||||
pub mod global;
|
||||
|
||||
|
@ -88,6 +88,7 @@ pub mod fmt;
|
|||
pub mod fs;
|
||||
pub mod iter;
|
||||
pub mod ld;
|
||||
pub mod nir;
|
||||
pub mod num;
|
||||
pub mod obj;
|
||||
pub mod parse;
|
||||
|
|
|
@ -0,0 +1,184 @@
|
|||
// Normalized source IR
|
||||
//
|
||||
// Copyright (C) 2014-2022 Ryan Specialty Group, LLC.
|
||||
//
|
||||
// This file is part of TAME.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//! Normalized source IR.
|
||||
//!
|
||||
//! This IR is "near" the source code written by the user,
|
||||
//! performing only normalization tasks like desugaring.
|
||||
//! The hope is that all desugaring will be done by templates in the future.
|
||||
//!
|
||||
//! This is a streaming IR,
|
||||
//! meaning that the equivalent AST is not explicitly represented as a
|
||||
//! tree structure in memory.
|
||||
//!
|
||||
//! This IR is lossy and does not retain enough information for code
|
||||
//! formatting---that
|
||||
//! type of operation will require a mapping between
|
||||
//! XIRF and NIR,
|
||||
//! where the latter is used to gather enough context for formatting
|
||||
//! and the former is used as a concrete representation of what the user
|
||||
//! actually typed.
|
||||
|
||||
mod parse;
|
||||
|
||||
use std::{convert::Infallible, error::Error, fmt::Display};
|
||||
|
||||
use crate::{
|
||||
diagnose::{Annotate, Diagnostic},
|
||||
fmt::{DisplayWrapper, TtQuote},
|
||||
parse::{Object, Token},
|
||||
span::Span,
|
||||
sym::SymbolId,
|
||||
xir::{attr::Attr, fmt::TtXmlAttr, QName},
|
||||
};
|
||||
|
||||
pub use parse::{
|
||||
NirParseState as XirfToNir, NirParseStateError_ as XirfToNirError,
|
||||
};
|
||||
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
pub enum Nir {
|
||||
Todo,
|
||||
}
|
||||
|
||||
impl Token for Nir {
|
||||
fn ir_name() -> &'static str {
|
||||
todo!()
|
||||
}
|
||||
|
||||
fn span(&self) -> crate::span::Span {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
||||
impl Object for Nir {}
|
||||
|
||||
impl Display for Nir {
|
||||
fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
||||
// TODO
|
||||
type PkgPath = SymbolId;
|
||||
type PkgTitle = SymbolId;
|
||||
type Title = SymbolId;
|
||||
type ParamName = SymbolId;
|
||||
type ParamType = SymbolId;
|
||||
type Dim = SymbolId;
|
||||
type NumLiteral = SymbolId;
|
||||
type DescLiteral = SymbolId;
|
||||
type ParamDefault = SymbolId;
|
||||
type ParamIdent = SymbolId;
|
||||
type ClassIdent = SymbolId;
|
||||
type ClassIdentList = SymbolId;
|
||||
type BooleanLiteral = SymbolId;
|
||||
type CalcIdent = SymbolId;
|
||||
type ValueIdent = SymbolId;
|
||||
type TplName = SymbolId;
|
||||
type TplParamIdent = SymbolId;
|
||||
type TplMetaIdent = SymbolId;
|
||||
type TypeIdent = SymbolId;
|
||||
type ConstIdent = SymbolId;
|
||||
type TexMathLiteral = SymbolId;
|
||||
type FuncIdent = SymbolId;
|
||||
type ShortDimNumLiteral = SymbolId;
|
||||
type StringLiteral = SymbolId;
|
||||
type IdentType = SymbolId;
|
||||
type AnyIdent = SymbolId;
|
||||
type SymbolTableKey = SymbolId;
|
||||
type IdentDtype = SymbolId;
|
||||
type DynNodeLiteral = SymbolId;
|
||||
type MapTransformLiteral = SymbolId;
|
||||
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
pub enum PkgType {
|
||||
/// Package is intended to produce an executable program.
|
||||
///
|
||||
/// This is specified by the `rater` root node.
|
||||
Prog,
|
||||
/// Package is intended to be imported as a component of a larger
|
||||
/// program.
|
||||
Mod,
|
||||
}
|
||||
|
||||
impl From<Attr> for SymbolId {
|
||||
fn from(attr: Attr) -> Self {
|
||||
match attr {
|
||||
Attr(_, value, _) => value,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
pub struct Literal<const S: SymbolId>;
|
||||
|
||||
impl<const S: SymbolId> TryFrom<Attr> for Literal<S> {
|
||||
type Error = NirAttrParseError;
|
||||
|
||||
fn try_from(attr: Attr) -> Result<Self, Self::Error> {
|
||||
match attr {
|
||||
Attr(_, val, _) if val == S => Ok(Literal),
|
||||
Attr(name, _, aspan) => Err(NirAttrParseError::LiteralMismatch(
|
||||
name,
|
||||
aspan.value_span(),
|
||||
S,
|
||||
)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Infallible> for NirAttrParseError {
|
||||
fn from(x: Infallible) -> Self {
|
||||
match x {}
|
||||
}
|
||||
}
|
||||
|
||||
type ExpectedSymbolId = SymbolId;
|
||||
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
pub enum NirAttrParseError {
|
||||
LiteralMismatch(QName, Span, ExpectedSymbolId),
|
||||
}
|
||||
|
||||
impl Error for NirAttrParseError {
|
||||
fn source(&self) -> Option<&(dyn Error + 'static)> {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
impl Display for NirAttrParseError {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||
match self {
|
||||
Self::LiteralMismatch(name, _, _) => {
|
||||
write!(f, "unexpected value for {}", TtXmlAttr::wrap(name),)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Diagnostic for NirAttrParseError {
|
||||
fn describe(&self) -> Vec<crate::diagnose::AnnotatedSpan> {
|
||||
match self {
|
||||
Self::LiteralMismatch(_, span, expected) => span
|
||||
.error(format!("expecting {}", TtQuote::wrap(expected)))
|
||||
.into(),
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -497,81 +497,190 @@ pub mod st {
|
|||
N8: dec "8",
|
||||
N9: dec "9",
|
||||
|
||||
L_ALL: cid "all",
|
||||
L_ANY: cid "any",
|
||||
L_APPLY: cid "apply",
|
||||
L_APPLY_TEMPLATE: tid "apply-template",
|
||||
L_ARG: cid "arg",
|
||||
L_AS: cid "as",
|
||||
L_BASE_TYPE: tid "base-type",
|
||||
L_BOOLEAN: cid "boolean",
|
||||
L_C: cid "c",
|
||||
L_CAR: cid "car",
|
||||
L_CASE: cid "case",
|
||||
L_CASES: cid "cases",
|
||||
L_CDR: cid "cdr",
|
||||
L_CEIL: cid "ceil",
|
||||
L_CGEN: cid "cgen",
|
||||
L_CLASS: cid "class",
|
||||
L_CLASSIFY: cid "classify",
|
||||
L_CONS: cid "cons",
|
||||
L_CONST: cid "const",
|
||||
L_CORE: cid "core",
|
||||
L_DASH: cid "dash",
|
||||
L_DEFAULT: cid "default",
|
||||
L_DEP: cid "dep",
|
||||
L_DESC: cid "desc",
|
||||
L_DIM: cid "dim",
|
||||
L_DISPLAY: cid "display",
|
||||
L_DOT: cid "dot",
|
||||
L_DTYPE: cid "dtype",
|
||||
L_DYN_NODE: tid "dyn-node",
|
||||
L_ELIG_CLASS_YIELDS: tid "elig-class-yields",
|
||||
L_EMPTY: cid "empty",
|
||||
L_ENUM: cid "enum",
|
||||
L_EQ: cid "eq",
|
||||
L_ERROR: cid "error",
|
||||
L_EXEC: cid "exec",
|
||||
L_EXPAND_BARRIER: tid "expand-barrier",
|
||||
L_EXPAND_FUNCTION: tid "expand-function",
|
||||
L_EXPAND_GROUP: tid "expand-group",
|
||||
L_EXPAND_SEQUENCE: tid "expand-sequence",
|
||||
L_EXPORT: cid "export",
|
||||
L_EXPT: cid "expt",
|
||||
L_EXTERN: cid "extern",
|
||||
L_FALSE: cid "false",
|
||||
L_FLOAT: cid "float",
|
||||
L_FLOOR: cid "floor",
|
||||
L_FOR_EACH: tid "for-each",
|
||||
L_FRAGMENT: cid "fragment",
|
||||
L_FRAGMENTS: cid "fragments",
|
||||
L_FROM: cid "from",
|
||||
L_FUNC: cid "func",
|
||||
L_FUNCTION: cid "function",
|
||||
L_GEN: cid "gen",
|
||||
L_GENERATED: cid "generated",
|
||||
L_GENERATES: cid "generates",
|
||||
L_GENSYM: cid "gensym",
|
||||
L_GENTLE_NO: tid "gentle-no",
|
||||
L_GT: cid "gt",
|
||||
L_GTE: cid "gte",
|
||||
L_ID: cid "id",
|
||||
L_IDENTIFIER: cid "identifier",
|
||||
L_IF: cid "if",
|
||||
L_IGNORE_MISSING: tid "ignore-missing",
|
||||
L_IMPORT: cid "import",
|
||||
L_INDEX: cid "index",
|
||||
L_INLINE_TEMPLATE: tid "inline-template",
|
||||
L_INTEGER: cid "integer",
|
||||
L_ISOVERRIDE: cid "isoverride",
|
||||
L_ITEM: cid "item",
|
||||
L_KEY: cid "key",
|
||||
L_L: cid "l",
|
||||
L_LABEL: cid "label",
|
||||
L_LENGTH_OF: tid "length-of",
|
||||
L_LET: cid "let",
|
||||
L_LOCAL: cid "local",
|
||||
L_LOWER: cid "lower",
|
||||
L_LPARAM: cid "lparam",
|
||||
L_LT: cid "lt",
|
||||
L_LTE: cid "lte",
|
||||
L_LV: cid "lv",
|
||||
L_MAP: cid "map",
|
||||
L_MAP_EXEC: tid "map-exec",
|
||||
L_MAP_FROM: tid "map-from",
|
||||
L_MAP_HEAD: qname "map:head",
|
||||
L_MAP_TAIL: qname "map:tail",
|
||||
L_MATCH: cid "match",
|
||||
L_META: cid "meta",
|
||||
L_METHOD: cid "method",
|
||||
L_NAME: cid "name",
|
||||
L_NAME_PREFIX: tid "name-prefix",
|
||||
L_NE: cid "ne",
|
||||
L_NO: cid "no",
|
||||
L_NOVALIDATE: cid "novalidate",
|
||||
L_OF: cid "of",
|
||||
L_ON: cid "on",
|
||||
L_OTHERWISE: cid "otherwise",
|
||||
L_OVERRIDE: cid "override",
|
||||
L_PACKAGE: cid "package",
|
||||
L_PARAM: cid "param",
|
||||
L_PARAM_ADD: tid "param-add",
|
||||
L_PARAM_CLASS_TO_YIELDS: tid "param-class-to-yields",
|
||||
L_PARAM_COPY: tid "param-copy",
|
||||
L_PARAM_INHERIT: tid "param-inherit",
|
||||
L_PARAM_META: tid "param-meta",
|
||||
L_PARAM_SYM_VALUE: tid "param-sym-value",
|
||||
L_PARAM_TYPEDEF_LOOKUP: tid "param-typedef-lookup",
|
||||
L_PARAM_VALUE: tid "param-value",
|
||||
L_PARENT: cid "parent",
|
||||
L_PASS: cid "pass",
|
||||
L_PATH: cid "path",
|
||||
L_PREFIX: cid "prefix",
|
||||
L_PREPROC: cid "preproc",
|
||||
L_PRODUCT: cid "product",
|
||||
L_PROGRAM: cid "program",
|
||||
L_PROGRAM_MAP: tid "program-map",
|
||||
L_QUOTIENT: cid "quotient",
|
||||
L_RATE: cid "rate",
|
||||
L_RATER: cid "rater",
|
||||
L_RATE_EACH: cid "rate-each",
|
||||
L_RECURSE: cid "recurse",
|
||||
L_RETMAP: cid "retmap",
|
||||
L_RETMAP_EXEC: tid "retmap-exec",
|
||||
L_RETMAP_HEAD: qname "retmap:head",
|
||||
L_RETMAP_TAIL: qname "retmap:tail",
|
||||
L_RETURN_MAP: tid "return-map",
|
||||
L_RMDASH: cid "rmdash",
|
||||
L_RMUNDERSCORE: cid "rmunderscore",
|
||||
L_SCALAR: cid "scalar",
|
||||
L_SECTION: cid "section",
|
||||
L_SET: cid "set",
|
||||
L_SNAKE: cid "snake",
|
||||
L_SRC: cid "src",
|
||||
L_STATIC: cid "static",
|
||||
L_SUFFIX: cid "suffix",
|
||||
L_SUM: cid "sum",
|
||||
L_SYM: cid "sym",
|
||||
L_SYMTABLE: cid "symtable",
|
||||
L_SYM_DEP: cid "sym-dep",
|
||||
L_SYM_DEPS: cid "sym-deps",
|
||||
L_SYM_REF: cid "sym-ref",
|
||||
L_SYM_SET: tid "sym-set",
|
||||
L_T: cid "t",
|
||||
L_TEMPLATE: cid "template",
|
||||
L_TERMINATE: cid "terminate",
|
||||
L_TEXT: cid "text",
|
||||
L_TITLE: cid "title",
|
||||
L_TO: cid "to",
|
||||
L_TPL: cid "tpl",
|
||||
L_TRANSFORM: cid "transform",
|
||||
L_TRANSLATE: cid "translate",
|
||||
L_TRUE: cid "true",
|
||||
L_TYPE: cid "type",
|
||||
L_TYPEDEF: cid "typedef",
|
||||
L_UCFIRST: cid "ucfirst",
|
||||
L_UNION: cid "union",
|
||||
L_UNIQUE: cid "unique",
|
||||
L_UNLESS: cid "unless",
|
||||
L_UPPER: cid "upper",
|
||||
L_UUROOTPATH: cid "__rootpath",
|
||||
L_VALUE: cid "value",
|
||||
L_VALUES: cid "values",
|
||||
L_VALUE_OF: cid "value-of",
|
||||
L_VECTOR: cid "vector",
|
||||
L_VIRTUAL: cid "virtual",
|
||||
L_WARNING: cid "warning",
|
||||
L_WHEN: cid "when",
|
||||
L_WORKSHEET: cid "worksheet",
|
||||
L_XMLNS: cid "xmlns",
|
||||
L_YIELD: cid "yield",
|
||||
L_YIELDS: cid "yields",
|
||||
|
||||
CC_ANY_OF: cid "anyOf",
|
||||
|
||||
L_MAP_UUUHEAD: str ":map:___head",
|
||||
L_MAP_UUUTAIL: str ":map:___tail",
|
||||
L_RETMAP_UUUHEAD: str ":retmap:___head",
|
||||
L_RETMAP_UUUTAIL: str ":retmap:___tail",
|
||||
|
||||
URI_LV_RATER: uri "http://www.lovullo.com/rater",
|
||||
URI_LV_PREPROC: uri "http://www.lovullo.com/rater/preproc",
|
||||
URI_LV_CALC: uri "http://www.lovullo.com/calc",
|
||||
URI_LV_LINKER: uri "http://www.lovullo.com/rater/linker",
|
||||
URI_LV_PREPROC: uri "http://www.lovullo.com/rater/preproc",
|
||||
URI_LV_PROGRAM_MAP: uri "http://www.lovullo.com/rater/map",
|
||||
URI_LV_RATER: uri "http://www.lovullo.com/rater",
|
||||
URI_LV_TPL: uri "http://www.lovullo.com/rater/apply-template",
|
||||
URI_LV_WORKSHEET: uri "http://www.lovullo.com/rater/worksheet",
|
||||
|
||||
// Common whitespace.
|
||||
//
|
||||
|
|
|
@ -99,14 +99,60 @@ pub mod qname {
|
|||
}
|
||||
|
||||
qname_const! {
|
||||
QN_XMLNS_PREPROC: L_XMLNS:L_PREPROC,
|
||||
QN_XMLNS: :L_XMLNS,
|
||||
QN_XMLNS_C: L_XMLNS:L_C,
|
||||
QN_XMLNS_L: L_XMLNS:L_L,
|
||||
QN_XMLNS_LV: L_XMLNS:L_LV,
|
||||
QN_XMLNS_T: L_XMLNS:L_T,
|
||||
|
||||
QN_ALL: :L_ALL,
|
||||
QN_ANY: :L_ANY,
|
||||
QN_ANY_OF: :CC_ANY_OF,
|
||||
QN_APPLY_TEMPLATE: :L_APPLY_TEMPLATE,
|
||||
QN_AS: :L_AS,
|
||||
QN_BASE_TYPE: :L_BASE_TYPE,
|
||||
QN_CLASS: :L_CLASS,
|
||||
QN_CLASSIFY: :L_CLASSIFY,
|
||||
QN_CONST: :L_CONST,
|
||||
QN_CORE: :L_CORE,
|
||||
QN_DASH: :L_DASH,
|
||||
QN_DEFAULT: :L_DEFAULT,
|
||||
QN_DESC: :L_DESC,
|
||||
QN_DIM: :L_DIM,
|
||||
QN_DISPLAY: :L_DISPLAY,
|
||||
QN_DOT: :L_DOT,
|
||||
QN_DTYPE: :L_DTYPE,
|
||||
QN_DYN_NODE: :L_DYN_NODE,
|
||||
QN_ENUM: :L_ENUM,
|
||||
QN_EQ: :L_EQ,
|
||||
QN_ERROR: :L_ERROR,
|
||||
QN_EXPAND_BARRIER: :L_EXPAND_BARRIER,
|
||||
QN_EXPAND_FUNCTION: :L_EXPAND_FUNCTION,
|
||||
QN_EXPAND_GROUP: :L_EXPAND_GROUP,
|
||||
QN_EXPAND_SEQUENCE: :L_EXPAND_SEQUENCE,
|
||||
QN_EXPORT: :L_EXPORT,
|
||||
QN_EXTERN: :L_EXTERN,
|
||||
QN_FOR_EACH: :L_FOR_EACH,
|
||||
QN_FROM: :L_FROM,
|
||||
QN_FUNCTION: :L_FUNCTION,
|
||||
QN_GENERATES: :L_GENERATES,
|
||||
QN_GENSYM: :L_GENSYM,
|
||||
QN_GENTLE_NO: :L_GENTLE_NO,
|
||||
QN_ID: :L_ID,
|
||||
QN_IDENTIFIER: :L_IDENTIFIER,
|
||||
QN_IF: :L_IF,
|
||||
QN_IGNORE_MISSING: :L_IGNORE_MISSING,
|
||||
QN_IMPORT: :L_IMPORT,
|
||||
QN_INDEX: :L_INDEX,
|
||||
QN_INLINE_TEMPLATE: :L_INLINE_TEMPLATE,
|
||||
QN_ISOVERRIDE: :L_ISOVERRIDE,
|
||||
QN_ITEM: :L_ITEM,
|
||||
QN_KEY: :L_KEY,
|
||||
QN_LABEL: :L_LABEL,
|
||||
QN_LOCAL: :L_LOCAL,
|
||||
QN_LOWER: :L_LOWER,
|
||||
QN_LV_IMPORT: L_LV:L_IMPORT,
|
||||
QN_LV_PACKAGE: L_LV:L_PACKAGE,
|
||||
QN_L_DEP: L_L:L_DEP,
|
||||
QN_L_EXEC: L_L:L_EXEC,
|
||||
|
@ -115,20 +161,101 @@ pub mod qname {
|
|||
QN_L_MAP_FROM: L_L:L_MAP_FROM,
|
||||
QN_L_RETMAP_EXEC: L_L:L_RETMAP_EXEC,
|
||||
QN_L_STATIC: L_L:L_STATIC,
|
||||
QN_MAP: :L_MAP,
|
||||
QN_MATCH: :L_MATCH,
|
||||
QN_META: :L_META,
|
||||
QN_METHOD: :L_METHOD,
|
||||
QN_NAME: :L_NAME,
|
||||
QN_NAME_PREFIX: :L_NAME_PREFIX,
|
||||
QN_NO: :L_NO,
|
||||
QN_NOVALIDATE: :L_NOVALIDATE,
|
||||
QN_OF: :L_OF,
|
||||
QN_ON: :L_ON,
|
||||
QN_OVERRIDE: :L_OVERRIDE,
|
||||
QN_PACKAGE: :L_PACKAGE,
|
||||
QN_PARAM: :L_PARAM,
|
||||
QN_PARAM_ADD: :L_PARAM_ADD,
|
||||
QN_PARAM_CLASS_TO_YIELDS: :L_PARAM_CLASS_TO_YIELDS,
|
||||
QN_PARAM_COPY: :L_PARAM_COPY,
|
||||
QN_PARAM_INHERIT: :L_PARAM_INHERIT,
|
||||
QN_PARAM_META: :L_PARAM_META,
|
||||
QN_PARAM_SYM_VALUE: :L_PARAM_SYM_VALUE,
|
||||
QN_PARAM_TYPEDEF_LOOKUP: :L_PARAM_TYPEDEF_LOOKUP,
|
||||
QN_PARAM_VALUE: :L_PARAM_VALUE,
|
||||
QN_PARENT: :L_PARENT,
|
||||
QN_PASS: :L_PASS,
|
||||
QN_PATH: :L_PATH,
|
||||
QN_PREFIX: :L_PREFIX,
|
||||
QN_PROGRAM: :L_PROGRAM,
|
||||
QN_PROGRAM_MAP: :L_PROGRAM_MAP,
|
||||
QN_RATE: :L_RATE,
|
||||
QN_RATER: :L_RATER,
|
||||
QN_RATE_EACH: :L_RATE_EACH,
|
||||
QN_RETURN_MAP: :L_RETURN_MAP,
|
||||
QN_RMDASH: :L_RMDASH,
|
||||
QN_RMUNDERSCORE: :L_RMUNDERSCORE,
|
||||
QN_SCALAR: :L_SCALAR,
|
||||
QN_SECTION: :L_SECTION,
|
||||
QN_SET: :L_SET,
|
||||
QN_SNAKE: :L_SNAKE,
|
||||
QN_SRC: :L_SRC,
|
||||
QN_SUFFIX: :L_SUFFIX,
|
||||
QN_SYM: :L_SYM,
|
||||
QN_SYM_SET: :L_SYM_SET,
|
||||
QN_TEMPLATE: :L_TEMPLATE,
|
||||
QN_TERMINATE: :L_TERMINATE,
|
||||
QN_TEXT: :L_TEXT,
|
||||
QN_TITLE: :L_TITLE,
|
||||
QN_TO: :L_TO,
|
||||
QN_TRANSFORM: :L_TRANSFORM,
|
||||
QN_TRANSLATE: :L_TRANSLATE,
|
||||
QN_TYPE: :L_TYPE,
|
||||
QN_TYPEDEF: :L_TYPEDEF,
|
||||
QN_UCFIRST: :L_UCFIRST,
|
||||
QN_UNION: :L_UNION,
|
||||
QN_UNIQUE: :L_UNIQUE,
|
||||
QN_UNLESS: :L_UNLESS,
|
||||
QN_UPPER: :L_UPPER,
|
||||
QN_UUROOTPATH: :L_UUROOTPATH,
|
||||
QN_VALUE: :L_VALUE,
|
||||
QN_VALUES: :L_VALUES,
|
||||
QN_VIRTUAL: :L_VIRTUAL,
|
||||
QN_XMLNS: :L_XMLNS,
|
||||
QN_XMLNS_L: L_XMLNS:L_L,
|
||||
QN_WARNING: :L_WARNING,
|
||||
QN_WORKSHEET: :L_WORKSHEET,
|
||||
QN_YIELD: :L_YIELD,
|
||||
QN_YIELDS: :L_YIELDS,
|
||||
|
||||
QN_C_APPLY: L_C:L_APPLY,
|
||||
QN_C_ARG: L_C:L_ARG,
|
||||
QN_C_CAR: L_C:L_CAR,
|
||||
QN_C_CASE: L_C:L_CASE,
|
||||
QN_C_CASES: L_C:L_CASES,
|
||||
QN_C_CDR: L_C:L_CDR,
|
||||
QN_C_CEIL: L_C:L_CEIL,
|
||||
QN_C_CONS: L_C:L_CONS,
|
||||
QN_C_CONST: L_C:L_CONST,
|
||||
QN_C_EQ: L_C:L_EQ,
|
||||
QN_C_EXPT: L_C:L_EXPT,
|
||||
QN_C_FLOOR: L_C:L_FLOOR,
|
||||
QN_C_GT: L_C:L_GT,
|
||||
QN_C_GTE: L_C:L_GTE,
|
||||
QN_C_INDEX: L_C:L_INDEX,
|
||||
QN_C_LENGTH_OF: L_C:L_LENGTH_OF,
|
||||
QN_C_LET: L_C:L_LET,
|
||||
QN_C_LT: L_C:L_LT,
|
||||
QN_C_LTE: L_C:L_LTE,
|
||||
QN_C_NE: L_C:L_NE,
|
||||
QN_C_OTHERWISE: L_C:L_OTHERWISE,
|
||||
QN_C_PRODUCT: L_C:L_PRODUCT,
|
||||
QN_C_QUOTIENT: L_C:L_QUOTIENT,
|
||||
QN_C_RECURSE: L_C:L_RECURSE,
|
||||
QN_C_SUM: L_C:L_SUM,
|
||||
QN_C_VALUE: L_C:L_VALUE,
|
||||
QN_C_VALUES: L_C:L_VALUES,
|
||||
QN_C_VALUE_OF: L_C:L_VALUE_OF,
|
||||
QN_C_VECTOR: L_C:L_VECTOR,
|
||||
QN_C_WHEN: L_C:L_WHEN,
|
||||
|
||||
QN_P_ELIG_CLASS_YIELDS: L_PREPROC:L_ELIG_CLASS_YIELDS,
|
||||
QN_P_FRAGMENT: L_PREPROC:L_FRAGMENT,
|
||||
QN_P_FRAGMENTS: L_PREPROC:L_FRAGMENTS,
|
||||
|
@ -139,9 +266,5 @@ pub mod qname {
|
|||
QN_P_SYM_DEP: L_PREPROC:L_SYM_DEP,
|
||||
QN_P_SYM_DEPS: L_PREPROC:L_SYM_DEPS,
|
||||
QN_P_SYM_REF: L_PREPROC:L_SYM_REF,
|
||||
QN_XMLNS_PREPROC: L_XMLNS:L_PREPROC,
|
||||
|
||||
QN_C_EQ: L_C:L_EQ,
|
||||
QN_C_GT: L_C:L_GT,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue