Skip to content

Commit

Permalink
Handle missing change keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
iHiD committed Jan 23, 2025
1 parent b2e823f commit 4d53da1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
2 changes: 1 addition & 1 deletion app/javascript/interpreter/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"error": {
"syntax": {
"ExceededMaximumNumberOfParameters": "Sorry you can't have more than 255 parameters.",
"InvalidAssignmentTarget": "Invalid assignment target.",
"InvalidAssignmentTarget": "Jiki can't work out what you're trying to do here.\n\nDid you miss the `change` keyword?",
"InvalidNumericVariableName": "Invalid variable name \"{{name}}\". Variable names cannot start with a number.",
"InvalidTemplateLiteral": "Invalid template literal.",
"MissingBacktickToTerminateTemplateLiteral": "Missing backtick ('`') to terminate template literal.",
Expand Down
10 changes: 0 additions & 10 deletions app/javascript/interpreter/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,16 +432,6 @@ export class Parser {
const operator = this.previous()
const value = this.assignment()

if (expr instanceof VariableExpression) {
return new ChangeVariableStatement(
expr.name,
operator,
value,
true,
Location.between(expr, value)
)
}

if (expr instanceof GetExpression) {
return new SetExpression(
expr.obj,
Expand Down

0 comments on commit 4d53da1

Please sign in to comment.