Skip to content
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 ABAP language #636

Merged
merged 6 commits into from
Sep 11, 2015
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions components.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ var components = {

// ---

"abap": {
"title": "ABAP",
"owner": "dellagustin"
},
"actionscript": {
"title": "ActionScript",
"require": "javascript",
Expand Down
50 changes: 50 additions & 0 deletions components/prism-abap.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

68 changes: 68 additions & 0 deletions examples/prism-abap.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<h1>ABAP</h1>
<p>To use this language, use the class "language-abap".</p>

<h2>Comments</h2>
<pre><code>
* Line Comments
&quot; End of line comment used as line comment.
value = 1. &quot; End of line comment

DATA:
&quot;! ABAPDoc comment
value TYPE i.
</code></pre>

<h2>Strings</h2>

<pre><code>
my_string = 'Simple string'.
my_string = 'String with an escaped '' inside'.
my_string = |A string template: { nvalue } times|.
my_string = |A string template: { nvalue } times|.
my_string = |Characters \|, \{, and \} have to be escaped by \\ in literal text.|.
</code></pre>

<h2>Numbers and Operators</h2>

<pre><code>
value = 001 + 2 - 3 * 4 / 5 ** 6.

IF value &lt; 1 OR
value = 2 OR
value &gt; 3 OR
value &lt;&gt; 4 OR
value &lt;= 5 OR
value &gt;= 6.
ENDIF.

" Dynamic object assignment (with type cast check)
lo_interface ?= lo_class.
</code></pre>

<h2>Structures and Classes</h2>

<pre><code>
DATA:
BEGIN OF my_structure,
scomponent TYPE i,
END OF my_structure.

CLASS lcl_my_class DEFINITION.
PUBLIC SECTION.
METHODS my_method
RETURNING
VALUE(ret_value) TYPE i.
ENDCLASS.

CLASS lcl_my_class IMPLEMENTATION.
METHOD my_method.
ret_value = 1.
ENDMETHOD
ENDCLASS.

DATA lo_instace TYPE REF TO lcl_my_class.

CREATE OBJECT lo_instace.

my_structure-component = lo_instace->my_method( ).
</code></pre>