-- NodeStyleExtra.mesa
-- Written by Bill Paxton, January 1981
-- Last changed by Bill Paxton, March 24, 1981 9:38 AM
-- Internal defs for NodeStyle modules
DIRECTORY
NodeStyle,
TextNode,
TextLooks,
JaMOtherDefs,
TiogaJaM;
NodeStyleExtra: DEFINITIONS
IMPORTS NodeStyle, JaMOtherDefs, TiogaJaM =
BEGIN OPEN
NodeStyle,
nodeI:TextNode,
looksI:TextLooks,
tjI:TiogaJaM,
jamI:JaMOtherDefs;
StyleCommand: PROC [text: REF TEXT, proc: PROC];
StyleLiteral: PROC [text: REF TEXT] RETURNS [name: tjI.JaMName];
Command: TYPE = jamI.Command;
cvlit, cvx, def, put, get, dict, attachdict, detachall, abind,
begin, end, run, load, clrdict, where, known, assign, finishSubStyle:
Command;
-- Inlines
GetCommand: PROC [name: tjI.JaMName] RETURNS [c: Command] = INLINE {
flag: BOOLEAN;
[c, flag] ← jamI.TryToGetCommand[LOOPHOLE[name]];
IF ~flag THEN ERROR };
ExecuteCommand: PROC [c: Command] = INLINE {
jamI.ExecuteCommand[c] };
PushCommand: PROC [c: Command] = INLINE {
jamI.PushCommand[c] };
Object: TYPE = jamI.Obj;
PushObject: PROC [ob: Object] = INLINE {
jamI.PushObj[ob] };
PopObject: PROC RETURNS [Object] = INLINE {
RETURN[jamI.PopObj[]] };
PushName: PROC [name: tjI.JaMName] = INLINE {
jamI.PushName[LOOPHOLE[name]] };
PopName: PROC RETURNS [tjI.JaMName] = INLINE {
RETURN [LOOPHOLE[jamI.PopName[]]] };
ExecuteName: PROC [name: tjI.JaMName] RETURNS [BOOLEAN] = INLINE {
RETURN[jamI.ExecuteName[LOOPHOLE[name]]] };
EvalName: PROC [name: tjI.JaMName] = INLINE {
IF ~jamI.ExecuteName[LOOPHOLE[name]] THEN ERROR StyleError };
TryToPopName: PROC RETURNS [name: tjI.JaMName, ok: BOOLEAN] = INLINE {
jname: jamI.Name;
[jname, ok] ← jamI.TryToPopName[];
RETURN [LOOPHOLE[jname],ok]};
PopNameOrReal: PROC RETURNS
[flag: BOOLEAN, name: tjI.JaMName, value: REAL] = INLINE {
jname: jamI.Name;
[flag, jname, value] ← jamI.PopNameOrReal[];
RETURN [flag, LOOPHOLE[jname], value]};
MakeName: PROC [txt: REF READONLY TEXT] RETURNS [tjI.JaMName] = INLINE {
RETURN [LOOPHOLE[tjI.MakeName[LOOPHOLE[txt]]]] };
END.