@@ -40,6 +40,34 @@ class Xtext2LangiumMultiLangTest extends AbstractXtext2LangiumTest {
40
40
terminal ID returns string: ' ^' ? (' a' .. ' z' | ' A' .. ' Z' | ' _' )(' a' .. ' z' | ' A' .. ' Z' | ' _' | ' 0' .. ' 9' )* ;
41
41
terminal INT returns number: ' 0' .. ' 9' + ;
42
42
' ' ' )
43
+ assertGeneratedFile(' Terminals . langium' , ' ' '
44
+
45
+ terminal ID returns string: ' ^' ? (' a' .. ' z' | ' A' .. ' Z' | ' _' )(' a' .. ' z' | ' A' .. ' Z' | ' _' | ' 0' .. ' 9' )* ;
46
+ terminal INT returns number: ' 0' .. ' 9' + ;
47
+ terminal STRING returns string: ' "' (' \\ ' . | ! (' \\ ' | ' "' ))* ' "' | " '" (' \\ ' . | ! (' \\ ' | " '" ))* " '" ;
48
+ hidden terminal ML_COMMENT returns string: ' /*' - > ' */' ;
49
+ hidden terminal SL_COMMENT returns string: ' //' ! (' \n ' | ' \r ' )(' \r ' ? ' \n ' )? ;
50
+ hidden terminal WS returns string: (' ' | ' \t ' | ' \r ' | ' \n ' )+ ;
51
+ terminal ANY_OTHER returns string: . ;
52
+ ' ' ' )
53
+ }
54
+ @Test
55
+ def void testTerminals_02() {
56
+ ' ' '
57
+ grammar io.typefox.xtext2langium. Test with org.eclipse.xtext.common. Terminals
58
+ generate xtext2langiumTest ' http://Xtext2LangiumTest'
59
+ import " http://www.eclipse.org/emf/2002/Ecore" as ecore
60
+
61
+ @Override
62
+ terminal ID : ' ^' ? (' a' .. ' z' |' A' .. ' Z' |' _' ) (' a' .. ' z' |' A' .. ' Z' |' _' |' 0' .. ' 9' )* ;
63
+ @Override
64
+ terminal INT returns ecore:: EInt : (' 0' .. ' 9' )+ ;
65
+ ' ' ' .assertGeneratedLangium(' ' '
66
+ import ' Terminals'
67
+
68
+ terminal ID returns string: ' ^' ? (' a' .. ' z' | ' A' .. ' Z' | ' _' )(' a' .. ' z' | ' A' .. ' Z' | ' _' | ' 0' .. ' 9' )* ;
69
+ terminal INT returns number: ' 0' .. ' 9' + ;
70
+ ' ' ' , [removeOverridenRules = true])
43
71
assertGeneratedFile(' Terminals . langium' , ' ' '
44
72
45
73
terminal STRING returns string: ' "' (' \\ ' . | ! (' \\ ' | ' "' ))* ' "' | " '" (' \\ ' . | ! (' \\ ' | " '" ))* " '" ;
@@ -85,7 +113,7 @@ class Xtext2LangiumMultiLangTest extends AbstractXtext2LangiumTest {
85
113
greetings+ = Greeting *
86
114
;
87
115
88
- ' ' ' )
116
+ ' ' ' , [conf | conf.removeOverridenRules = true] )
89
117
assertGeneratedFile(' uddl. langium' , ' ' '
90
118
grammar Uddl
91
119
import ' Terminals'
0 commit comments