0.0.2 • Published 10 years ago

pawn-tokenizer v0.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

pawn-tokenizer Build Status

Based on c-tokenizer

example

var tokenize = require('../lib');
var t = tokenize(function (src, token) {
    console.log(token.type + ' => ' + JSON.stringify(src));
});
process.stdin.pipe(t);

For the input file plugin.sma:

#include <amxmodx>

public plugin_init(){
    register("Plugin Name", "1.0", "Author");
}

output:

$ node example/tokens.js < example/plugin.sma
directive => "#include"
whitespace => " "
operator => "<"
identifier => "amxmodx"
operator => ">"
whitespace => "\n"
whitespace => "\n"
keyword => "public"
whitespace => " "
identifier => "plugin_init"
open paren => "("
close paren => ")"
open curly => "{"
whitespace => "\n"
whitespace => " "
whitespace => " "
whitespace => " "
whitespace => " "
identifier => "register"
open paren => "("
quote => "\"Plugin Name\""
operator => ","
whitespace => " "
quote => "\"1.0\""
operator => ","
whitespace => " "
quote => "\"Author\""
close paren => ")"
operator => ";"
whitespace => "\n"
close curly => "}"
whitespace => "\n"

install

With npm do:

npm install pawn-tokenizer

license

MIT

0.0.2

10 years ago

0.0.1

10 years ago