Skip to content

Commit 259150c

Browse files
committed
[assembler] Comma is a macro terminator, dot is not.
They are actually hard to distinguish in the copy of the Users Handbook I have. But, looking at page 011 of Leonard Kleinrock's listing for his network simulator, the `HP OS` macro is definitely using as a separator a symbol that lives on the line. While if you look a little further below on the same page, the third instruction in the body of the `MV MX` macro body contains both a dot and a comma. The dot is definitely above the line and looks rounder. So I conclude that the separator character is a comma.
1 parent ded1262 commit 259150c

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

assembler/src/asmlib/parser.rs

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -463,13 +463,26 @@ where
463463
// This list of 16 allowed terminators is exhaustive, see section
464464
// 6-4.5 of the TX-2 User Handbook.
465465
//
466-
// ☛ · = → | ⊃ ≡ ~ < > ∩ ∪ / × ∨ ∧
466+
// ☛ , = → | ⊃ ≡ ~ < > ∩ ∪ / × ∨ ∧
467467
//
468-
// We use a centre dot for the dot symbol because otherwise the
469-
// low position of "." makes it look like part of a subscript.
468+
// The second symbol, in my scanned copy of the Users Handbook
469+
// (page 6-31 of the Nov 1963 Users Handbook), looks like either a
470+
// comma or a dot/full-stop/period. Since a dot is valid in a
471+
// symex name, and because the symbol seems to be taller than it
472+
// is wide, I'm going to assume it is a comma.
473+
//
474+
// They are actually hard to distinguish in the copy of the Users
475+
// Handbook I have. But, looking at page 011 of Leonard
476+
// Kleinrock's listing for his network simulator, the `HP OS`
477+
// macro is definitely using as a separator a symbol that lives on
478+
// the line. If you look a little further below on the same
479+
// page, the third instruction in the body of the `MV MX` macro
480+
// body contains both a dot and a comma. The dot is definitely
481+
// above the line and looks rounder. So I conclude that the
482+
// separator character is a comma.
470483
choice((
471484
just(Tok::Hand(Script::Normal)).to('☛'),
472-
just(Tok::Dot(Script::Normal)).to(lexer::DOT_CHAR),
485+
just(Tok::Comma(Script::Normal)).to(','),
473486
just(Tok::Equals(Script::Normal)).to('='),
474487
just(Tok::Arrow(Script::Normal)).to('→'),
475488
just(Tok::Pipe(Script::Normal)).to('|'),

assembler/src/asmlib/parser/tests.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,11 +1271,11 @@ fn test_macro_arg() {
12711271
);
12721272

12731273
assert_eq!(
1274-
parse_successfully_with("@dot@A02", macro_argument(), no_state_setup),
1274+
parse_successfully_with("@comma@A02", macro_argument(), no_state_setup),
12751275
MacroArgument {
12761276
name: SymbolName::from("A02".to_string()),
1277-
span: span(0..8),
1278-
preceding_terminator: '·',
1277+
span: span(0..10),
1278+
preceding_terminator: ',',
12791279
}
12801280
);
12811281

0 commit comments

Comments
 (0)