File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed
src/main/java/org/perlonjava Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 116
116
- [ ] ** ` require ` operator** : The ` require ` operator is not yet implemented.
117
117
- [ ] ** ` use ` and ` no ` statements** : Module imports and version changes via ` use ` and ` no ` are missing.
118
118
- [ ] ** ` __SUB__ ` ** : The ` __SUB__ ` special variable is not yet supported.
119
- - [ ] ** Special literals** : ` __FILE__ ` , ` __LINE__ ` not yet supported.
119
+ - [x ] ** Special literals** : ` __FILE__ ` , ` __LINE__ `
120
120
- [ ] ** ` BEGIN ` block** : ` BEGIN ` blocks are missing.
121
121
- [ ] ** Labels** : Labels and their usage are not supported.
122
122
- [ ] ** Search for labels in call stack** : Label searching in the call stack is missing.
Original file line number Diff line number Diff line change @@ -517,9 +517,6 @@ public void visit(OperatorNode node) throws Exception {
517
517
listNode .accept (this );
518
518
}
519
519
return ;
520
- case "__PACKAGE__" :
521
- new StringNode (ctx .symbolTable .getCurrentPackage (), node .tokenIndex ).accept (this );
522
- return ;
523
520
case "$" :
524
521
case "@" :
525
522
case "%" :
Original file line number Diff line number Diff line change @@ -581,9 +581,12 @@ private Node parsePrimary() {
581
581
return new StringNode (token .text , tokenIndex );
582
582
}
583
583
switch (token .text ) {
584
+ case "__LINE__" :
585
+ return new NumberNode (Integer .toString (ctx .errorUtil .getLineNumber (tokenIndex )), tokenIndex );
586
+ case "__FILE__" :
587
+ return new StringNode (ctx .compilerOptions .fileName , tokenIndex );
584
588
case "__PACKAGE__" :
585
- // this takes no parameters
586
- return new OperatorNode (token .text , null , tokenIndex );
589
+ return new StringNode (ctx .symbolTable .getCurrentPackage (), tokenIndex );
587
590
case "not" :
588
591
// Handle 'not' keyword as a unary operator with an operand
589
592
operand = parseExpression (getPrecedence (token .text ) + 1 );
You can’t perform that action at this time.
0 commit comments