Skip to content

Cannot assign 'STRING' text to a field. #3640

@tamasmiklossy

Description

@tamasmiklossy

Steps to reproduce:

  1. Create a new Xtext project with the Xtext new project wizard.

  2. Modify the grammar to

	grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals

	generate myDsl "http://www.xtext.org/example/mydsl/MyDsl"

	Model:
		a = 'STRING';
  1. Execute the GenerateMyDsl.mwe2 workflow.

  2. Modify the generated loadModel() test case in the MyDslParsingTest.xtend file to

	@Test
	def void loadModel() {
		val result = parseHelper.parse('''
			STRING
		''')
		Assertions.assertNotNull(result)
		println(result.a)
		val errors = result.eResource.errors
		Assertions.assertTrue(errors.isEmpty, '''Unexpected errors: «errors.join(", ")»''')
	}
  1. The test case will fail with the error message: Unexpected errors: XtextSyntaxDiagnostic: null:1 String literal is not properly closed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions