Skip to content

Commit

Permalink
did I make changes?
Browse files Browse the repository at this point in the history
  • Loading branch information
bcpeinhardt committed Aug 25, 2024
1 parent 3a35441 commit a34ee07
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
16 changes: 9 additions & 7 deletions priv/static/squared_away.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2879,7 +2879,7 @@ function do_scan(loop$src, loop$acc) {
throw makeError(
"assignment_no_match",
"squared_away/lang/scanner",
97,
98,
"do_scan",
"Assignment pattern did not match",
{ value: $2 }
Expand Down Expand Up @@ -2911,7 +2911,9 @@ function do_scan(loop$src, loop$acc) {
}
function scan(src) {
let $ = trim2(src);
if ($.startsWith("=")) {
if ($ === "") {
return new Ok(toList([]));
} else if ($.startsWith("=")) {
let rest = $.slice(1);
return do_scan(
(() => {
Expand Down Expand Up @@ -3712,9 +3714,9 @@ function interpret(loop$env, loop$expr) {
throw makeError(
"panic",
"squared_away/lang/interpreter",
62,
65,
"",
"These should be the only options if the typecher is working",
"These should be the only options if the typechecker is working",
{}
);
}
Expand Down Expand Up @@ -3818,7 +3820,7 @@ function interpret(loop$env, loop$expr) {
throw makeError(
"assignment_no_match",
"squared_away/lang/interpreter",
111,
114,
"",
"Assignment pattern did not match",
{ value: $ }
Expand All @@ -3834,7 +3836,7 @@ function interpret(loop$env, loop$expr) {
throw makeError(
"assignment_no_match",
"squared_away/lang/interpreter",
115,
118,
"",
"Assignment pattern did not match",
{ value: $ }
Expand Down Expand Up @@ -3862,7 +3864,7 @@ function interpret(loop$env, loop$expr) {
throw makeError(
"panic",
"squared_away/lang/interpreter",
125,
129,
"",
"these should be the only options if the typechecker is working properly",
{}
Expand Down
3 changes: 1 addition & 2 deletions src/squared_away/lang/interpreter.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import gleam/dict
import gleam/float
import gleam/int
import gleam/result
import gleam/string
import squared_away/lang/environment
import squared_away/lang/parser
import squared_away/lang/scanner
Expand Down Expand Up @@ -63,7 +62,7 @@ pub fn interpret(
Ok(FloatingPointNumber(float.negate(f)))
parser.Not, Boolean(b) -> Ok(Boolean(!b))
_, _ ->
panic as "These should be the only options if the typecher is working"
panic as "These should be the only options if the typechecker is working"
}
}
typechecker.BinaryOp(_, lhs, op, rhs) -> {
Expand Down
1 change: 1 addition & 0 deletions src/squared_away/lang/scanner.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ pub type ScanError {

pub fn scan(src: String) -> Result(List(Token), ScanError) {
case string.trim(src) {
"" -> Ok([])
"=" <> rest -> do_scan(rest |> string.trim_left, [])
_ -> Ok([StringLiteral(src)])
}
Expand Down

0 comments on commit a34ee07

Please sign in to comment.