diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2023-01-28 12:22:20 -0500 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2023-01-28 12:22:20 -0500 |
| commit | 9820a3c86b00fe480ec11b397887d6d068c51215 (patch) | |
| tree | a6a1863196bcff6fc7ae41bf753a27dfbeb84a3e /src/bootstrap/verify.bqn | |
| parent | 702b0289b311ffe970ef976c40260db373186b62 (diff) | |
Use text order instead of evaluation order for variables in boot3
Diffstat (limited to 'src/bootstrap/verify.bqn')
| -rw-r--r-- | src/bootstrap/verify.bqn | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/bootstrap/verify.bqn b/src/bootstrap/verify.bqn index 88b661f3..6a24dceb 100644 --- a/src/bootstrap/verify.bqn +++ b/src/bootstrap/verify.bqn @@ -9,13 +9,24 @@ t ← (∾∾⟜(@+10)¨)¨ (¯5⊸↓∾gl˙)⌾⊑⌾⊑ •FLines¨ f # Compi # Check that compiler 𝕩 compiles 𝕩-1 same as full compiler Ver ← { norm ← {𝕎𝕏}˜´ 𝕩 ↑ ⟨ - 4⊸↑ # Strip source info, always - ⋈⁼∘∾⍟=¨⌾(2⊑¨2⊸⊑) # Turn only-dyadic functions to ambivalent, only ≥2 - (⊢-2×34⊸=)⌾⊑ # VARU to VARO, could hit non-opcode numbers, oh well + 4⊸↑ # Strip source info, always + ⋈⁼∘∾⍟=¨⌾(2⊑¨2⊸⊑) # Turn only-dyadic functions to ambivalent if ≥2 + NormVar⌾(⊑⋈2⊑¯1⊑3⊑⊢) # Normalize variable opcodes if =3, defined below ⟩ ! ≡○Norm´ (0‿𝕩⊏c) {𝕎𝕩}¨ (𝕩-1)⊏t •Out ∾⟨"Boot -",'0'+𝕩," verified!"⟩ } +NormVar ← { + ba ← /´'0'-˜⟨ # For each instruction, number of: + "11411311121111111315114131131111=111" # Codes until next opcode + "111000111100000000002221100000000111" # Arguments + ⟩ + Se←≠(>/⊢)∾⟜≠{(⊏˜𝕨)𝕊⍟(≠○(¯1⊸⊑))𝕩∾𝕩⊏𝕨}⟨0⟩˙ + m ← (≠𝕩)↑/⁼ Se (↕≠𝕩)+1+ba(⊣⊏˜≠⊸>×⊢)𝕩 # Mask of opcode starts + 𝕩 (⊢-m∧2×34⊸=)↩ # VARU to VARO + ⟨⊏⟜((↕⊸-3)∾𝕨)⌾((0‿0»m∧𝕩∊32‿33)⊸/) 𝕩,↕≠𝕨⟩ +}˜´ + Ver¨ 1+↕3 •Out "" |
