refactor to use semanticRun in enum
Merge pull request #2555 from WalterBright/to-semanticRun

refactor to use semanticRun in enum