Skip to content

Commit

Permalink
Merge pull request #2141 from oranoran/lexer-atn-prop
Browse files Browse the repository at this point in the history
[JavaScript] enable auto-suggest engines by exposing the lexer ATN as a property, similar to the parser ATN
  • Loading branch information
parrt authored Dec 6, 2017
2 parents b9adef5 + dd4a1c8 commit 864f8fc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion contributors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -174,4 +174,5 @@ YYYY/MM/DD, github id, Full name, email
2017/11/02, jasonmoo, Jason Mooberry, jason.mooberry@gmail.com
2017/11/05, ajaypanyala, Ajay Panyala, ajay.panyala@gmail.com
2017/11/24, zqlu.cn, Zhiqiang Lu, zqlu.cn@gmail.com
2017/11/28, niccroad, Nicolas Croad, nic.croad@gmail.com
2017/11/28, niccroad, Nicolas Croad, nic.croad@gmail.com
2017/12/03, oranoran, Oran Epelbaum, oran / epelbaum me
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,12 @@ function <lexer.name>(input) {
<lexer.name>.prototype = Object.create(<if(superClass)><superClass><else>antlr4.Lexer<endif>.prototype);
<lexer.name>.prototype.constructor = <lexer.name>;

Object.defineProperty(<lexer.name>.prototype, "atn", {
get : function() {
return atn;
}
});

<lexer.name>.EOF = antlr4.Token.EOF;
<lexer.tokens:{k | <lexer.name>.<k> = <lexer.tokens.(k)>;}; separator="\n", wrap, anchor>

Expand Down

0 comments on commit 864f8fc

Please sign in to comment.