Skip to content

Commit

Permalink
Added support for interactive versions of the "if" and "while" statem…
Browse files Browse the repository at this point in the history
…ent. Further, functions added in the interactive environment will now be type checked directly (not waiting until the function is called). Test cases are added to check the new functionality.

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@2118 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
David Broman committed Feb 15, 2006
1 parent 8ead649 commit 8533b6a
Show file tree
Hide file tree
Showing 6 changed files with 299 additions and 67 deletions.
2 changes: 1 addition & 1 deletion Compiler/ClassLoader.rml
Expand Up @@ -373,7 +373,7 @@ relation load_model_from_each_class:(Absyn.Program,string)
rule let path = Absyn.IDENT(id) &
load_class(path, dir) => pnew &
load_model_from_each_class(Absyn.PROGRAM(res,a),dir) => p_res &
Interactive.update_program(pnew,p_res) => p' &
Interactive.update_program(pnew,p_res) => p'
---------------------------
load_model_from_each_class(Absyn.PROGRAM(Absyn.CLASS(id,_,_,_,_,_,_)::res,
a),
Expand Down
18 changes: 18 additions & 0 deletions Compiler/Dump.rml
Expand Up @@ -108,6 +108,8 @@ module Dump:
relation unparse_comment_option: (Absyn.Comment option) => string
relation unparse_comment_option_no_annotation: (Absyn.Comment option) => string
relation unparse_each_str: (Absyn.Each) => string
relation stdout: () => ()

relation print_info:(Absyn.Info) => ()
relation unparse_info_str:(Absyn.Info) => string
end
Expand Down Expand Up @@ -3284,3 +3286,19 @@ relation indent_str: (int) => string =
--------------------
indent_str(i) => res
end

(** relation: stdout
**
** Prints the text sent to the print buffer (Print.rml) to stdout (i.e.
** using RML standard print). After printing, the print buffer is cleared.
**)
relation stdout: () => () =

rule Print.get_string() => str &
print str &
Print.clear_buf()
------------------------
stdout() => ()
end


0 comments on commit 8533b6a

Please sign in to comment.