-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The type casting code does not work in typescript. Assuming structure is correct for "true" case.
- Loading branch information
Showing
2 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import {Parser, Lexer, Token, TokenStream, ParserRuleContext} from "antlr4"; | ||
import CPP14Parser from './CPP14Parser'; | ||
import ParametersAndQualifiersContext from './CPP14Parser'; | ||
|
||
export default abstract class CPP14ParserBase extends Parser { | ||
|
||
constructor(input: TokenStream) { | ||
super(input); | ||
} | ||
|
||
protected IsPureSpecifierAllowed() : boolean { | ||
try { | ||
var x = this._ctx; // memberDeclarator | ||
var c = (x.children[0] as ParserRuleContext).children[0] as ParserRuleContext; | ||
var c2 = c.children[0] as ParserRuleContext; | ||
var p = c2.children[1] as ParserRuleContext; | ||
if (p == undefined) | ||
return false; | ||
// console.log("P " + p); | ||
// var q = p.constructor === ParametersAndQualifiersContext; | ||
var q = p instanceof ParametersAndQualifiersContext; | ||
// console.log("Q " + q); | ||
return true; | ||
} catch (e) { | ||
} | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<desc xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../_scripts/desc.xsd"> | ||
<targets>Cpp;CSharp;Dart;Java;JavaScript;Python3</targets> | ||
<targets>Cpp;CSharp;Dart;Java;JavaScript;Python3;TypeScript</targets> | ||
</desc> |