diff --git a/examples/error_handling.js b/examples/error_handling.js index 84fcbe5..81c4583 100644 --- a/examples/error_handling.js +++ b/examples/error_handling.js @@ -41,7 +41,7 @@ function ignore_errors(e) { } // Unhandled error. Will stop parse and raise exception - return true; + return false; } function test_error_handling() { diff --git a/larkjs/lark.js b/larkjs/lark.js index e7f240c..103da34 100644 --- a/larkjs/lark.js +++ b/larkjs/lark.js @@ -306,7 +306,7 @@ function list_repeat(list, count) { } function isupper(a) { - return /^[A-Z]*$/.test(a); + return /^[A-Z_$]*$/.test(a); } function rsplit(s, delimiter, limit) { diff --git a/package.json b/package.json index 8579fc6..69920f0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "Lark.js", "description": "live port of the Lark standalone parser to Javascript", - "version": "0.1.0", + "version": "0.1.2", "scripts": { "test": "mocha" }, diff --git a/pyproject.toml b/pyproject.toml index 93b80ae..2b8ded3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "Lark-js" -version = "0.1.0" +version = "0.1.2" description = "An extension to Lark that generates a Javascript standalone" authors = ["Erez Shin "] license = "MIT" diff --git a/setup.py b/setup.py index a271a09..472532a 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ setup_kwargs = { 'name': 'lark-js', - 'version': '0.1.0', + 'version': '0.1.2', 'description': 'An extension to Lark that generates a Javascript standalone', 'long_description': '# Lark.js\n\n**Generate LALR(1) parsers in Javascript**\n\nLark is a popular parsing toolkit for Python.\n\nThis project is a live port of the Lark standalone parser to Javascript.\n\n**Lark.js** takes a `.lark` grammar, and from it generates a standalone Javascript parser.\n\nThe LALR(1) algorithm guarantees O(n) running time (proportional to input length), and minimal memory consumption.\n\n### Lark grammars\n\nLark grammars are written in an augmented EBNF (a textual format), and usually use the `.lark` extension.\n\nBecause they are purely declarative, and don\'t contain code, they are entirely portable between languages.\n\nIt is now possible to use Lark grammars in 3 languages: Python, Javascript, and Julia.\n\n#### "Hello World" Grammar\n\nThe following Lark grammar will match the string "Hello, World!" --\n\n```lark\n// A bunch of words\nstart: word+ \n\n// Allow optional punctuation after each word\nword: WORD ["," | "!"]\n\n// imports WORD from library\n%import common.WORD \n\n// Disregard spaces in text\n%ignore " " \n```\n\n### Quick links\n\n- [Documentation](https://lark-parser.github.io/Lark.js/index.html)\n- [Examples](https://github.com/lark-parser/Lark.js/tree/master/examples)\n- [Online IDE](https://lark-parser.github.io/ide)\n- [Gitter chat](https://gitter.im/lark-parser/Lobby) - A place to ask questions and discuss\n- [Lark](https://github.com/lark-parser/lark) - The Python library\n\n### Install Lark.js\n\nInstall lark-js on Python:\n\n```sh\n pip install lark-js --upgrade\n```\n\n### Generate a Javascript LALR(1) parser\n\n```sh\n\tlark-js my_grammar.lark -o my_parser.js\n```\n\nFor help, run:\n\n```sh\n\tlark-js --help\n```\n\n## Features\n\n - **LALR(1)** parser - Fast and light\n - **EBNF** grammar\n - Builds a parse-tree (AST) automagically, based on the structure of the grammar\n - Usable in the browser and in Node.js\n - Interactive parsing (step-by-step)\n - Error handling\n - Tree utilities (including transformers & visitors)\n - Line & column tracking\n - Standard library of terminals (strings, numbers, names, etc.)\n - Import grammars from Nearley.js\n\n Planned features:\n\n - Support for Earley\n\n### Syntax Highlighting\n\nLark provides syntax highlighting for its grammar files (\\*.lark):\n\n- [Sublime Text & TextMate](https://github.com/lark-parser/lark_syntax)\n- [vscode](https://github.com/lark-parser/vscode-lark)\n- [Intellij & PyCharm](https://github.com/lark-parser/intellij-syntax-highlighting)\n- [Vim](https://github.com/lark-parser/vim-lark-syntax)\n- [Atom](https://github.com/Alhadis/language-grammars)\n\n### Live Port\n\nUsually, ports from one language to another are at risk of falling out of sync as time goes on.\n\nBut Lark.js wasn\'t translated by hand -- 98% of the lines were transpiled directly from Lark\'s Python code!\n\nThat means that futures updates to Lark-Python (fixes, features, etc.) will automatically sync to Lark.js.\n\n## License\n\nLark.js uses the [MIT license](LICENSE).\n\n## Contribute\n\nLark.js is accepting pull-requests. If you would like to help, open an issue or find us on gitter.\n\n## Sponsoring\n\nLark.js was made possible with the help of a generous donation by [Smore](https://www.smore.com/) ❤️\n\nIf you like Lark, and want to see it grow, please consider [sponsoring us!](https://github.com/sponsors/lark-parser)\n', 'author': 'Erez Shin', pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy