Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

algo-lang

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

algo-lang - npm Package Compare versions

Comparing version 1.0.6 to 1.0.7

33

build/visitors/typer.js

@@ -168,2 +168,19 @@ 'use strict';

// Add values in scopes
visitAlgoDecls(decls) {
if (decls.consts.length) this.array(decls.consts);
if (decls.types.length) {
const prevMode = this.typeMode;
this.typeMode = 'register';
this.array(decls.types);
this.typeMode = 'check';
this.array(decls.types);
this.typeMode = prevMode;
}
if (decls.variables.length) this.array(decls.variables);
if (decls.routines && decls.routines.length) this.array(decls.routines);
}
visitConst(c) {

@@ -174,2 +191,6 @@ c.type = this.scopes.getType(c.value.type);

visitArray(array) {
if (this.typeMode === 'check') {
array.type = this.scopes.getType(array.type);
return;
}
array.dimensions = array.dimensions.map(dimension => {

@@ -185,9 +206,12 @@ if (!isNaN(+dimension)) return dimension;

this.scopes.addType(array);
array.type = this.scopes.getType(array.type);
}
visitEnum(e) {
if (this.typeMode === 'check') return;
this.scopes.addType(e);
}
visitRecord(record) {
this.scopes.addType(record);
if (this.typeMode === 'register') {
this.scopes.addType(record);
return;
}
this.scopes.pushScope();

@@ -198,3 +222,6 @@ super.visitRecord(record);

visitPointer(pointer) {
pointer.pointOn = this.scopes.getType(pointer.pointOn);
if (this.typeMode === 'check') {
pointer.pointOn = this.scopes.getType(pointer.pointOn);
return;
}
this.scopes.addType(pointer);

@@ -201,0 +228,0 @@ }

@@ -164,2 +164,22 @@ import {EmptyVisitor} from './empty.js'

// Add values in scopes
visitAlgoDecls(decls) {
if (decls.consts.length)
this.array(decls.consts)
if (decls.types.length) {
const prevMode = this.typeMode
this.typeMode = 'register'
this.array(decls.types)
this.typeMode = 'check'
this.array(decls.types)
this.typeMode = prevMode
}
if (decls.variables.length)
this.array(decls.variables)
if (decls.routines && decls.routines.length)
this.array(decls.routines)
}
visitConst(c) {

@@ -170,2 +190,6 @@ c.type = this.scopes.getType(c.value.type)

visitArray(array) {
if (this.typeMode === 'check') {
array.type = this.scopes.getType(array.type)
return
}
array.dimensions = array.dimensions.map(dimension => {

@@ -183,9 +207,13 @@ if (!isNaN(+dimension))

this.scopes.addType(array)
array.type = this.scopes.getType(array.type)
}
visitEnum(e) {
if (this.typeMode === 'check')
return
this.scopes.addType(e)
}
visitRecord(record) {
this.scopes.addType(record)
if (this.typeMode === 'register') {
this.scopes.addType(record)
return
}
this.scopes.pushScope()

@@ -196,3 +224,6 @@ super.visitRecord(record)

visitPointer(pointer) {
pointer.pointOn = this.scopes.getType(pointer.pointOn)
if (this.typeMode === 'check') {
pointer.pointOn = this.scopes.getType(pointer.pointOn)
return
}
this.scopes.addType(pointer)

@@ -199,0 +230,0 @@ }

2

package.json
{
"name": "algo-lang",
"version": "1.0.6",
"version": "1.0.7",
"description": "Algorithmic language interpreter (in French only for now)",

@@ -5,0 +5,0 @@ "homepage": "https://bitbucket.org/lsystems/algo-lang/overview",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc