mirror of
https://github.com/ParkerTenBroeck/automata.git
synced 2026-06-07 05:28:45 -04:00
Merge branch 'main' into gh-pages
This commit is contained in:
commit
a304f9c3f4
3 changed files with 5 additions and 5 deletions
|
|
@ -111,7 +111,7 @@ impl<'a> Fa<'a> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TL::Item(S("F", _), list) => {
|
TL::Item(S("F", _), list) => {
|
||||||
if final_states.is_empty() {
|
if !final_states.is_empty() {
|
||||||
ctx.emit_error("final states already set", span);
|
ctx.emit_error("final states already set", span);
|
||||||
}
|
}
|
||||||
let Some(list) = list.expect_set(ctx) else {
|
let Some(list) = list.expect_set(ctx) else {
|
||||||
|
|
@ -124,7 +124,7 @@ impl<'a> Fa<'a> {
|
||||||
if states.contains_key(&State(ident)) {
|
if states.contains_key(&State(ident)) {
|
||||||
if final_states
|
if final_states
|
||||||
.insert(State(ident), StateInfo { definition: item.1 })
|
.insert(State(ident), StateInfo { definition: item.1 })
|
||||||
.is_none()
|
.is_some()
|
||||||
{
|
{
|
||||||
ctx.emit_error("final state redefined", item.1);
|
ctx.emit_error("final state redefined", item.1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ impl<'a> Lexer<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn begin_ident(c: char) -> bool {
|
fn begin_ident(c: char) -> bool {
|
||||||
c.is_alphabetic() || c == '_' || (!c.is_ascii() && !c.is_control() && !c.is_whitespace())
|
c.is_alphanumeric() || c == '_' || (!c.is_ascii() && !c.is_control() && !c.is_whitespace())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn continue_ident(c: char) -> bool {
|
fn continue_ident(c: char) -> bool {
|
||||||
|
|
|
||||||
|
|
@ -160,7 +160,7 @@ export function setAutomaton(auto: Machine) {
|
||||||
font,
|
font,
|
||||||
from: to_from[0],
|
from: to_from[0],
|
||||||
to: to_from[1],
|
to: to_from[1],
|
||||||
label: transitions.map(i => i.repr).join("\n"),
|
label: transitions.map(i => i.repr).join(auto.type=="fa"?",":"\n"),
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
edges.add({
|
edges.add({
|
||||||
|
|
@ -168,7 +168,7 @@ export function setAutomaton(auto: Machine) {
|
||||||
font,
|
font,
|
||||||
from: to_from[0],
|
from: to_from[0],
|
||||||
to: to_from[1],
|
to: to_from[1],
|
||||||
label: transitions.map(i => i.repr).join("\n"),
|
label: transitions.map(i => i.repr).join(auto.type=="fa"?",":"\n"),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue