import { WorkerError, CodeListingMap, SourceLocation, SourceLine } from "../workertypes"; export interface BASICOptions { dialectName : string; // use this to select the dialect // SYNTAX AND PARSING asciiOnly : boolean; // reject non-ASCII chars? uppercaseOnly : boolean; // convert everything to uppercase? optionalLabels : boolean; // can omit line numbers and use labels? optionalWhitespace : boolean; // can "crunch" keywords? varNaming : 'A'|'A1'|'AA'|'*'; // only allow A0-9 for numerics, single letter for arrays/strings squareBrackets : boolean; // "[" and "]" interchangable with "(" and ")"? tickComments : boolean; // support 'comments? hexOctalConsts : boolean; // support &H and &O integer constants? chainAssignments : boolean; // support A = B = value (HP2000) validKeywords : string[]; // valid keywords (or null for accept all) validFunctions : string[]; // valid functions (or null for accept all) validOperators : string[]; // valid operators (or null for accept all) // VALUES AND OPERATORS defaultValues : boolean; // initialize unset variables to default value? (0 or "") stringConcat : boolean; // can concat strings with "+" operator? typeConvert : boolean; // type convert strings <-> numbers? checkOverflow : boolean; // check for overflow of numerics? bitwiseLogic : boolean; // -1 = TRUE, 0 = FALSE, AND/OR/NOT done with bitwise ops maxStringLength : number; // maximum string length in chars maxDefArgs : number; // maximum # of arguments for user-defined functions // ARRAYS staticArrays : boolean; // can only DIM with constant value? (and never redim) sharedArrayNamespace : boolean; // arrays and variables have same namespace? (TODO) defaultArrayBase : number; // arrays start at this number (0 or 1) defaultArraySize : number; // arrays are allocated w/ this size (starting @ 0) maxDimensions : number; // max number of dimensions for arrays arraysContainChars : boolean; // HP BASIC array-slicing syntax // PRINTING printZoneLength : number; // print zone length numericPadding : boolean; // " " or "-" before and " " after numbers? // CONTROL FLOW testInitialFor : boolean; // can we skip a NEXT statement? (can't interleave tho) optionalNextVar : boolean; // can do NEXT without variable multipleNextVars : boolean; // NEXT J,I checkOnGotoIndex : boolean; // fatal error when ON..GOTO index out of bounds computedGoto : boolean; // non-const expr GOTO label (and GOTO..OF expression) restoreWithLabel : boolean; // RESTORE