Code Monkey home page Code Monkey logo

vscode's Introduction

Mangudai

AoE2 Random Map Scripting for humans

JavaScript parser and linter for Random Map Scripts (RMS) for the Age of Empires II video game.

Install

Mangudai is published as an NPM package compatible with Node.js and browsers.

npm install mangudai

Use a tool like Webpack or Rollup to include Mangudai in your front-end app.

The code is compiled to ES5 (old and stable JavaScript) before publishing, so the module has maximum compatibility out-of-the-box.

Usage

Let's parse an RMS script into an Abstract Syntax Tree (AST) and lint it.

import { parse, lint } from 'mangudai'

const { ast, errors } = parse('<PLAYER_SETUP> \n random_placement')

if (errors.length) {
  console.log('Unable to parse the script! Probably invalid syntax.', errors)
} else {
  const lintErrors = lint(ast)
  console.log(`Linter found ${lintErrors.length} problems.`, lintErrors)
}

Mangudai is written in TypeScript and exports all relevant typings.

API

Contribute

Travis status Test coverage TypeScript Style Guide Standard Readme

This project is still in its early development stage. Any help is greatly appreciated! Feel free to ask questions in issues. PRs accepted.

License

MIT © Mangudai contributors

vscode's People

Contributors

deltaidea avatar

Stargazers

 avatar

Watchers

 avatar  avatar

vscode's Issues

RMS-Lint alert when declare same constants in conditions

Info

  • VS Code version: 1.16.1
  • Extension version: 0.2.9

Description

When I declare constants in conditions, it will not be duplicate declaration, but RMS-Lint still alert.

Except

It should only alert when code really duplicate.

Actually

It alert when I declare same constant name, but it will not duplicate because there has conditions.

Screenshot

2017-09-24 7 54 46

Code

if TINY_MAP
	#const EXTRA_FORAGE_GROUPS 1
	#const EXTRA_FORAGE_OBJECTS 1
elseif SMALL_MAP
	#const EXTRA_FORAGE_GROUPS 2
	#const EXTRA_FORAGE_OBJECTS 2
elseif MEDIUM_MAP
	#const EXTRA_FORAGE_GROUPS 3
	#const EXTRA_FORAGE_OBJECTS 3
elseif LARGE_MAP
	#const EXTRA_FORAGE_GROUPS 4
	#const EXTRA_FORAGE_OBJECTS 4
elseif HUGE_MAP
	#const EXTRA_FORAGE_GROUPS 5
	#const EXTRA_FORAGE_OBJECTS 5
elseif GIGANTIC_MAP
	#const EXTRA_FORAGE_GROUPS 6
	#const EXTRA_FORAGE_OBJECTS 6
elseif LUDIKRIS_MAP
	#const EXTRA_FORAGE_GROUPS 7
	#const EXTRA_FORAGE_OBJECTS 7
else
	#const EXTRA_FORAGE_GROUPS 0
	#const EXTRA_FORAGE_OBJECTS 0
endif

RMS support nested comment, but syntax highlight doesn't

Info

  • VS Code version: 1.16.1
  • Extension version: 0.2.9

Description

In RMS, it support nested comment (though it confuse me, but it does). Syntax highlight should also support it, or developers will be bothered when they use nested comment accidentally.

Except

/*
 * Comment
/*
 * Nested Comment
 */

SOME INSTRUCTION...

Because the nested comment doesn't be close, the code after comment should also be comment's syntax highlight.

Actually

As above, the comment's syntax highlight will be stop on the first comment closing.

Screenshot

On below, it should be green at all as it not really closing comment.
2017-09-24 8 14 21

On below, it should be green at all, and stop on the second closing syntax.
2017-09-24 8 12 46

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.