D10783: Yacc/Bison: Fix the $ symbol and update syntax for Bison

2018-02-24 Thread Dominik Haumann
dhaumann closed this revision.
dhaumann added a comment.


  Done, see commit 
https://commits.kde.org/syntax-highlighting/f5a32272d26e3b46d4c4201a5d9531de8f23867a

REPOSITORY
  R216 Syntax Highlighting

REVISION DETAIL
  https://phabricator.kde.org/D10783

To: nibags, #framework_syntax_highlighting, dhaumann
Cc: dhaumann, #framework_syntax_highlighting, #frameworks, michaelh, 
genethomas, kmorwinski, cullmann, vkrause


D10783: Yacc/Bison: Fix the $ symbol and update syntax for Bison

2018-02-24 Thread Dominik Haumann
dhaumann accepted this revision.
dhaumann added a comment.
This revision is now accepted and ready to land.


  Looks good to me, will integrate.

REPOSITORY
  R216 Syntax Highlighting

BRANCH
  update-yacc-bison (branched from master)

REVISION DETAIL
  https://phabricator.kde.org/D10783

To: nibags, #framework_syntax_highlighting, dhaumann
Cc: dhaumann, #framework_syntax_highlighting, #frameworks, michaelh, 
genethomas, kmorwinski, cullmann, vkrause


D10783: Yacc/Bison: Fix the $ symbol and update syntax for Bison

2018-02-23 Thread Nibaldo González
nibags edited the summary of this revision.

REPOSITORY
  R216 Syntax Highlighting

REVISION DETAIL
  https://phabricator.kde.org/D10783

To: nibags, #framework_syntax_highlighting
Cc: #framework_syntax_highlighting, #frameworks, michaelh, genethomas, 
cullmann, vkrause, dhaumann


D10783: Yacc/Bison: Fix the $ symbol and update syntax for Bison

2018-02-23 Thread Nibaldo González
nibags edited the summary of this revision.
nibags added a reviewer: Framework: Syntax Highlighting.
nibags added a project: Framework: Syntax Highlighting.
nibags added a subscriber: Framework: Syntax Highlighting.

REPOSITORY
  R216 Syntax Highlighting

REVISION DETAIL
  https://phabricator.kde.org/D10783

To: nibags, #framework_syntax_highlighting
Cc: #framework_syntax_highlighting, #frameworks, michaelh, genethomas, 
cullmann, vkrause, dhaumann


D10783: Yacc/Bison: Fix the $ symbol and update syntax for Bison

2018-02-23 Thread Nibaldo González
nibags created this revision.
Restricted Application added a project: Frameworks.
Restricted Application added a subscriber: Frameworks.
nibags requested review of this revision.

REVISION SUMMARY
  Hi
  The Yacc/Bison file highlights as 'dsError' the '$' symbol (it is used as 
pseudo-variable). The problem comes from the 'isocpp.xml' file of C++, which 
highlights it as 'Error' (probably, this was added to the C++ file later).
  data/syntax/yacc.xml (lines 131 & 132):
  
131|  
132|  
133|  
  
  autotests/reference/highlight.y.ref :
  
35|  […] ($2) 
[...]
40|   $$  […]
  
  That is corrected. Also, this file is outdated for Bison. Therefore, it is 
updated according to the parser of the latest version of Bison (3.0.4).
  
  Changes/fixes for Bison:
  
  - Add declarations that contain blocks of code that are not currently 
highlighted. For example: %code { C++ code... } %destructor { C++ code, with 
symbols $… } %initial-action { C++ code, with symbols $… }
  - Add the Bison variable '@' (@$, @n, @[name], $@n).
  - Add directives in rules: %?{ expr…},  %empty, %prec, %dprec and %merge.
  - Allow a tag in %union declarations. Ex: %union tag { code … }
  - Allow grammar declarations in the grammar rules section, such as: %union, 
%code, %type, etc.
  - Allow declarations in multiple lines. Ex: %token PERCENT_DEBUG   
"%debug" PERCENT_DEFAULT_PREC"%default-prec" ;
  - The ';' char is not necessary to finish a rule. Allow ';' followed by ‘|’, 
within a rule (See line 603 in the “src/parse-gram.y” file, from the Bison 
3.0.4 source [2]).
  - Add the mimetypes (text/x-yacc, text/x-bison) and the extensions '.ypp' & 
'.y++' [3].
  
  I hope these changes are useful. 
  Any inconvenience (as if it is necessary to contact the original author of 
the file to approve the changes), do not hesitate to notify.
  
  Source: 
  [1] https://www.gnu.org/software/bison/manual/html_node/Table-of-Symbols.html
  [2] https://ftp.gnu.org/gnu/bison/bison-3.0.4.tar.xz ( ./src/parse-gram.y )
  [3] https://www.gnu.org/software/bison/manual/html_node/Invocation.html

TEST PLAN
  I've been testing these changes the last week and I think it's ready.

REPOSITORY
  R216 Syntax Highlighting

BRANCH
  update-yacc-bison (branched from master)

REVISION DETAIL
  https://phabricator.kde.org/D10783

AFFECTED FILES
  autotests/folding/highlight.y.fold
  autotests/html/highlight.y.html
  autotests/input/highlight.y
  autotests/reference/highlight.y.ref
  data/syntax/yacc.xml

To: nibags
Cc: #frameworks, michaelh