Commits (2)
......@@ -34,12 +34,12 @@ frontEndInterface opt_file_dir_time options mod_ident search_paths cached_dcl_mo
# error = moduleCouldNotBeImportedError True mod_ident NoPos error
= (No,{},{},0,predef_symbols, hash_table, files, error, io, out, tcl_file, heaps)
# (Yes (mod_file,mod_dir,mod_time)) = opt_file_dir_time
#! support_dynamics = tcl_file=:Yes _
# (ok,dynamic_type_used,mod,hash_table,error,files)
= wantModule mod_file mod_time cWantIclFile mod_ident NoPos hash_table error files
= wantModule mod_file mod_time cWantIclFile mod_ident NoPos support_dynamics hash_table error files
| not ok
= (No,{},{},0,predef_symbols, hash_table, files, error, io, out, tcl_file, heaps)
# cached_module_idents = [dcl_mod.dcl_name \\ dcl_mod<-:cached_dcl_modules]
#! support_dynamics = case tcl_file of Yes _ -> True ; No -> False
# (ok, mod, global_fun_range, mod_functions, optional_dcl_mod, modules, dcl_module_n_in_cache,hash_table, error, files)
= scanModule mod cached_module_idents support_dynamics hash_table error search_paths modtimefunction files
......
......@@ -10,7 +10,7 @@ import syntax, hashtable, scanner, predef
cWantIclFile :== True
cWantDclFile :== False
wantModule :: !*File !{#Char} !Bool !Ident !Position !*HashTable !*File !*Files
-> (!Bool,!Bool,!ParsedModule, !*HashTable, !*File, !*Files)
wantModule :: !*File !{#Char} !Bool !Ident !Position !Bool !*HashTable !*File !*Files
-> (!Bool,!Bool,!ParsedModule,!*HashTable,!*File,!*Files)
moduleCouldNotBeImportedError :: !Bool !Ident !Position !*File -> *File
......@@ -37,6 +37,7 @@ Conventions:
PS_SkippingMask :== 1
PS_DynamicTypeUsedMask :== 4
PS_SupportDynamics :== 8
/*
appScanState :: (ScanState -> ScanState) !ParseState -> ParseState
......@@ -304,9 +305,9 @@ isMemberOrWhereOfMemberDefsContext parseContext :== parseContext bitand MemberOr
cWantIclFile :== True
cWantDclFile :== False
wantModule :: !*File !{#Char} !Bool !Ident !Position !*HashTable !*File !*Files
-> (!Bool,!Bool,!ParsedModule, !*HashTable, !*File, !*Files)
wantModule file modification_time iclmodule file_id=:{id_name} import_file_position hash_table error files
wantModule :: !*File !{#Char} !Bool !Ident !Position !Bool !*HashTable !*File !*Files
-> (!Bool,!Bool,!ParsedModule,!*HashTable,!*File,!*Files)
wantModule file modification_time iclmodule file_id=:{id_name} import_file_position support_dynamics hash_table error files
# scanState = openScanner file id_name file_name_extension
# hash_table = set_hte_mark (if iclmodule 1 0) hash_table
hash_table = remove_qualified_idents_from_hash_table hash_table
......@@ -324,7 +325,7 @@ where
| succ
# pState = { ps_scanState = scanState
, ps_error = { pea_file = error, pea_ok = True }
, ps_flags = 0
, ps_flags = if support_dynamics PS_SupportDynamics 0
, ps_hash_table = hash_table
}
pState = verify_name mod_name id_name file_name pState
......@@ -3661,7 +3662,14 @@ where
try CharTypeToken pState = (Yes BT_Char , pState)
try BoolTypeToken pState = (Yes BT_Bool , pState)
try RealTypeToken pState = (Yes BT_Real , pState)
try DynamicTypeToken pState = (Yes BT_Dynamic , {pState & ps_flags=pState.ps_flags bitor PS_DynamicTypeUsedMask})
try DynamicTypeToken pState
| pState.ps_flags bitand PS_DynamicTypeUsedMask<>0
= (Yes BT_Dynamic , pState)
# pState & ps_flags=pState.ps_flags bitor PS_DynamicTypeUsedMask
| pState.ps_flags bitand PS_SupportDynamics<>0
= (Yes BT_Dynamic , pState)
# pState = parseErrorSimpleNoSkipping "Dynamic used but support for dynamics not enabled" pState
= (Yes BT_Dynamic , pState)
try FileTypeToken pState = (Yes BT_File , pState)
try WorldTypeToken pState = (Yes BT_World , pState)
try _ pState = (No , tokenBack pState)
......@@ -5685,7 +5693,6 @@ parseErrorSimple :: !{# Char} !{# Char} !ParseState -> ParseState
parseErrorSimple act msg pState
| pState.ps_flags bitand PS_SkippingMask<>0
= pState
| otherwise // not pState.ps_skipping
# (pos,pState) = getPosition pState
(filename,pState=:{ps_error={pea_file}}) = getFilename pState
pea_file = pea_file
......@@ -5699,6 +5706,15 @@ parseErrorSimple act msg pState
, ps_error = { pea_file = pea_file, pea_ok = False }
}
parseErrorSimpleNoSkipping :: !{# Char} !ParseState -> ParseState
parseErrorSimpleNoSkipping msg pState
| pState.ps_flags bitand PS_SkippingMask<>0
= pState
# (pos,pState) = getPosition pState
(filename,pState=:{ps_error={pea_file}}) = getFilename pState
pea_file = pea_file <<< "Parse error [" <<< filename <<< "," <<< pos <<< "]: " <<< msg <<< '\n'
= {pState & ps_error = {pea_file = pea_file, pea_ok = False}}
getFileAndLineNr :: !ParseState -> (!String, !Int, !ParseState)
getFileAndLineNr pState =: {ps_scanState}
# (filename,scanState) = getFilename ps_scanState
......
......@@ -1130,7 +1130,7 @@ parseAndScanDclModule dcl_module import_file_position parsed_modules cached_modu
= (False, [MakeEmptyModule dcl_module MK_None: parsed_modules],files, ca)
# (Yes (mod_file,mod_dir,mod_time)) = opt_file_dir_time
# (parse_ok,dynamic_type_used,mod, ca_hash_table, err_file, files)
= wantModule mod_file mod_time cWantDclFile dcl_module import_file_position ca_hash_table ca_error.pea_file files
= wantModule mod_file mod_time cWantDclFile dcl_module import_file_position support_dynamics ca_hash_table ca_error.pea_file files
# ca = {ca & ca_hash_table=ca_hash_table, ca_error={pea_file=err_file,pea_ok=True} }
| parse_ok
= scan_dcl_module dcl_module mod parsed_modules searchPaths modtimefunction files ca
......@@ -1227,7 +1227,7 @@ where
= (False, No,NoIndex, [],cached_modules, files, ca)
# (Yes (mod_file,mod_dir,mod_time)) = opt_file_dir_time
# (parse_ok,dynamic_type_used,mod, hash_table, err_file, files)
= wantModule mod_file mod_time cWantDclFile mod_ident NoPos ca_hash_table ca_error.pea_file files
= wantModule mod_file mod_time cWantDclFile mod_ident NoPos support_dynamics ca_hash_table ca_error.pea_file files
# ca = {ca & ca_hash_table=hash_table, ca_error={pea_file=err_file,pea_ok=True}}
| not parse_ok
= (False, No,NoIndex, [],cached_modules, files, ca)
......