-
Notifications
You must be signed in to change notification settings - Fork 750
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add TTCN-3 testing language lexer #1337
Conversation
Hello, I added missing file spec/visual/samples/ttcn3 in my forked branch. Thanks a lot, Yann |
It automatically updates when you push to your GitHub repo! GitHub magic! |
Oh, cool, Many thanks, Yann |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry it took a bit of time to review this, @YannGarcia. Hopefully the comments make sense!
Hello Michael, I have an issue with the CI process and I don't understand where is it. Many thanks in advance, Yann |
Hello Michael,
Not really, I just reused my existing local Rouge code. The point is that
until now I was using it internally but it was requested me to add it in
ETSI forge which is based on GitLab.
This is why I sent you the Pull request.
Thanks a lot,
Best regards,
Yann Garcia
Senior Software Engineer
Microsoft MCAD.net Certified
**************************************
FSCOM SARL
Le Montespan B2
6,
<https://maps.google.com/?q=6,%C2%A0+Avenue+des+Alpes&entry=gmail&source=g>
Avenue des Alpes
<https://maps.google.com/?q=6,%C2%A0+Avenue+des+Alpes&entry=gmail&source=g>
F-06600 Antibes, FRANCE
************************************************
Tel: +33 (0)4 92 94 49 08
Mobile: +33 (0)6 68 94 57 76
Email: *yann.garcia@fscom.fr <yann.garcia@fscom.fr>*
Skype: yann.garcia
…On Tue, 15 Oct 2019 at 15:15, Michael Camilleri ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In lib/rouge/lexers/ttcn3.rb
<#1337 (comment)>:
> +
+ def self.types
+ @types = %w(
+ anytype address boolean bitstring charstring hexstring octetstring
+ component enumerated float integer port record set of union universal
+ )
+ end
+
+ # optional comment or whitespace
+ ws = %r((?:\s|//.*?\n|/[*].*?[*]/)+)
+ id = /[a-zA-Z_][a-zA-Z0-9_]*/
+ const_name = /[A-Z][a-zA-Z0-9_]*\b/
+ module_name = /[A-Z][a-zA-Z0-9_]*\b/
+
+ state :root do
+ rule %r/\s+/, Text
The problem with the previous version was that I'd removed your newline
rule at the end of the :root state but I'd forgotten to change this rule.
You originally had it as rule %r/[^\S\n]/, Text. Is there a reason you
were structuring it like this?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1337?email_source=notifications&email_token=ABGH6BOAJYXH6MXOXNZDQQ3QOW7ANA5CNFSM4I4E4OX2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCH7JLBQ#pullrequestreview-301897094>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABGH6BM5MLZQ2JOJPR3VZJLQOW7ANANCNFSM4I4E4OXQ>
.
|
No, I think it's my mistake :(
Yann
Best regards,
Yann Garcia
Senior Software Engineer
Microsoft MCAD.net Certified
**************************************
FSCOM SARL
Le Montespan B2
6,
<https://maps.google.com/?q=6,%C2%A0+Avenue+des+Alpes&entry=gmail&source=g>
Avenue des Alpes
<https://maps.google.com/?q=6,%C2%A0+Avenue+des+Alpes&entry=gmail&source=g>
F-06600 Antibes, FRANCE
************************************************
Tel: +33 (0)4 92 94 49 08
Mobile: +33 (0)6 68 94 57 76
Email: *yann.garcia@fscom.fr <yann.garcia@fscom.fr>*
Skype: yann.garcia
…On Tue, 15 Oct 2019 at 15:27, Michael Camilleri ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In lib/rouge/lexers/ttcn3.rb
<#1337 (comment)>:
> +
+ def self.types
+ @types = %w(
+ anytype address boolean bitstring charstring hexstring octetstring
+ component enumerated float integer port record set of union universal
+ )
+ end
+
+ # optional comment or whitespace
+ ws = %r((?:\s|//.*?\n|/[*].*?[*]/)+)
+ id = /[a-zA-Z_][a-zA-Z0-9_]*/
+ const_name = /[A-Z][a-zA-Z0-9_]*\b/
+ module_name = /[A-Z][a-zA-Z0-9_]*\b/
+
+ state :root do
+ rule %r/\s+/, Text
@YannGarcia <https://github.com/YannGarcia> wrote:
Not really, I just reused my existing local Rouge code. The point is that
until now I was using it internally but it was requested me to add it in
ETSI forge which is based on GitLab.
This is why I sent you the Pull request.
Sorry, my question was a little unclear. What I meant was that /[\S\n]+/
will match all whitespace characters *except* \n. That seems like an
unusual choice and I wondered if it was intentional?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1337?email_source=notifications&email_token=ABGH6BIQRGMDHZE4T4LKMMDQOXAM3A5CNFSM4I4E4OX2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCH7LOMY#discussion_r334949939>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABGH6BKD2KUWDSFOWQAHLSTQOXAM3ANCNFSM4I4E4OXQ>
.
|
@YannGarcia There are a couple of questions left outstanding in my review (you will need to visit GitHub to see them properly). Look forward to hearing from you on those points! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've gone through and removed a lot of (what looked to me like) unnecessary states and rules. The lexer as written now will not identify some of the syntax errors that the previous version did but that is consistent with the other lexers in Rouge. Lexing is not the same as parsing and we take the view that it's better to have a simpler (and more maintable) lexer.
I had one remaining comment (see below).
Thanks for the submission! The next release will be on Tuesday. TTCN-3 support will be part of that release :) |
Hello, My apologies for the delay, I was quite busy these weeks. Have a nice day, Yann |
The name of the language
TTCN-3 testing language is standardized by ETSI. Latest TTCN-3 core language standard can be found here.
This language is used to develop conformance and interoperability test suites for variety of protocols such as Intelligent Transport System protocols, Telco's protocols... All these test suite are available on the ESTI forge.
NOTE: Please ignore Issue #1336
Implementation
The TTCN-3 testing language lexer includes 3 files (to be merged)
TTCN-3 lexer validation

This lexer was validated using rackup/ruby2.5 (see attached screenshot).
Thanks to add this contribution to Rouge syntax highlighter.
Best regards,
Yann Garcia
Senior Software EngineerMicrosoft MCAD.net Certified