rip-lang 3.2.0 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2977,25 +2977,25 @@ var parserInstance = {
2977
2977
  }
2978
2978
  },
2979
2979
  parse(input) {
2980
- let EOF, TERROR, action, errStr, expected, len, lex, lexer, loc, locFirst, locLast, newState, p, parseTable, preErrorSymbol, r, ranges, recovering, sharedState, state, stk, symbol, val, yyleng, yylineno, yyloc, yytext, yyval;
2981
- [stk, val, loc] = [[0], [null], []];
2982
- [parseTable, yytext, yylineno, yyleng, recovering] = [this.parseTable, "", 0, 0, 0];
2980
+ let EOF, TERROR, action, errStr, expected, len, lex, lexer, locFirst, locLast, locs, newState, p, parseTable, preErrorSymbol, r, ranges, recovering, rv, sharedState, state, stk, symbol, tokenLen, tokenLine, tokenLoc, tokenText, vals;
2981
+ [stk, vals, locs] = [[0], [null], []];
2982
+ [parseTable, tokenText, tokenLine, tokenLen, recovering] = [this.parseTable, "", 0, 0, 0];
2983
2983
  [TERROR, EOF] = [2, 1];
2984
2984
  lexer = Object.create(this.lexer);
2985
- sharedState = { yy: {} };
2986
- for (const k in this.yy)
2987
- if (Object.hasOwn(this.yy, k)) {
2988
- const v = this.yy[k];
2989
- sharedState.yy[k] = v;
2990
- }
2991
- lexer.setInput(input, sharedState.yy);
2992
- [sharedState.yy.lexer, sharedState.yy.parser] = [lexer, this];
2993
- if (lexer.yylloc == null)
2994
- lexer.yylloc = {};
2995
- yyloc = lexer.yylloc;
2996
- loc.push(yyloc);
2985
+ sharedState = { ctx: {} };
2986
+ for (const k in this.ctx)
2987
+ if (Object.hasOwn(this.ctx, k)) {
2988
+ const v = this.ctx[k];
2989
+ sharedState.ctx[k] = v;
2990
+ }
2991
+ lexer.setInput(input, sharedState.ctx);
2992
+ [sharedState.ctx.lexer, sharedState.ctx.parser] = [lexer, this];
2993
+ if (lexer.loc == null)
2994
+ lexer.loc = {};
2995
+ tokenLoc = lexer.loc;
2996
+ locs.push(tokenLoc);
2997
2997
  ranges = lexer.options?.ranges;
2998
- this.parseError = typeof sharedState.yy.parseError === "function" ? sharedState.yy.parseError : Object.getPrototypeOf(this).parseError;
2998
+ this.parseError = typeof sharedState.ctx.parseError === "function" ? sharedState.ctx.parseError : Object.getPrototypeOf(this).parseError;
2999
2999
  lex = () => {
3000
3000
  let token;
3001
3001
  token = lexer.lex() || EOF;
@@ -3003,7 +3003,8 @@ var parserInstance = {
3003
3003
  token = this.symbolIds[token] || token;
3004
3004
  return token;
3005
3005
  };
3006
- [symbol, preErrorSymbol, state, action, r, yyval, p, len, newState, expected] = [null, null, null, null, null, {}, null, null, null, null];
3006
+ symbol = preErrorSymbol = state = action = r = p = len = newState = expected = null;
3007
+ rv = {};
3007
3008
  while (true) {
3008
3009
  state = stk[stk.length - 1];
3009
3010
  if (symbol == null)
@@ -3024,58 +3025,58 @@ var parserInstance = {
3024
3025
  })();
3025
3026
  errStr = (() => {
3026
3027
  if (lexer.showPosition)
3027
- return `Parse error on line ${yylineno + 1}:
3028
+ return `Parse error on line ${tokenLine + 1}:
3028
3029
  ${lexer.showPosition()}
3029
3030
  Expecting ${expected.join(", ")}, got '${this.tokenNames[symbol] || symbol}'`;
3030
3031
  else {
3031
- `Parse error on line ${yylineno + 1}: Unexpected ${symbol === EOF ? "end of input" : `'${this.tokenNames[symbol] || symbol}'`}`;
3032
- return this.parseError(errStr, { text: lexer.match, token: this.tokenNames[symbol] || symbol, line: lexer.yylineno, loc: yyloc, expected });
3032
+ `Parse error on line ${tokenLine + 1}: Unexpected ${symbol === EOF ? "end of input" : `'${this.tokenNames[symbol] || symbol}'`}`;
3033
+ return this.parseError(errStr, { text: lexer.match, token: this.tokenNames[symbol] || symbol, line: lexer.line, loc: tokenLoc, expected });
3033
3034
  }
3034
3035
  })();
3035
3036
  throw Error(errStr);
3036
3037
  }
3037
3038
  if (action > 0) {
3038
3039
  stk.push(symbol, action);
3039
- val.push(lexer.yytext);
3040
- loc.push(lexer.yylloc);
3040
+ vals.push(lexer.text);
3041
+ locs.push(lexer.loc);
3041
3042
  symbol = null;
3042
3043
  if (!preErrorSymbol) {
3043
- [yyleng, yytext, yylineno, yyloc] = [lexer.yyleng, lexer.yytext, lexer.yylineno, lexer.yylloc];
3044
+ [tokenLen, tokenText, tokenLine, tokenLoc] = [lexer.len, lexer.text, lexer.line, lexer.loc];
3044
3045
  if (recovering > 0)
3045
3046
  recovering--;
3046
3047
  } else
3047
3048
  [symbol, preErrorSymbol] = [preErrorSymbol, null];
3048
3049
  } else if (action < 0) {
3049
3050
  len = this.ruleTable[-action * 2 + 1];
3050
- yyval.$ = val[val.length - len];
3051
- [locFirst, locLast] = [loc[loc.length - (len || 1)], loc[loc.length - 1]];
3052
- yyval._$ = { first_line: locFirst.first_line, last_line: locLast.last_line, first_column: locFirst.first_column, last_column: locLast.last_column };
3051
+ rv.$ = vals[vals.length - len];
3052
+ [locFirst, locLast] = [locs[locs.length - (len || 1)], locs[locs.length - 1]];
3053
+ rv._$ = { first_line: locFirst.first_line, last_line: locLast.last_line, first_column: locFirst.first_column, last_column: locLast.last_column };
3053
3054
  if (ranges)
3054
- yyval._$.range = [locFirst.range[0], locLast.range[1]];
3055
- r = this.ruleActions.apply(yyval, [-action, val, loc, sharedState.yy]);
3055
+ rv._$.range = [locFirst.range[0], locLast.range[1]];
3056
+ r = this.ruleActions.call(rv, -action, vals, locs, sharedState.ctx);
3056
3057
  if (r != null)
3057
- yyval.$ = r;
3058
+ rv.$ = r;
3058
3059
  if (len) {
3059
3060
  stk.length -= len * 2;
3060
- val.length -= len;
3061
- loc.length -= len;
3061
+ vals.length -= len;
3062
+ locs.length -= len;
3062
3063
  }
3063
3064
  stk.push(this.ruleTable[-action * 2]);
3064
- val.push(yyval.$);
3065
- loc.push(yyval._$);
3065
+ vals.push(rv.$);
3066
+ locs.push(rv._$);
3066
3067
  newState = parseTable[stk[stk.length - 2]][stk[stk.length - 1]];
3067
3068
  stk.push(newState);
3068
3069
  } else if (action === 0)
3069
- return val[val.length - 1];
3070
+ return vals[vals.length - 1];
3070
3071
  }
3071
3072
  },
3072
3073
  trace() {},
3073
- yy: {}
3074
+ ctx: {}
3074
3075
  };
3075
- var createParser = (yyInit = {}) => {
3076
+ var createParser = (init = {}) => {
3076
3077
  const p = Object.create(parserInstance);
3077
- Object.defineProperty(p, "yy", {
3078
- value: { ...yyInit },
3078
+ Object.defineProperty(p, "ctx", {
3079
+ value: { ...init },
3079
3080
  enumerable: false,
3080
3081
  writable: true,
3081
3082
  configurable: true
@@ -7334,8 +7335,8 @@ class Compiler {
7334
7335
  val = new String(val);
7335
7336
  Object.assign(val, token.data);
7336
7337
  }
7337
- this.yytext = val;
7338
- this.yylloc = token.loc;
7338
+ this.text = val;
7339
+ this.loc = token.loc;
7339
7340
  return token[0];
7340
7341
  }
7341
7342
  };
@@ -7383,8 +7384,8 @@ function getComponentRuntime() {
7383
7384
  return new CodeGenerator({}).getComponentRuntime();
7384
7385
  }
7385
7386
  // src/browser.js
7386
- var VERSION = "3.2.0";
7387
- var BUILD_DATE = "2026-02-08@23:28:53GMT";
7387
+ var VERSION = "3.3.0";
7388
+ var BUILD_DATE = "2026-02-09@04:28:55GMT";
7388
7389
  var dedent = (s) => {
7389
7390
  const m = s.match(/^[ \t]*(?=\S)/gm);
7390
7391
  const i = Math.min(...(m || []).map((x) => x.length));