boot2

Playing with the boostrap
git clone https://git.ryansepassi.com/git/boot2.git
Log | Files | Refs | README

commit e01f261694fd6df753bb3e6cf5b27490d44a6752
parent 5fff74b2b6690d5978249b062998d4f15eec8697
Author: Ryan Sepassi <rsepassi@gmail.com>
Date:   Sat, 25 Apr 2026 12:33:55 -0700

M1pp whitespace tests

Diffstat:
Mtests/M1pp/01-passthrough.M1pp | 2+-
Mtests/M1pp/01-passthrough.expected | 2+-
Mtests/M1pp/02-defs.M1pp | 6+++---
Mtests/M1pp/02-defs.expected | 6+++---
Atests/M1pp/18-tight-paren-call.M1pp | 8++++++++
Atests/M1pp/18-tight-paren-call.expected | 8++++++++
Atests/M1pp/19-one-line-macro.M1pp | 3+++
Atests/M1pp/19-one-line-macro.expected | 2++
Atests/M1pp/20-multiline-header.M1pp | 3+++
Atests/M1pp/20-multiline-header.expected | 1+
Atests/M1pp/21-mid-line-directive.M1pp | 3+++
Atests/M1pp/21-mid-line-directive.expected | 3+++
Atests/M1pp/22-paste-across-newlines.M1pp | 3+++
Atests/M1pp/22-paste-across-newlines.expected | 1+
Atests/M1pp/23-one-line-scope.M1pp | 2++
Atests/M1pp/23-one-line-scope.expected | 2++
Atests/M1pp/24-empty-body.M1pp | 2++
Atests/M1pp/24-empty-body.expected | 1+
18 files changed, 50 insertions(+), 8 deletions(-)

diff --git a/tests/M1pp/01-passthrough.M1pp b/tests/M1pp/01-passthrough.M1pp @@ -1,4 +1,4 @@ -## Pass-through fixture: tokenizer + structural %macro skip. +## Pass-through fixture: tokenizer + structural macro-keyword skip. ## No macro calls, no ## paste, no !@%$ or %select. The m1pp expander must ## match the C oracle byte-for-byte on this input. diff --git a/tests/M1pp/01-passthrough.expected b/tests/M1pp/01-passthrough.expected @@ -1,4 +1,4 @@ -## Pass-through fixture: tokenizer + structural %macro skip. +## Pass-through fixture: tokenizer + structural macro-keyword skip. ## No macro calls , no ## paste , no !@%$ or %select. The m1pp expander must ## match the C oracle byte-for-byte on this input. diff --git a/tests/M1pp/02-defs.M1pp b/tests/M1pp/02-defs.M1pp @@ -1,7 +1,7 @@ -## %macro definitions are stored, not invoked. +## Macro definitions are stored, not invoked. ## Defs produce no output; non-def tokens pass through unchanged. ## Exercises: 0/1/many params, multi-token bodies, string body tokens, -## body-internal ## paste, %macro-looking words mid-line, empty body. +## body-internal ## paste, empty body. before %macro A() body one @@ -12,7 +12,7 @@ middle x before ## x after "string in body" %endm -not %macro at line start +between %macro C(p, q, r) p q r %endm diff --git a/tests/M1pp/02-defs.expected b/tests/M1pp/02-defs.expected @@ -1,8 +1,8 @@ -## %macro definitions are stored , not invoked. +## Macro definitions are stored , not invoked. ## Defs produce no output ## Exercises: 0/1/many params , multi-token bodies , string body tokens , -## body-internal ## paste , %macro-looking words mid-line , empty body. +## body-internal ## paste , empty body. before middle -not %macro at line start +between last diff --git a/tests/M1pp/18-tight-paren-call.M1pp b/tests/M1pp/18-tight-paren-call.M1pp @@ -0,0 +1,8 @@ +%macro NIL() +nil +%endm + +%NIL() +%NIL ( extra ) +%NIL +( more ) diff --git a/tests/M1pp/18-tight-paren-call.expected b/tests/M1pp/18-tight-paren-call.expected @@ -0,0 +1,8 @@ + +nil + +nil +( extra ) +nil + +( more ) diff --git a/tests/M1pp/19-one-line-macro.M1pp b/tests/M1pp/19-one-line-macro.M1pp @@ -0,0 +1,3 @@ +%macro N() result %endm +%N() +%N diff --git a/tests/M1pp/19-one-line-macro.expected b/tests/M1pp/19-one-line-macro.expected @@ -0,0 +1,2 @@ +result +result diff --git a/tests/M1pp/20-multiline-header.M1pp b/tests/M1pp/20-multiline-header.M1pp @@ -0,0 +1,3 @@ +%macro PAIR(a, + b) [ a | b ] %endm +%PAIR(1, 2) diff --git a/tests/M1pp/20-multiline-header.expected b/tests/M1pp/20-multiline-header.expected @@ -0,0 +1 @@ +[ 1 | 2 ] diff --git a/tests/M1pp/21-mid-line-directive.M1pp b/tests/M1pp/21-mid-line-directive.M1pp @@ -0,0 +1,3 @@ +emit_me %macro X() inner %endm +result +%X diff --git a/tests/M1pp/21-mid-line-directive.expected b/tests/M1pp/21-mid-line-directive.expected @@ -0,0 +1,3 @@ +emit_me +result +inner diff --git a/tests/M1pp/22-paste-across-newlines.M1pp b/tests/M1pp/22-paste-across-newlines.M1pp @@ -0,0 +1,3 @@ +%macro JOIN(x, y) x ## +y %endm +%JOIN(foo, bar) diff --git a/tests/M1pp/22-paste-across-newlines.expected b/tests/M1pp/22-paste-across-newlines.expected @@ -0,0 +1 @@ +foobar diff --git a/tests/M1pp/23-one-line-scope.M1pp b/tests/M1pp/23-one-line-scope.M1pp @@ -0,0 +1,2 @@ +%scope S ::start %endscope +done diff --git a/tests/M1pp/23-one-line-scope.expected b/tests/M1pp/23-one-line-scope.expected @@ -0,0 +1,2 @@ +:S__start +done diff --git a/tests/M1pp/24-empty-body.M1pp b/tests/M1pp/24-empty-body.M1pp @@ -0,0 +1,2 @@ +%macro A() %endm +before %A() after diff --git a/tests/M1pp/24-empty-body.expected b/tests/M1pp/24-empty-body.expected @@ -0,0 +1 @@ +before after