Skip to content

Invalid rune literal syntax generation for class matcher #147

@sno2

Description

@sno2

Given this grammar:

ox80_oxBF <- [\200-\277]

The generated grammar code has a syntax error saying more than one character in rune literal:

var g = &grammar{
	rules: []*rule{
		{
			name: "ox80_oxBF",
			pos:  position{line: 1, col: 1, offset: 0},
			expr: &charClassMatcher{
				pos:        position{line: 1, col: 14, offset: 13},
				val:        "[\\200-\\277]",
				ranges:     []rune{'\u0080', '┬┐'}, // <- error here
				ignoreCase: false,
				inverted:   false,
			},
		},
	},
}

Thank you for your work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions