Skip to content

Commit

Permalink
Merge pull request #222 from Eclalang/issue-#144-char-decl-patch
Browse files Browse the repository at this point in the history
patch char decl
  • Loading branch information
tot0p authored Feb 25, 2024
2 parents 4667acf + 6e998b6 commit 3bc0621
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions interpreter/Decl.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,16 @@ func RunVariableDecl(tree parser.VariableDecl, env *Env) {
env.ErrorHandle.HandleError(0, tree.StartPos(), err.Error(), errorHandler.LevelFatal)
}
env.SetVar(tree.Name, v)
case parser.Char:
c, err := eclaType.NewChar("")
if err != nil {
env.ErrorHandle.HandleError(0, tree.StartPos(), err.Error(), errorHandler.LevelFatal)
}
v, err := eclaType.NewVar(tree.Name, tree.Type, c)
if err != nil {
env.ErrorHandle.HandleError(0, tree.StartPos(), err.Error(), errorHandler.LevelFatal)
}
env.SetVar(tree.Name, v)
}
if eclaType.IsList(tree.Type) {
l, err := eclaType.NewList(tree.Type)
Expand Down

0 comments on commit 3bc0621

Please sign in to comment.