simplex-lang 0.0.3 → 0.0.4

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/src/compiler.ts CHANGED
@@ -521,7 +521,7 @@ export function compile<Data = Record<string, unknown>, Globals = null>(
521
521
  try {
522
522
  return func(data)
523
523
  } catch (err) {
524
- assert.ok(err instanceof Error)
524
+ if (err instanceof Error === false) throw err
525
525
 
526
526
  const stackRows = err.stack?.split('\n').map(row => row.trim())
527
527
 
package/src/index.ts CHANGED
@@ -2,3 +2,4 @@ export * from './compiler.js'
2
2
  export * from './errors.js'
3
3
  export * from './simplex-tree.js'
4
4
  export * from './tools/index.js'
5
+ export * from './version.js'
@@ -71,6 +71,7 @@ export type MemberExpression =
71
71
  | {
72
72
  type: 'MemberExpression'
73
73
  computed: false
74
+ extension: boolean
74
75
  object: IdentifierExpression | ObjectExpression | ArrayExpression
75
76
  property: IdentifierExpression
76
77
  location: Location
package/src/simplex.peggy CHANGED
@@ -474,12 +474,17 @@ MemberExpression
474
474
  tail:(
475
475
  __ "[" __ property:Expression __ "]" {
476
476
  return {
477
- property: property, computed: true, location: getLocation(location())
477
+ property: property, computed: true, extension: false, location: getLocation(location())
478
478
  };
479
479
  }
480
480
  / __ "." __ property:IdentifierName {
481
481
  return {
482
- property: property, computed: false, location: getLocation(location())
482
+ property: property, computed: false, extension: false, location: getLocation(location())
483
+ };
484
+ }
485
+ / __ "::" __ property:IdentifierName {
486
+ return {
487
+ property: property, computed: false, extension: true, location: getLocation(location())
483
488
  };
484
489
  }
485
490
  )*
@@ -490,6 +495,7 @@ MemberExpression
490
495
  object: result,
491
496
  property: element.property,
492
497
  computed: element.computed,
498
+ extension: element.extension,
493
499
  location: getLocation(location())
494
500
  };
495
501
  }, head);
package/src/version.ts ADDED
@@ -0,0 +1 @@
1
+ export const version = '0.0.4'