including contents of other file conflicts with standard libs
Issue #731
resolved
My goal is to have a common part, used in a lot of structures, in a different file. And to then include that common part in a specific structure. For theories there's a merge procedure, but there is none for structures, so I tried to do so using "include", so far no luck.
What am I doing wrong, or ideas on how I can achieve my goal?
include_main.idp:
vocabulary voc{
type Klant
type Bedrag isa int
Aankoop(Klant, Bedrag)
}
theory theo:voc{}
structure struc:voc{
Klant = {Fre}
Bedrag = {0..20}
include "include_2bincluded.idp"
}
include <mx>
procedure main(){
printmodels(modelexpand(theo, struc))
}
include_2bincluded.idp
/**
* Title: A new IDP source file
* Author: Fre
*/
Aankoop = {Fre, 10}
Error:
Error: [string "local function onemodel(T,S)local configIDP = stdspace.configID..."]:34: unexpected symbol near '}' At /home/frederic/idp_install_p/bin/../share/std/mx.idp:7:15
Error: syntax error, unexpected $end At /home/frederic/Dropbox/KUL/master/masterproef/idp_workspace/belfius/include_main.idp:22:1
Comments (3)
-
-
- changed status to resolved
-
@ingdas is invalid niet beter? Vermits dit eigenlijk geen bug is...
- Log in to comment
This can be solved by using a real structure as the "common" structure and merging structures:
you can run this by giving both files as args to IDP