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

quakejs-files

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

quakejs-files - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

38

lib/tokenizer.js
var Tokenizer = function (src) {
// Strip out comments
src = src.replace(/\/\/.*$/mg, ''); // C++ style (//...)
src = src.replace(/\/\*[^*\/]*\*\//mg, ''); // C style (/*...*/) (Do the shaders even use these?)
// strip out comments
src = src.replace(/\/\/.*$/mg, ''); // strip single line comments
src = src.replace(/\/\*[\s\S]*?\*\//mg, ''); // strip multi-line comments
// Split everything by whitespace, grouping quoted
// sections together.
// split everything by whitespace, grouping quoted sections together
this.tokens = [];

@@ -20,8 +19,13 @@

Tokenizer.prototype.EOF = function() {
if (this.tokens === null) { return true; }
if (this.tokens === null) {
return true;
}
var token = this.tokens[this.offset];
while(token === '' && this.offset < this.tokens.length) {
while (token === '' && this.offset < this.tokens.length) {
this.offset++;
token = this.tokens[this.offset];
}
return this.offset >= this.tokens.length;

@@ -31,7 +35,12 @@ };

Tokenizer.prototype.next = function() {
if (this.tokens === null) { return; }
if (this.tokens === null) {
return;
}
var token = '';
while(token === '' && this.offset < this.tokens.length) {
while (token === '' && this.offset < this.tokens.length) {
token = this.tokens[this.offset++];
}
return token;

@@ -41,10 +50,15 @@ };

Tokenizer.prototype.prev = function() {
if (this.tokens === null) { return; }
if (this.tokens === null) {
return;
}
var token = '';
while(token === '' && this.offset >= 0) {
while (token === '' && this.offset >= 0) {
token = this.tokens[this.offset--];
}
return token;
};
module.exports = Tokenizer;
module.exports = Tokenizer;
{
"name": "quakejs-files",
"version": "0.0.2",
"version": "0.0.3",
"description": "Parse quake3 `.bsp`, `.md3`, `.shader` and `.skin` files into JavaScript friendly objects",

@@ -5,0 +5,0 @@ "main": "index.js",

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