mirror of
https://github.com/chrisnov-it/quantumbotx.git
synced 2026-07-29 03:37:45 +00:00
aa984c4909
- Update `.gitignore` to include `lab/` for backtesting and raw data. - Refactor `app.py` to improve error handling and logging. - Remove deprecated files: `core/bot_logic.py`, `core/bots/base_bot.py`, `core/bots/manager.py`, `core/db/database.py`, `core/routes/api_analysis.py`, `core/routes/api_bots_analysis.py`, `core/strategies/logic_ma.py`, `core/strategies/logic_rsi.py`. - Modify multiple files to enhance bot management, routing, and strategy handling. - Update JavaScript and HTML templates for better UI and functionality.
42 lines
1.0 KiB
JavaScript
42 lines
1.0 KiB
JavaScript
import { WhiteSpace } from '../../tokenizer/index.js';
|
|
|
|
function getOffsetExcludeWS() {
|
|
if (this.tokenIndex > 0) {
|
|
if (this.lookupType(-1) === WhiteSpace) {
|
|
return this.tokenIndex > 1
|
|
? this.getTokenStart(this.tokenIndex - 1)
|
|
: this.firstCharOffset;
|
|
}
|
|
}
|
|
|
|
return this.tokenStart;
|
|
}
|
|
|
|
export const name = 'Raw';
|
|
export const structure = {
|
|
value: String
|
|
};
|
|
|
|
export function parse(consumeUntil, excludeWhiteSpace) {
|
|
const startOffset = this.getTokenStart(this.tokenIndex);
|
|
let endOffset;
|
|
|
|
this.skipUntilBalanced(this.tokenIndex, consumeUntil || this.consumeUntilBalanceEnd);
|
|
|
|
if (excludeWhiteSpace && this.tokenStart > startOffset) {
|
|
endOffset = getOffsetExcludeWS.call(this);
|
|
} else {
|
|
endOffset = this.tokenStart;
|
|
}
|
|
|
|
return {
|
|
type: 'Raw',
|
|
loc: this.getLocation(startOffset, endOffset),
|
|
value: this.substring(startOffset, endOffset)
|
|
};
|
|
}
|
|
|
|
export function generate(node) {
|
|
this.tokenize(node.value);
|
|
}
|