@jbearak/sight 0.14.4 → 0.14.5

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.
@@ -52,7 +52,7 @@ var package_default;
52
52
  var init_package = __esm(() => {
53
53
  package_default = {
54
54
  name: "@jbearak/sight",
55
- version: "0.14.4",
55
+ version: "0.14.5",
56
56
  type: "module",
57
57
  workspaces: [
58
58
  "client"
@@ -13253,6 +13253,15 @@ var init_lexer = __esm(() => {
13253
13253
  ASSIGNMENT_OPERATORS = new Set(["=", "==", "!=", "<", ">", "<=", ">="]);
13254
13254
  });
13255
13255
 
13256
+ // src/utils/local-macro.ts
13257
+ function unwrap_macval(content) {
13258
+ return MACVAL_LITERAL_PATTERN.exec(content)?.[1] ?? content;
13259
+ }
13260
+ var MACVAL_LITERAL_PATTERN;
13261
+ var init_local_macro = __esm(() => {
13262
+ MACVAL_LITERAL_PATTERN = /^macval\(([A-Za-z0-9_]+)\)$/;
13263
+ });
13264
+
13256
13265
  // src/utils/continuation.ts
13257
13266
  function is_swallowed_continuation_terminator(my_token, in_continuation) {
13258
13267
  return my_token.type === "STATEMENT_TERMINATOR" && in_continuation && my_token.value === `
@@ -13291,6 +13300,7 @@ class ContinuationTracker {
13291
13300
  var PREFIX_COMMANDS, StataParser;
13292
13301
  var init_parser = __esm(() => {
13293
13302
  init_types();
13303
+ init_local_macro();
13294
13304
  init_file_path_utils();
13295
13305
  PREFIX_COMMANDS = new Set(["by", "bysort", "quietly", "qui", "capture", "cap", "noisily", "noi"]);
13296
13306
  StataParser = class StataParser {
@@ -13788,7 +13798,7 @@ var init_parser = __esm(() => {
13788
13798
  }
13789
13799
  extract_local_macro_name(value) {
13790
13800
  if (value.startsWith("`") && value.endsWith("'")) {
13791
- return value.slice(1, -1);
13801
+ return unwrap_macval(value.slice(1, -1));
13792
13802
  }
13793
13803
  return null;
13794
13804
  }
@@ -14011,7 +14021,11 @@ var init_parser = __esm(() => {
14011
14021
  const options = [];
14012
14022
  if (this.check("COMMA")) {
14013
14023
  this.advance();
14014
- while (!this.check("STATEMENT_TERMINATOR") && !this.isAtEnd() && !this.isTrivia()) {
14024
+ while (!this.check("STATEMENT_TERMINATOR") && !this.isAtEnd()) {
14025
+ if (this.skipContinuation())
14026
+ continue;
14027
+ if (this.isTrivia())
14028
+ break;
14015
14029
  if (this.check("WORD")) {
14016
14030
  const optionToken = this.advance();
14017
14031
  const option = {
@@ -14212,7 +14226,11 @@ var init_parser = __esm(() => {
14212
14226
  const options = [];
14213
14227
  if (this.check("COMMA")) {
14214
14228
  this.advance();
14215
- while (!this.check("STATEMENT_TERMINATOR") && !this.isAtEnd() && !this.isTrivia()) {
14229
+ while (!this.check("STATEMENT_TERMINATOR") && !this.isAtEnd()) {
14230
+ if (this.skipContinuation())
14231
+ continue;
14232
+ if (this.isTrivia())
14233
+ break;
14216
14234
  if (this.check("WORD")) {
14217
14235
  const option_token = this.advance();
14218
14236
  const option = {
@@ -14973,7 +14991,11 @@ var init_parser = __esm(() => {
14973
14991
  const options = [];
14974
14992
  if (this.check("COMMA")) {
14975
14993
  this.advance();
14976
- while (!this.check("STATEMENT_TERMINATOR") && !this.isAtEnd() && !this.isTrivia()) {
14994
+ while (!this.check("STATEMENT_TERMINATOR") && !this.isAtEnd()) {
14995
+ if (this.skipContinuation())
14996
+ continue;
14997
+ if (this.isTrivia())
14998
+ break;
14977
14999
  if (this.check("WORD")) {
14978
15000
  const option_token = this.advance();
14979
15001
  const option = {
@@ -19927,7 +19949,7 @@ class SemanticAnalyzer {
19927
19949
  }
19928
19950
  extract_local_macro_name(value) {
19929
19951
  if (value.startsWith("`") && value.endsWith("'")) {
19930
- return value.slice(1, -1);
19952
+ return unwrap_macval(value.slice(1, -1));
19931
19953
  }
19932
19954
  return null;
19933
19955
  }
@@ -20020,6 +20042,7 @@ var STATA_SYSTEM_GLOBALS, WEIGHT_TYPES, STATA_STORAGE_TYPES, STR_WIDTH_RE, MATA_
20020
20042
  var init_analyzer = __esm(() => {
20021
20043
  init_scoped_locals();
20022
20044
  init_types();
20045
+ init_local_macro();
20023
20046
  init_directive_parser();
20024
20047
  init_loop_expander();
20025
20048
  init_macro_creating_commands();
@@ -73841,4 +73864,4 @@ export {
73841
73864
  is_cli_entry_point
73842
73865
  };
73843
73866
 
73844
- //# debugId=7A54D1D3B542825B64756E2164756E21
73867
+ //# debugId=19E8989026935ECD64756E2164756E21
@@ -1 +1 @@
1
- 4770f4e115de3c4df1dea43547bbf32b3d99fbc135026bedef1e73a691b47a7a sight-server.js
1
+ 861c239888154dd8cbe21fadf25874416280e17b2bb9fbf2080e8dd4a63dbbfc sight-server.js
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbearak/sight",
3
- "version": "0.14.4",
3
+ "version": "0.14.5",
4
4
  "type": "module",
5
5
  "workspaces": [
6
6
  "client"