Verified Commit e9be4a83 authored by Camil Staps's avatar Camil Staps 🚀

Cleanup patches; allow comments before module header in compiler patches

parent 6987d49d
--- /frontend/check.icl 2017-09-03 21:15:17.375092504 +0200
+++ /frontend/check.icl 2017-07-13 23:20:56.000000000 +0200
--- /frontend/check.icl
+++ /frontend/check.icl
@@ -3627,7 +3627,7 @@
= NoIndex
......
--- /frontend/checkFunctionBodies.icl 2017-09-03 21:15:17.311092213 +0200
+++ /frontend/checkFunctionBodies.icl 2017-05-30 14:34:50.000000000 +0200
--- /frontend/checkFunctionBodies.icl
+++ /frontend/checkFunctionBodies.icl
@@ -1939,7 +1939,7 @@
checkPatternVariable :: !Level !SymbolTableEntry !Ident !VarInfoPtr !*CheckState -> *CheckState
checkPatternVariable def_level entry=:{ste_def_level,ste_kind} ident=:{id_info} var_info cs=:{cs_symbol_table,cs_error}
......
--- /frontend/checkgenerics.icl 2017-09-03 21:15:17.307092195 +0200
+++ /frontend/checkgenerics.icl 2017-07-13 23:20:56.000000000 +0200
--- /frontend/checkgenerics.icl
+++ /frontend/checkgenerics.icl
@@ -503,7 +503,7 @@
= (fun,var_heap)
......
--- /frontend/checksupport.icl 2017-09-03 21:15:17.371092486 +0200
+++ /frontend/checksupport.icl 2017-05-30 14:34:50.000000000 +0200
--- /frontend/checksupport.icl
+++ /frontend/checksupport.icl
@@ -216,13 +216,13 @@
= addLocalDclMacroDefsToSymbolTable level module_index (inc from_index) to_index macro_defs symbol_table error
......
--- /frontend/checktypes.icl 2017-09-03 21:15:17.495093051 +0200
+++ /frontend/checktypes.icl 2017-07-13 23:20:56.000000000 +0200
--- /frontend/checktypes.icl
+++ /frontend/checktypes.icl
@@ -743,7 +743,7 @@
| ste_kind == STE_Empty || ste_def_level == cModuleScope
#! (new_attr_ptr, th_attrs) = newPtr AVI_Empty oti_heaps.th_attrs
......
--- /frontend/frontend.icl 2017-09-03 21:15:17.311092213 +0200
+++ /frontend/frontend.icl 2017-05-30 14:34:50.000000000 +0200
--- /frontend/frontend.icl
+++ /frontend/frontend.icl
@@ -316,7 +316,7 @@
newSymbolTable :: !Int -> *{# SymbolTableEntry}
......
--- /frontend/parse.icl 2017-09-03 21:15:17.307092195 +0200
+++ /frontend/parse.icl 2017-07-13 23:20:56.000000000 +0200
--- /frontend/parse.icl
+++ /frontend/parse.icl
@@ -294,7 +294,6 @@
, ps_flags = if support_generics PS_SupportGenericsMask 0
, ps_hash_table = hash_table
......@@ -8,7 +8,7 @@
(mod_ident, pState) = stringToIdent mod_name (IC_Module NoQualifiedIdents) pState
pState = check_layout_rule pState
(defs, pState) = want_definitions (SetGlobalContext iclmodule) pState
@@ -309,7 +309,7 @@
@@ -309,12 +308,12 @@
// otherwise // ~ succ
# ({fp_line}, scanState) = getPosition scanState
mod = { mod_ident = file_id, mod_modification_time = modification_time, mod_type = mod_type, mod_imports = [], mod_imported_objects = [],mod_foreign_exports=[],mod_defs = [] }
......@@ -17,7 +17,26 @@
closeScanner scanState files)
try_module_header :: !Bool !ScanState -> (!Bool,!ModuleKind,!String,!ScanState)
@@ -387,7 +387,32 @@
try_module_header is_icl_mod scanState
- # (token, scanState) = nextToken GeneralContext scanState
+ # (token, scanState) = skipDocTokens GeneralContext scanState
| is_icl_mod
| token == ModuleToken
# (token, scanState) = nextToken ModuleNameContext scanState
@@ -329,6 +328,12 @@
| token == SysModuleToken
= try_module_token MK_System scanState
= (False, MK_None, "", tokenBack scanState)
+ where
+ skipDocTokens context state
+ # (token,state) = nextToken context state
+ | token=:(DocBlockToken _) || token=:(DocLineToken _)
+ = skipDocTokens context state
+ = (token,state)
try_module_token :: !ModuleKind !ScanState -> (!Bool,!ModuleKind,!String,!ScanState)
try_module_token mod_type scanState
@@ -387,8 +392,33 @@
wantDefinitions :: !ParseContext !ParseState -> (![ParsedDefinition], !ParseState)
wantDefinitions parseContext pState
......@@ -42,16 +61,17 @@
+ = ([pd:rest], pState)
+ mergeDocumentation ([], pState)
+ = ([], pState)
+
+ saveDocu :: Ident String ParseState -> ParseState
+ saveDocu {id_info} doc pState=:{ps_hash_table}
+ # (entry,heap) = readPtr id_info ps_hash_table.hte_symbol_heap
+ # ps_hash_table = {ps_hash_table & hte_symbol_heap=writePtr id_info {entry & ste_doc=Yes doc} heap}
+ = {pState & ps_hash_table=ps_hash_table}
+
cHasPriority :== True
cHasNoPriority :== False
@@ -396,9 +421,17 @@
@@ -396,9 +426,17 @@
tryDefinition parseContext pState
# (token, pState) = nextToken GeneralContext pState
(fname, linenr, pState) = getFileAndLineNr pState
......@@ -70,7 +90,7 @@
try_definition parseContext DoubleColonToken pos pState
| ~(isGlobalContext parseContext)
= (False,abort "no def(3)",parseError "definition" No "type definitions only at the global level" (tokenBack pState))
@@ -2394,8 +2427,10 @@
@@ -2394,8 +2432,10 @@
_
-> parseErrorSimple pc_cons_ident.id_name "arity of an infix constructor should be 2" pState
(pc_context,pState) = optional_constructor_context pState
......@@ -82,7 +102,7 @@
= (cons,pState)
want_newtype_constructor :: ![ATypeVar] !Token !ParseState -> (.ParsedConstructor,!ParseState)
@@ -2404,7 +2439,7 @@
@@ -2404,7 +2444,7 @@
(pc_cons_ident, pc_cons_prio, pc_cons_pos, pState) = want_cons_name_and_prio token pState
(succ, pc_arg_type, pState) = trySimpleType TA_Anonymous pState
cons = { pc_cons_ident = pc_cons_ident, pc_arg_types = [pc_arg_type], pc_args_strictness = NotStrict,
......@@ -91,7 +111,7 @@
| succ
= (cons,pState)
= (cons,parseError "newtype definition" No "type" pState)
@@ -2552,9 +2587,11 @@
@@ -2552,9 +2592,11 @@
pState = wantToken TypeContext "record field" DoubleColonToken pState
// (ps_field_type, pState) = want pState // wantAType
(annotation,ps_field_type, pState) = wantAnnotatedAType pState
......@@ -104,7 +124,7 @@
:: SAType = {s_annotation::!Annotation,s_type::!AType}
@@ -5317,6 +5354,16 @@
@@ -5317,6 +5359,16 @@
isDefinesFieldToken CommaToken = True
isDefinesFieldToken token = False
......
--- /frontend/postparse.icl 2017-09-03 21:15:17.475092960 +0200
+++ /frontend/postparse.icl 2017-05-30 14:34:50.000000000 +0200
--- /frontend/postparse.icl
+++ /frontend/postparse.icl
@@ -1452,7 +1452,7 @@
cons_arity = new_count - sel_count
pc_arg_types = [ ps_field_type \\ {ps_field_type} <- sel_defs ]
......
--- /frontend/predef.icl 2017-09-03 21:15:17.311092213 +0200
+++ /frontend/predef.icl 2017-05-30 14:34:50.000000000 +0200
--- /frontend/predef.icl
+++ /frontend/predef.icl
@@ -422,9 +422,9 @@
(list_def, pre_def_symbols) = make_type_def list_type_pre_def_symbol_index [type_var] (AlgType [cons_ds,nil_symb]) pre_def_symbols
list_type = MakeAttributedType (TA (MakeNewTypeSymbIdent list_ident 1) [type_var_with_attr])
......
--- /frontend/scanner.dcl 2017-10-03 17:23:25.118001391 +0200
+++ /frontend/scanner.dcl 2017-05-30 14:34:50.000000000 +0200
--- /frontend/scanner.dcl
+++ /frontend/scanner.dcl
@@ -115,6 +115,9 @@
| ExistsToken // E.
| ForAllToken // A.
......@@ -10,8 +10,8 @@
:: ScanContext
= GeneralContext
| TypeContext
--- /frontend/scanner.icl 2017-09-03 21:15:17.311092213 +0200
+++ /frontend/scanner.icl 2017-07-19 22:16:23.000000000 +0200
--- /frontend/scanner.icl
+++ /frontend/scanner.icl
@@ -203,6 +203,9 @@
| ExistsToken // E.
| ForAllToken // A.
......
--- /frontend/syntax.dcl 2017-10-03 17:23:25.226001936 +0200
+++ /frontend/syntax.dcl 2017-07-13 23:20:56.000000000 +0200
--- /frontend/syntax.dcl
+++ /frontend/syntax.dcl
@@ -7,6 +7,8 @@
from containers import ::NumberSet
from convertcases import :: LetVarInfo, :: LetExpressionInfo, :: RefCountsInCase, :: SplitsInCase
......@@ -52,8 +52,8 @@
}
:: ParsedInstance =
--- /frontend/syntax.icl 2017-09-03 21:15:17.311092213 +0200
+++ /frontend/syntax.icl 2017-05-30 14:34:50.000000000 +0200
--- /frontend/syntax.icl
+++ /frontend/syntax.icl
@@ -1022,7 +1022,7 @@
EmptySymbolTableEntry :== EmptySymbolTableEntryCAF.boxed_symbol_table_entry
......
--- /frontend/transform.icl 2017-09-03 21:15:17.307092195 +0200
+++ /frontend/transform.icl 2017-05-30 14:34:50.000000000 +0200
--- /frontend/transform.icl
+++ /frontend/transform.icl
@@ -661,7 +661,7 @@
-> ([ fc : calls ], symbol_table <:= (id_info, { entry & ste_kind = STE_Called [ FunctionOrIclMacroIndex fc_index : indexes ]}))
_
......
--- /frontend/typereify.icl 2017-09-03 21:15:17.315092231 +0200
+++ /frontend/typereify.icl 2017-05-30 14:34:50.000000000 +0200
--- /frontend/typereify.icl
+++ /frontend/typereify.icl
@@ -237,6 +237,7 @@
, ste_index = type_fun_index
, ste_def_level = -1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment