Skip to content

Commit

Permalink
The database needs to be parsed with incremental mode for grammar par…
Browse files Browse the repository at this point in the history
…sing
  • Loading branch information
tirix committed Jan 18, 2025
1 parent 26e5fe9 commit 7c10fbf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions metamath-rs/src/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ pub struct DbOptions {
/// use it. If this is false, any reparse will result in a full
/// recalculation, so it is always safe but different settings will be
/// faster for different tasks.
///
/// Note that incremental mode is required for grammar parsing.
pub incremental: bool,
/// Number of jobs to run in parallel at any given time.
pub jobs: usize,
Expand Down Expand Up @@ -712,6 +714,10 @@ impl Database {

/// Builds and returns the grammar.
pub fn grammar_pass(&mut self) -> &Arc<Grammar> {
assert!(
self.options.incremental,
"The database needs to be parsed with incremental mode for grammar parsing."
);
if self.grammar.is_none() {
self.name_pass();
self.scope_pass();
Expand Down

0 comments on commit 7c10fbf

Please sign in to comment.