@malloydata/malloy 0.0.47 → 0.0.48-dev230625180716

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.
package/dist/malloy.d.ts CHANGED
@@ -144,13 +144,14 @@ export declare class MalloyError extends Error {
144
144
  /**
145
145
  * A compiled Malloy document.
146
146
  */
147
- export declare class Model {
147
+ export declare class Model implements Taggable {
148
148
  private modelDef;
149
149
  private queryList;
150
150
  private sqlBlocks;
151
151
  _referenceAt: (location: ModelDocumentPosition) => DocumentReference | undefined;
152
152
  readonly problems: LogMessage[];
153
153
  constructor(modelDef: ModelDef, queryList: InternalQuery[], sqlBlocks: SQLBlockStructDef[], problems: LogMessage[], referenceAt?: (location: ModelDocumentPosition) => DocumentReference | undefined);
154
+ getTags(): Tags;
154
155
  /**
155
156
  * Retrieve a document reference for the token at the given position within
156
157
  * the document that produced this model.
package/dist/malloy.js CHANGED
@@ -325,6 +325,9 @@ class Model {
325
325
  this._referenceAt = referenceAt;
326
326
  this.problems = problems;
327
327
  }
328
+ getTags() {
329
+ return new tags_1.Tags(this.modelDef.annotation);
330
+ }
328
331
  /**
329
332
  * Retrieve a document reference for the token at the given position within
330
333
  * the document that produced this model.
package/dist/tags.js CHANGED
@@ -71,10 +71,12 @@ function tagList(tagNode) {
71
71
  * A string is " enclosing and ending in " with \" allowed inside
72
72
  */
73
73
  function parseTag(src, tagProp) {
74
- if (src.startsWith('#" ')) {
75
- return { docString: src.slice(3) };
74
+ const docMatch = src.match(/^##?" /);
75
+ if (docMatch) {
76
+ return { docString: src.slice(docMatch[0].length) };
76
77
  }
77
- if (!src.startsWith('# ')) {
78
+ const propMatch = src.match(/^##? /);
79
+ if (!propMatch) {
78
80
  return;
79
81
  }
80
82
  /*
@@ -84,7 +86,7 @@ function parseTag(src, tagProp) {
84
86
  *
85
87
  * Seems wrong to be writing a parser though.
86
88
  */
87
- const tokens = tokenize(src.slice(2));
89
+ const tokens = tokenize(src.slice(propMatch[0].length));
88
90
  let tn = 0;
89
91
  const lastToken = tokens.length - 1;
90
92
  while (tn <= lastToken) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malloydata/malloy",
3
- "version": "0.0.47",
3
+ "version": "0.0.48-dev230625180716",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",