Commit Graph

159 Commits

Author SHA1 Message Date
Fedor Isakov b5286d2671 Rely on memo to cache results of template application. 2020-07-30 17:14:40 +02:00
Fedor Isakov 32b11c0c7f Introduce memo expression to enable memoization of values.
During template application memo can be used to store results
of a computation in the session. The memo will be automatically
cleared on an event that invalidates the caches.
2020-07-30 17:14:40 +02:00
Grigorii Kirgizov 3eebe8cd03 Refactor creation of IncrProgramSpec: allow later spec config (for MPSCR-66)
IncrProgramSpec influencing program eval is built from two sources:
internal analysis results & typechecking options.
Providing spec builder instead of spec allows to combine these
sources later at program pipeline creation in TypecheckingService.

Commit accomodates to addition of IncrementalSpec.Enabled.Unsafe
Commit also simplifies ProgramAnalysis -related classes.
Renames BasicProgramAnalysis to PrincipalsAnalysis.
2020-07-28 18:53:41 +03:00
Grigorii Kirgizov f6d7f5c4bd Refactor the way IncrPogramSpec is provided: explicitly pass as Step input 2020-07-28 18:53:41 +03:00
Grigorii Kirgizov 6339b5128b Add option to Typechecking page for enabling incremental contract assertions (MPSCR-66) 2020-07-28 18:53:41 +03:00
Grigorii Kirgizov c6a4e9ede3 Use opaque feedback keys (rule match ids) instead of rule unique tag
According to changes in prev commin in reactor
2020-07-22 15:27:46 +03:00
Fedor Isakov 96918d0e1d Support for processing input nodes recursively or not. Optimizing local typechecking.
The flag "recursive" is passed down to ProgramFactory to control whether
the input nodes are to be walked recursively.
This flag is set to false when calculating a node's type in isolation.
2020-07-21 17:02:17 +02:00
Fedor Isakov 29ffc46fa4 Introduce ProvideFeedbackOperation: enable providing feedback from templates.
Operations such as 'error' and 'warning' are available on input
node in templates and serve to report issues found during
template application, in contrast with those found during evaluation.
2020-07-13 18:14:12 +02:00
Fedor Isakov 936190bca9 Apply migrations. 2020-07-11 15:13:08 +02:00
Fedor Isakov 9c9acceb96 Refactor effects composition for better readability. A couple of minor fixes.
Drop recording of "suppressed exception" by CoderulesHelper.
Report failed program evaluation as info message.
Ensure traces are available for failed evaluations.
2020-07-07 18:42:16 +02:00
Fedor Isakov 598b7e596b Refactor TypecheckingService to do all error reporting. Fix isRelevant logic.
Use the same logic for TypecheckingProvider.isRelevant() as in AspectLookup
with additional test for directly imported languages.
2020-07-07 13:12:14 +02:00
Fedor Isakov e76eeeb676 Ensure failures during query template application are reported. 2020-07-03 16:35:48 +02:00
Grigorii Kirgizov acfac19a1c minor: specify rule in msg for InvalidRuleException 2020-07-01 14:36:48 +03:00
Grigorii Kirgizov a3e6c4d552 minor: Implement extended interface for IncrProgramSpec
Defines notion of weak principal rule. Relevant for MPSCR-62
2020-07-01 14:36:48 +03:00
Fedor Isakov 9c1d3aad92 Move Result class to commonly-used runtime solution. 2020-06-25 14:30:30 +02:00
Fedor Isakov 4350d43ddb Simplify Result class design, drop unnecessary MITM class. 2020-06-25 11:40:16 +02:00
Fedor Isakov 735a97a0e7 Drop obsolete feature "checkGarbage" 2020-06-25 11:40:16 +02:00
Fedor Isakov b6fd3ea464 Minor refactoring: remove message handler from MacroTemplateIndex. 2020-06-25 11:40:16 +02:00
Fedor Isakov 44a25ada3a Enable extracting term presentation via delegate.
Provide an instance of NodePresentable that ought
to serve as the delegate proxy for extracting node
presentation.
2020-06-21 23:17:33 +02:00
Fedor Isakov ab99a0245c Introduce runtime support module j.m.coderules.runtime. 2020-06-21 23:17:33 +02:00
Fedor Isakov 04c2dfb385 Implement DataProvider interface in DefaultSupervisor. 2020-06-04 11:44:07 +02:00
Fedor Isakov da43822154 Manually migrate try statements that were not auto-migrated. 2020-05-09 15:07:06 +02:00
Fedor Isakov 14780b5561 Apply automatic migrations. 2020-05-09 15:04:25 +02:00
Fedor Isakov d1163fc883 Open and rebuild the project with MPS 2020.1. 2020-05-09 15:02:20 +02:00
Fedor Isakov 587711a3e8 Drop deprecated class and its usages. 2020-05-05 15:58:48 +02:00
Grigorii Kirgizov f3ed39c8a6 Refactor a bit program analyses merge code in RuleProcessingSession 2020-05-01 13:38:12 +03:00
Grigorii Kirgizov 0569a96b6a Fix ExpressionStatement causing testa failure 2020-04-30 18:59:42 +03:00
Grigorii Kirgizov 5894510797 Fix infinite loop on error of extended macro table not found 2020-04-30 15:38:33 +03:00
Fedor Isakov 33739d7303 Support query table in generator templates.
Runtime switched to use newly generated query table definitions.
2020-04-23 10:15:39 +02:00
Fedor Isakov 6e7d4c3ae0 Minor refactoring: prefer interfaces over abstract classes. 2020-04-23 10:15:39 +02:00
Fedor Isakov a36369f002 Consistently use unified name RuleTable across all runtime. 2020-04-22 16:00:41 +02:00
Fedor Isakov 78a753a872 Refactor coderules aspect runtime: consolidate manifests.
Have single manifest for all assets instead of separate ones.
QueryTable is declared but not implemented yet.
2020-04-22 16:00:41 +02:00
Fedor Isakov 3e65376561 Drop deprecated stuff from coderules lang and runtime. 2020-04-22 12:07:50 +02:00
Fedor Isakov 767a41ad24 Switch runtime and generator templates to use Query interface.
Previously used contract with QueryKind/Object[] parameters is
replaced with Query object.
2020-04-22 11:43:37 +02:00
Fedor Isakov 9037b17516 Fix FeedbackConsumer's only method definition.
The method would generate to 'protected void...' with MPS 2020.1.
No idea why.
2020-04-19 17:32:29 +02:00
Fedor Isakov 91dda1d85f Move ProgramAnalysis to template model, avoid creating dependency cycle. 2020-04-19 16:30:11 +02:00
Fedor Isakov 1bb158d50b Consolidate models in template runtime solution. 2020-04-19 16:30:11 +02:00
Fedor Isakov 9bbf86cb8d Optimize coderules templates runtime and generator.
Drop obsolete code from runtime.
Consolidate and reconcile different templates for consistency.
Simplify generated code.
2020-04-19 16:30:11 +02:00
Fedor Isakov cfcbee9d6f Cleanup the runtime: drop unused/obsolete methods. 2020-04-19 16:30:11 +02:00
Grigorii Kirgizov 152e6fcfa3 refactor: move another version of ReportingSupervisor from test model to the model it belongs 2020-04-19 13:43:01 +03:00
Grigorii Kirgizov 43297ce5c6 Separate logic of being able to report feedback from handling it (i.e. recovering from failure), fixes MPSCR-57
Also rename ruleTag param in feedback methods to 'feedbackKey', what it really is.
feedbackKey is used in TypesCache internal ReportItem map as a key.
2020-04-19 13:42:58 +03:00
Fedor Isakov 7b1764548c Fix runtime and generator for macro templates processing. MPSCR-53
Support matching expand macro template on subconcepts.
Respect topological order of macro tables.
Respect the order of macro templates in macro table.
2020-04-16 12:24:46 +02:00
Fedor Isakov a1c98b5bf0 Apply all outstanding migrations. 2020-04-13 17:58:33 +02:00
Fedor Isakov 9a8b3585d7 Fix runtime and generator to support queries and call macros.
Expand macro supports dispatching by concept.
Logical variables declared on macro's body are init'ed in apply method.
Enable the hack to ensure dependencies on macro input are tracked.
2020-03-31 18:43:22 +02:00
Fedor Isakov 28d21f5349 Cleanup in macro runtime, expand macro parameter access.
Parameters can be specified for call macro only.
Logicals can be specified for expand and call macro.
Expand macro params are treated exactly as "context"
parameters.
2020-03-31 11:27:09 +02:00
Fedor Isakov 6672ab21e8 Runtime support for new expand and call macro constraints. 2020-03-31 11:27:09 +02:00
Grigorii Kirgizov 91e4d2b582 Revive 'principal' rule feature for MPSCR-51. Mark those rules in BL typesystem.
Introduce 'auxiliary/essential' notions instead of 'principal/not principal'.
2020-03-23 14:28:14 +03:00
Grigorii Kirgizov a619b017ec Fix NPE in UpdatesRecorder on roots move/remove
In such cases typechecking was failing on the point of computing changeSetClosure,
because changeSet got null nodes from SNodeChangeEvents
2020-02-26 18:58:05 +03:00
Grigorii Kirgizov 707982fbe9 Include changed nodes from different roots in invalidated set for incremental program update. (MPSCR-46)
The core chang in is InvalidateAndApplyTemplatesStep.
Also rename SNodeEventsFilter to RelevantNodesTracker.
2020-02-26 18:58:05 +03:00
Grigorii Kirgizov 025232969d Track change events from all referred models (MPSCR-46)
UnitTypecheckingCacheHolder now holds the data needed for ChangesTrackers.
This data is updated by UpdatesRecorder: different models and nodes from different roots are tracked.
2020-02-26 18:58:05 +03:00