tova 0.3.4 → 0.3.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tova",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "description": "Tova — a modern programming language that transpiles to JavaScript, unifying frontend and backend",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -1,6 +1,8 @@
1
1
  import { Scope, Symbol } from './scope.js';
2
2
  import { PIPE_TARGET } from '../parser/ast.js';
3
3
  import { BUILTIN_NAMES } from '../stdlib/inline.js';
4
+ import { collectServerBlockFunctions, installServerAnalyzer } from './server-analyzer.js';
5
+ import { installClientAnalyzer } from './client-analyzer.js';
4
6
  import {
5
7
  Type, PrimitiveType, NilType, AnyType, UnknownType,
6
8
  ArrayType, TupleType, FunctionType, RecordType, ADTType,
@@ -267,7 +269,6 @@ export class Analyzer {
267
269
  // Pre-pass: collect named server block functions for inter-server RPC validation
268
270
  const hasServerBlocks = this.ast.body.some(n => n.type === 'ServerBlock');
269
271
  if (hasServerBlocks) {
270
- const { collectServerBlockFunctions, installServerAnalyzer } = import.meta.require('./server-analyzer.js');
271
272
  installServerAnalyzer(Analyzer);
272
273
  this.serverBlockFunctions = collectServerBlockFunctions(this.ast);
273
274
  } else {
@@ -734,7 +735,6 @@ export class Analyzer {
734
735
 
735
736
  _visitServerNode(node) {
736
737
  if (!Analyzer.prototype._serverAnalyzerInstalled) {
737
- const { installServerAnalyzer } = import.meta.require('./server-analyzer.js');
738
738
  installServerAnalyzer(Analyzer);
739
739
  }
740
740
  const methodName = 'visit' + node.type;
@@ -743,7 +743,6 @@ export class Analyzer {
743
743
 
744
744
  _visitClientNode(node) {
745
745
  if (!Analyzer.prototype._clientAnalyzerInstalled) {
746
- const { installClientAnalyzer } = import.meta.require('./client-analyzer.js');
747
746
  installClientAnalyzer(Analyzer);
748
747
  }
749
748
  const methodName = 'visit' + node.type;
@@ -4,25 +4,15 @@
4
4
 
5
5
  import { SharedCodegen } from './shared-codegen.js';
6
6
  import { BUILTIN_NAMES } from '../stdlib/inline.js';
7
-
8
- // Lazy-loaded codegen modules only imported when server/client blocks exist
9
- let _ServerCodegen = null;
10
- let _ClientCodegen = null;
7
+ import { ServerCodegen } from './server-codegen.js';
8
+ import { ClientCodegen } from './client-codegen.js';
11
9
 
12
10
  function getServerCodegen() {
13
- if (!_ServerCodegen) {
14
- // Dynamic require avoids loading server-codegen.js for client-only builds
15
- _ServerCodegen = import.meta.require('./server-codegen.js').ServerCodegen;
16
- }
17
- return _ServerCodegen;
11
+ return ServerCodegen;
18
12
  }
19
13
 
20
14
  function getClientCodegen() {
21
- if (!_ClientCodegen) {
22
- // Dynamic require avoids loading client-codegen.js for server-only builds
23
- _ClientCodegen = import.meta.require('./client-codegen.js').ClientCodegen;
24
- }
25
- return _ClientCodegen;
15
+ return ClientCodegen;
26
16
  }
27
17
 
28
18
  export class CodeGenerator {
@@ -1,5 +1,7 @@
1
1
  import { TokenType } from '../lexer/tokens.js';
2
2
  import * as AST from './ast.js';
3
+ import { installServerParser } from './server-parser.js';
4
+ import { installClientParser } from './client-parser.js';
3
5
 
4
6
  export class Parser {
5
7
  static MAX_EXPRESSION_DEPTH = 200;
@@ -295,14 +297,12 @@ export class Parser {
295
297
  parseTopLevel() {
296
298
  if (this.check(TokenType.SERVER)) {
297
299
  if (!Parser.prototype._serverParserInstalled) {
298
- const { installServerParser } = import.meta.require('./server-parser.js');
299
300
  installServerParser(Parser);
300
301
  }
301
302
  return this.parseServerBlock();
302
303
  }
303
304
  if (this.check(TokenType.CLIENT)) {
304
305
  if (!Parser.prototype._clientParserInstalled) {
305
- const { installClientParser } = import.meta.require('./client-parser.js');
306
306
  installClientParser(Parser);
307
307
  }
308
308
  return this.parseClientBlock();
package/src/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // Auto-generated by scripts/embed-runtime.js — do not edit
2
- export const VERSION = "0.3.4";
2
+ export const VERSION = "0.3.5";