Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ state:
cargo run -p tur-cli -- examples/binary-addition.tur

# Pipe input to a program
echo '$011-' | cargo run -p tur-cli -- examples/binary-addition.tur
echo '$011' | cargo run -p tur-cli -- examples/binary-addition.tur

# Chaining programs with pipes
echo '$011' | cargo run -p tur-cli -- examples/binary-addition.tur | cargo run -p tur-cli -- examples/binary-addition.tur
Expand Down
4 changes: 2 additions & 2 deletions platforms/web/src/components/graph_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ impl GraphView {
{{ selector: '.current', style: {{ 'background-color': gt.activeNodeColor }} }},
{{ selector: '.previous', style: {{ 'background-color': gt.defaultNodeColor }} }},
{{ selector: '.halt', style: {{ 'background-color': gt.defaultNodeColor }} }},
{{ selector: 'edge', style: {{ 'width': 2, 'line-color': gt.edgeColor, 'target-arrow-color': gt.edgeColor, 'target-arrow-shape': 'triangle', 'curve-style': 'bezier', 'font-size': '12px', 'text-background-color': 'white', 'text-background-opacity': 0.8 }} }},
{{ selector: 'edge', style: {{ 'width': 2, 'line-color': gt.edgeColor, 'target-arrow-color': gt.edgeColor, 'target-arrow-shape': 'triangle', 'curve-style': 'bezier', 'font-family': '"Fira Code", monospace', 'font-size': '12px', 'color': '#444', 'text-background-color': '#F5F7FA', 'text-background-opacity': 0.8 }} }},
{{ selector: 'edge[label]', style: {{ 'label': 'data(label)', 'text-wrap': 'wrap', 'text-max-width': '120px' }} }}
],
layout: {{ name: 'circle', padding: 30 }},
Expand Down Expand Up @@ -313,6 +313,6 @@ impl GraphView {
.collect::<Vec<&str>>()
.join(",");

format!("{}/{}/{}", read_str, write_str, dir_str)
format!("{} -> {}, {}", read_str, write_str, dir_str)
}
}
21 changes: 11 additions & 10 deletions platforms/web/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -668,17 +668,16 @@ body {
.app {
padding: 1.5rem;
}
body {
padding-top: 1rem;
}
body .socials {
position: relative;
margin: 0 1rem 0.2rem;
}
.main-layout, .left-panel, .right-panel {
gap: 1.5rem;
}
.card, .program-selector-section, .editor-section, .tape-view,
.state-display,
.control-panel,
.graph-view,
.multi-tape-view,
.status-section {
/* These styles are now handled by .section */
}
.btn {
padding: 0.7rem 1.4rem;
font-size: 0.9rem;
Expand All @@ -687,10 +686,12 @@ body {

.socials {
position: absolute;
top: 1.5rem;
right: 1.5rem;
right: 0;
top: 0;
display: flex;
justify-content: flex-end;
gap: 5px;
margin: 1.5rem 1.5rem 0 0;
z-index: 10;
}
/* Share Button Styles */
Expand Down
1 change: 1 addition & 0 deletions platforms/web/turing-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ window.addEventListener("load", () => {
nodeTextColor: "white",
edgeTextBackgroundColor: "white",
};

console.log("Graph theme initialized");

// Initialize CodeMirror-based syntax highlighting
Expand Down
12 changes: 6 additions & 6 deletions src/grammar.pest
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,10 @@ state_stop = { "stop:" ~ state ~ ("," ~ state)* }
// =============================================================================
// TRANSITIONS SECTION
// =============================================================================
rules = ${ "rules:" ~ transition_block ~ last_transition_block? }
transition_block = _{ block_start ~ (comment | transition+) ~ block_end ~ transition_block* }
transition = ${ state ~ ":" ~ actions+ }
last_transition_block = _{ block_start ~ (comment | last_transition) ~ block_end }
last_transition = ${ state ~ ":" }
rules = ${ "rules:" ~ transition_block ~ (block_sep ~ last_transition)? }
transition_block = _{ block_start ~ transition ~ (block_sep ~ (comment | transition))* ~ block_end ~ transition_block* }
transition = ${ state ~ ":" ~ actions+ }
last_transition = ${ state ~ ":" }

// =============================================================================
// ACTIONS AND TRANSITIONS
Expand All @@ -63,6 +62,7 @@ direction = { "<" | ">" | "-" | "L" | "R" | "S" }
// =============================================================================
block_start = _{ NEWLINE ~ PEEK_ALL ~ PUSH(INDENT) }
block_end = _{ DROP }
block_sep = _{ NEWLINE+ ~ INDENT }

// =============================================================================
// BASIC ELEMENTS
Expand All @@ -88,6 +88,6 @@ trailing_comment = _{ WHITESPACE+ ~ "#" ~ (!NEWLINE ~ ANY)* }
// =============================================================================
// WHITESPACE AND INDENTATION
// =============================================================================
LEADING = { NEWLINE | comment }
LEADING = _{ NEWLINE | comment }
INDENT = _{ (" " | "\t")+ }
WHITESPACE = _{ " " }
6 changes: 5 additions & 1 deletion src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,11 @@ name: Simple Test
tape: a
rules:
start:
a -> b, R, halt
a -> b, R, other

other:
b -> c, R, halt

halt:
"#;

Expand Down