Project

General

Profile

Feature #927

Add "exit" in addition to "ciao"

Added by Anna Maria Bigatti over 7 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
CoCoA-5 function: new
Start date:
21 Sep 2016
Due date:
% Done:

100%

Estimated time:
1.56 h
Spent time:

Related issues

Related to CoCoA-5 - Bug #928: ciao, exit, quit can be used not only at top levelNew2016-09-21

History

#1 Updated by Anna Maria Bigatti over 7 years ago

  • Target version set to CoCoA-5.2.0 spring 2017

#2 Updated by John Abbott over 7 years ago

  • Category set to CoCoA-5 function: new

I think it should not be too hard to add an "exit" command, but this means introducing a new keyword which could, in principle, break existing code (if someone has used "exit" as a variable/fn name).

#3 Updated by John Abbott over 7 years ago

  • Status changed from New to Resolved
  • Assignee set to John Abbott
  • % Done changed from 0 to 80

What I did to add command "exit".

cd src/CoCoA-5
fgrep Ciao Lexer.C
--> Keyword("Ciao", TT_CIAO)

In Lexer.H add TT_EXIT to enum TokenType
In Lexer.C add Keyword("Exit", TT_EXIT) to keywordTable

In Parser.C 3 changes:
(1) add case TT_EXIT to UnexpectedTokenException::humanReadable(...)
(2) add case TT_EXIT to mayStartOrFollowAStatement(...)
(3) add case TT_EXIT to Parser::parseFunBodyStatement()

In AST.C 2 changes:
(1) add appropriate dumpAsString(...) mem fn
[in this case just modify an existing one]
(2) add appropriate DumpAsTreeVisitor::visit(...) fn
[in this case just modify an existing one]

In C5.C add "Exit" to keywordRE (in CocoaHighlighter ctor around line 460)

Running "make" produced a CoCoAInterpreter but "exit" did not work properly.
After doing "make clean; make" it worked fine.

PS I also added "exit" to the CoCoAManual!

#4 Updated by John Abbott over 7 years ago

  • Related to Bug #928: ciao, exit, quit can be used not only at top level added

#5 Updated by John Abbott over 7 years ago

I have added the keywords exit and quit to the file cocoa5.el.

#6 Updated by John Abbott over 7 years ago

  • Status changed from Resolved to Feedback
  • % Done changed from 80 to 90

I have also change the "goodbye pop-up window" in the GUI so that it says "Ciao" instead of "Bye".

#7 Updated by Anna Maria Bigatti about 7 years ago

  • Status changed from Feedback to Closed
  • % Done changed from 90 to 100
  • Estimated time set to 1.56 h

Also available in: Atom PDF