Add validation for max line length in compiler
This commit adds validation logic in compiler to check for max allowed characters per line for scripts. This allows preventing bugs caused by limitation of terminal emulators. Other supporting changes: - Rename/refactor related code for clarity and better maintainability. - Drop `I` prefix from interfaces to align with latest convention. - Refactor CodeValidator to be functional rather than object-oriented for simplicity. - Refactor syntax definition construction to be functional and be part of rule for better separation of concerns. - Refactored validation logic to use an enum-based factory pattern for improved maintainability and scalability.
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import type { ScriptData } from '@/application/collections/';
|
||||
import type { IScriptCompiler } from '@/application/Parser/Executable/Script/Compiler/IScriptCompiler';
|
||||
import type { ScriptCode } from '@/domain/Executables/Script/Code/ScriptCode';
|
||||
import type { ScriptCompiler } from '@/application/Parser/Executable/Script/Compiler/ScriptCompiler';
|
||||
import { ScriptCodeStub } from './ScriptCodeStub';
|
||||
|
||||
export class ScriptCompilerStub implements IScriptCompiler {
|
||||
export class ScriptCompilerStub implements ScriptCompiler {
|
||||
public compilableScripts = new Map<ScriptData, ScriptCode>();
|
||||
|
||||
public canCompile(script: ScriptData): boolean {
|
||||
|
||||
Reference in New Issue
Block a user