Skip to content

Commit 6daced5

Browse files
Update GH Pages site, add .jekyllignore, clean up tracebacks
1 parent 1e06183 commit 6daced5

File tree

8 files changed

+91
-6
lines changed

8 files changed

+91
-6
lines changed

.jekyllignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Ignore everything by default
2+
*
3+
4+
# Keep this ignore file itself and the attached files only
5+
!.jekyllignore
6+
!404.html
7+
!index.html
8+
!CONTRIBUTING.html
9+
!SPECIFICATION.html
10+
!UNLICENSE.html

404.html

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="viewport" content="width=device-width,initial-scale=1" />
6+
<title>Page Not Found</title>
7+
<link rel="icon" href="./icon.png" />
8+
<style>
9+
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700&display=swap');
10+
@import url('https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;700&display=swap');
11+
body{background:#222;color:#99ddff;font-family:Open Sans, sans-serif;margin:0;padding:1rem}
12+
.container{max-width:1000px;margin:0 auto;text-align:justify;text-justify:inter-word}
13+
.container { text-align:center; margin-top:0; }
14+
pre, code{background:#3c3c3c;color:inherit;font-family:Source Code Pro, monospace;padding:.25rem .5rem}
15+
img{max-width:100%}
16+
.notice{text-align:center;margin-top:2rem}
17+
</style>
18+
</head>
19+
<body>
20+
<div class="container" id="content">Rendering page…</div>
21+
22+
<!-- Markdown source is embedded below. marked.js will render it into #content. -->
23+
<script id="md" type="text/markdown">
24+
# 404
25+
26+
The requested page could not be found.
27+
28+
</script>
29+
30+
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
31+
<script>
32+
document.addEventListener('DOMContentLoaded', function(){
33+
const md = document.getElementById('md').textContent;
34+
const rendered = marked.parse(md);
35+
document.getElementById('content').innerHTML = rendered;
36+
});
37+
</script>
38+
</body>
39+
</html>

CONTRIBUTING.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<meta charset="utf-8" />
55
<meta name="viewport" content="width=device-width,initial-scale=1" />
66
<title>ASM-Lang Contribution Guide</title>
7+
<link rel="icon" href="./icon.png" />
78
<style>
89
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700&display=swap');
910
@import url('https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;700&display=swap');
@@ -14,7 +15,7 @@
1415
</style>
1516
</head>
1617
<body>
17-
<div class="container" id="content">Rendering specification</div>
18+
<div class="container" id="content">Rendering contribution guide</div>
1819

1920
<!-- Markdown source is embedded below. marked.js will render it into #content. -->
2021
<script id="md" type="text/markdown">

SPECIFICATION.html

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
<head>
44
<meta charset="utf-8" />
55
<meta name="viewport" content="width=device-width,initial-scale=1" />
6-
<title>ASM-Lang SPECIFICATION</title>
6+
<title>ASM-Lang Specification</title>
7+
<link rel="icon" href="./icon.png" />
78
<style>
89
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700&display=swap');
910
@import url('https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;700&display=swap');
1011
body{background:#222;color:#99ddff;font-family:Open Sans, sans-serif;margin:0;padding:1rem}
1112
.container{max-width:1000px;margin:0 auto;text-align:justify;text-justify:inter-word}
13+
.container h1{ text-align:center; margin-top:0; }
1214
pre, code{background:#3c3c3c;color:inherit;font-family:Source Code Pro, monospace;padding:.25rem .5rem}
1315
img{max-width:100%}
1416
</style>
@@ -24,6 +26,21 @@
2426
<img alt="ASM-Lang icon" src="./icon.png">
2527
</p>
2628

29+
## Table of contents
30+
31+
- [1. Overview](#1-overview)
32+
- [2. Lexical Structure](#2-lexical-structure)
33+
- [3. Data Model](#3-data-model)
34+
- [4. Statements and Control Flow](#4-statements-and-control-flow)
35+
- [5. Functions](#5-functions)
36+
- [6. Variables and Memory Model](#6-variables-and-memory-model)
37+
- [7. Execution Model and Semantics](#7-execution-model-and-semantics)
38+
- [8. Standard Library](#8-standard-library)
39+
- [9. Tracebacks and Error Reporting](#9-tracebacks-and-error-reporting)
40+
- [10. Interpreter Use](#10-interpreter-use)
41+
- [11. REPL (Interactive Mode)](#11-repl-interactive-mode)
42+
- [12. Operators, Functions, and Statements](#12-operators-functions-and-statements)
43+
2744
This document specifies an imperative programming language with a binary integer data model and an explicit small-step execution semantics. A program is compiled into an initial machine state (a seed configuration) and then executed solely by repeatedly applying a fixed, program-independent state-transition (rewrite) function. All intermediate states are (semi-)human-readable and serializable, and execution can be traced and replayed exactly, including I/O and nondeterministic choices, which are modeled explicitly for deterministic replay.
2845

2946
## 1. Overview

UNLICENSE.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<meta charset="utf-8" />
55
<meta name="viewport" content="width=device-width,initial-scale=1" />
66
<title>ASM-Lang (Un)License</title>
7+
<link rel="icon" href="./icon.png" />
78
<style>
89
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700&display=swap');
910
@import url('https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;700&display=swap');
@@ -14,7 +15,7 @@
1415
</style>
1516
</head>
1617
<body>
17-
<div class="container" id="content">Rendering specification</div>
18+
<div class="container" id="content">Rendering Unlicense</div>
1819

1920
<!-- Markdown source is embedded below. marked.js will render it into #content. -->
2021
<script id="md" type="text/markdown">

asm-lang.exe

937 Bytes
Binary file not shown.

index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<meta charset="utf-8" />
55
<meta name="viewport" content="width=device-width,initial-scale=1" />
66
<title>ASM-Lang</title>
7+
<link rel="icon" href="./icon.png" />
78
<style>
89
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700&display=swap');
910
@import url('https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;700&display=swap');
@@ -15,7 +16,7 @@
1516
</style>
1617
</head>
1718
<body>
18-
<div class="container" id="content">Rendering specification</div>
19+
<div class="container" id="content">Rendering index</div>
1920

2021
<!-- Markdown source is embedded below. marked.js will render it into #content. -->
2122
<script id="md" type="text/markdown">

interpreter.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -944,9 +944,14 @@ def _import(
944944
prev_functions = dict(interpreter.functions)
945945
try:
946946
interpreter._execute_block(program.statements, module_env)
947-
except Exception:
947+
except Exception as exc:
948+
# Restore interpreter function table on error and convert
949+
# unexpected Python exceptions into ASMRuntimeError so they
950+
# are reported using the language's traceback machinery.
948951
interpreter.functions = prev_functions
949-
raise
952+
if isinstance(exc, ASMRuntimeError):
953+
raise
954+
raise ASMRuntimeError(f"Import failed: {exc}", location=location, rewrite_rule="IMPORT")
950955

951956
# Collect functions that were added by executing the module
952957
new_funcs = {n: f for n, f in interpreter.functions.items() if n not in prev_functions}
@@ -1852,6 +1857,17 @@ def run(self) -> None:
18521857
if self.logger.entries:
18531858
error.step_index = self.logger.entries[-1].step_index
18541859
raise
1860+
except Exception as exc:
1861+
# Convert unexpected Python-level exceptions into ASMRuntimeError
1862+
# so callers (REPL/CLI) can format them using ASM-Lang tracebacks.
1863+
loc = None
1864+
if self.logger.entries:
1865+
last = self.logger.entries[-1]
1866+
loc = last.source_location
1867+
wrapped = ASMRuntimeError(f"Internal interpreter error: {exc}", location=loc, rewrite_rule="internal")
1868+
if self.logger.entries:
1869+
wrapped.step_index = self.logger.entries[-1].step_index
1870+
raise wrapped
18551871
else:
18561872
self.call_stack.pop()
18571873

0 commit comments

Comments
 (0)