Refactor model

This commit is contained in:
Guille Gonzalez
2026-01-01 12:41:56 +01:00
parent fbfc1d0ecf
commit e66eeb4564
19 changed files with 1845 additions and 12 deletions

View File

@@ -0,0 +1,41 @@
import Foundation
extension Math {
final class Style: Atom {
enum Level: Int {
case display
case text
case script
case scriptOfScript
var isScript: Bool {
switch self {
case .script, .scriptOfScript:
return true
default:
return false
}
}
var isNotScript: Bool {
!isScript
}
func next() -> Level {
Level(rawValue: rawValue + 1) ?? .display
}
}
var level: Level
init(_ style: Style) {
self.level = style.level
super.init(style)
}
init(level: Level = .display) {
self.level = level
super.init(type: .style)
}
}
}