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

Vala parser (in progress) #2677

Draft
wants to merge 44 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
9fb1721
main,comment: fix wrong comments
masatake Oct 23, 2020
e1c7460
tokeninfo: add functions to make a tag from a tokeninfo
masatake Oct 23, 2020
4a4dbab
tokeninfo: add functions to skip multiple types
masatake Dec 19, 2020
9bf678a
tokeninfo: add functions to skip multiple types over pairs
masatake Dec 19, 2020
39170f8
tokeninfo: provide the way to activate/deactivate a type pair
masatake Dec 19, 2020
8fcebab
Vala: new parser
masatake Nov 17, 2019
57cc17c
Vala: improve the parser
albfan Dec 7, 2019
6db5339
Vala: fix some minor nits
rrthomas Oct 8, 2020
159c7c5
Vala: ignore attributes
rrthomas Oct 8, 2020
ca39bd8
Vala: support interfaces, argument lists of methods, methods, more ke…
rrthomas Oct 11, 2020
9532fe5
Vala: more parser improvements
rrthomas Oct 11, 2020
4333cc2
Vala: update the COPYRIGHT notice
masatake Oct 23, 2020
94a9ded
Vala: add a URL for the language reference
masatake Oct 23, 2020
34d9133
Vala: rename parameters
masatake Oct 23, 2020
716996e
Vala,cosmetic: fix style of if/else
masatake Oct 23, 2020
581bfc4
Vala: record the line number correctly
masatake Oct 23, 2020
381e830
Vala: rearrange the way to add fields
masatake Oct 23, 2020
a434009
Vala: fill end: field of method kind tags
masatake Oct 23, 2020
675cea8
Vala: use makeSimpleTagFromToken
masatake Oct 23, 2020
40d8f31
Vala: fill end: field for more kinds
masatake Oct 23, 2020
f2cdb69
Units,Vala: add --sort=no to namespace.vala
masatake Oct 23, 2020
6751712
Units,Vala: extend namespace.vala to test end: fields
masatake Oct 23, 2020
0726e68
Vala: consider other than public when filling access: fields
masatake Oct 23, 2020
fb3cd6b
Vala: fill inherits: field of class kind entries
masatake Oct 23, 2020
c312e80
Vala: accept qualified names as class names
masatake Oct 23, 2020
dd6181c
Vala: use tokenIsTypeVal instead of tokenEqTye
masatake Oct 23, 2020
a033dbf
Vala: define built-in types as keywords
masatake Dec 19, 2020
719e5ab
Vala: tag enum and enum values
masatake Dec 19, 2020
98155c8
Vala: tag errordomain and errorcode
masatake Dec 19, 2020
1eda73a
Vala: tag structs
masatake Dec 20, 2020
89ae0e9
Vala: tag fields having initializer
masatake Dec 20, 2020
3d83ef8
Vala: accept an enumvalue with ending ',}'
masatake Dec 23, 2020
c74720c
Vala: tag methods defined as parts of an enum
masatake Dec 23, 2020
8e16ea9
Vala: handle "static" keyword in class definitions
masatake Dec 9, 2023
968fa7c
Vala: skip construct keyword
masatake Dec 9, 2023
46f6b90
Vala: extract methods
masatake Dec 9, 2023
09ca963
Vala: skip array markers
masatake Dec 9, 2023
7a1c04c
Vala: skip const keyword
masatake Dec 9, 2023
1d6ab33
Vala: extract constructors as method
masatake Dec 9, 2023
483df07
Vala: skip the combinations of const and static
masatake Dec 9, 2023
fdce7ff
Vala: skip "new" keyword
masatake Dec 9, 2023
041961c
Vala: extract signals
masatake Dec 10, 2023
b3426b1
Vala: let recurseValaTags return whether it handles something or not
masatake Dec 10, 2023
bb54fdb
Vala: handle nested classes
masatake Dec 10, 2023
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
1 change: 1 addition & 0 deletions Tmain/list-fields-with-prefix.d/stdout-expected.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@ x UCTAGSxpath no NONE s-- no -- xpath for
- UCTAGStarget yes Thrift s-- no -- the target language specified at "namespace"
- UCTAGSthrows yes Thrift s-- no -- throws list of function
- UCTAGSarchitecture yes VHDL s-- no -- architecture designing the entity
- UCTAGSproperties yes Vala s-- no -- properties (static)
- UCTAGSparameter no Verilog --b no -- parameter whose value can be overridden.
1 change: 1 addition & 0 deletions Tmain/list-fields.d/stdout-expected.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ z kind no NONE s-- no r- [tags output] prepend "kind:" to k/ (or K/) field outpu
- target yes Thrift s-- no -- the target language specified at "namespace"
- throws yes Thrift s-- no -- throws list of function
- architecture yes VHDL s-- no -- architecture designing the entity
- properties yes Vala s-- no -- properties (static)
- parameter no Verilog --b no -- parameter whose value can be overridden.
#
Foo input.java /^abstract public class Foo extends Bar$/
Expand Down
2 changes: 2 additions & 0 deletions Units/parser-genie.r/simple.genie.b/args.ctags
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--sort=no
--fields=+neKl
1 change: 1 addition & 0 deletions Units/parser-genie.r/simple.genie.b/expected.tags
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
main input.gs 1;" method line:1 language:Genie
2 changes: 2 additions & 0 deletions Units/parser-genie.r/simple.genie.b/input.gs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
init
print "Hello World"
2 changes: 2 additions & 0 deletions Units/parser-vala.r/attributes.vala.d/args.ctags
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--sort=no
--fields=+neKl
1 change: 1 addition & 0 deletions Units/parser-vala.r/attributes.vala.d/expected.tags
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Delegate input.vala /^public delegate bool Delegate ();$/;" method line:2 language:Vala end:2
2 changes: 2 additions & 0 deletions Units/parser-vala.r/attributes.vala.d/input.vala
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[CCode (has_target="false")]
public delegate bool Delegate ();
2 changes: 2 additions & 0 deletions Units/parser-vala.r/class.vala.d/args.ctags
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--sort=no
--fields=+neKl{signature}{access}
26 changes: 26 additions & 0 deletions Units/parser-vala.r/class.vala.d/expected.tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
main input.vala /^void main(string[] args) {$/;" method line:8 language:Vala signature:(string [] args) end:13
Address input.vala /^public class Address {$/;" class line:15 language:Vala end:21
country input.vala /^ string country;$/;" field line:16 language:Vala class:Address typeref:typename:string end:16
city input.vala /^ public string city;$/;" field line:17 language:Vala class:Address typeref:typename:string access:public end:17
street input.vala /^ protected string street;$/;" field line:18 language:Vala class:Address typeref:typename:string access:protected end:18
building input.vala /^ internal int building;$/;" field line:19 language:Vala class:Address typeref:typename:int access:internal end:19
floor input.vala /^ private int floor;$/;" field line:20 language:Vala class:Address typeref:typename:int access:private end:20
Person input.vala /^class Person {$/;" class line:23 language:Vala end:45
address input.vala /^ public Address address {get; set;}$/;" property line:24 language:Vala class:Person typeref:unknown:Address access:public end:24
name input.vala /^ public string name {get; set;}$/;" property line:25 language:Vala class:Person typeref:typename:string access:public end:25
d_age input.vala /^ private int d_age;$/;" field line:26 language:Vala class:Person typeref:typename:int access:private end:26
population input.vala /^ static int population;$/;" field line:28 language:Vala class:Person typeref:typename:int end:28 properties:static
age input.vala /^ public int age {$/;" property line:30 language:Vala class:Person typeref:typename:int access:public end:39
getLastAge input.vala /^ int getLastAge (int n) throws GLib.Error { return d_age - n; }$/;" method line:41 language:Vala class:Person typeref:typename:int signature:(int n) end:41
table input.vala /^ string [] table = {"a", "b"};$/;" field line:43 language:Vala class:Person typeref:typename:string end:43
ctable input.vala /^ const string [] ctable = {"a", "b"};$/;" field line:44 language:Vala class:Person typeref:typename:string end:44
Car input.vala /^public class Car {$/;" class line:47 language:Vala end:66
n_seat input.vala /^ public int n_seat;$/;" field line:48 language:Vala class:Car typeref:typename:int access:public end:48
Car input.vala /^ public Car () {$/;" method line:49 language:Vala class:Car access:public signature:() end:51
sctable input.vala /^ static const string [] sctable = {"a", "b"};$/;" field line:52 language:Vala class:Car typeref:typename:string end:52 properties:static
@get input.vala /^ public new string? @get (string key) {$/;" method line:54 language:Vala class:Car typeref:typename:string access:public signature:(string key) end:56
value_changed input.vala /^ public signal void value_changed (string name, Variant value);$/;" signal line:58 language:Vala class:Car typeref:typename:void access:public signature:(string name, Variant value) end:58
addSeat input.vala /^ int addSeat (int n) { return n_seat + n; }$/;" method line:59 language:Vala class:Car typeref:typename:int signature:(int n) end:59
Seat input.vala /^ public class Seat {$/;" class line:61 language:Vala class:Car end:63
x input.vala /^ int x;$/;" field line:62 language:Vala class:Car.Seat typeref:typename:int end:62
more input.vala /^ public int more;$/;" field line:65 language:Vala class:Car typeref:typename:int access:public end:65
66 changes: 66 additions & 0 deletions Units/parser-vala.r/class.vala.d/input.vala
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*
* vala HelloWorld
*
* $ valac input.vala
* $ ./input
* Hello John, you're 21 years old
*/
void main(string[] args) {
var p = new Person();
p.name = "John";
p.age = 21;
print("Hello %s, you're %d years old\n", p.name, p.age);
}

public class Address {
string country;
public string city;
protected string street;
internal int building;
private int floor;
}

class Person {
public Address address {get; set;}
public string name {get; set;}
private int d_age;

static int population;

public int age {
get { return d_age;}
set {
if (value > 0) {
d_age = value;
} else {
d_age = 0;
}
}
}

int getLastAge (int n) throws GLib.Error { return d_age - n; }

string [] table = {"a", "b"};
const string [] ctable = {"a", "b"};
}

public class Car {
public int n_seat;
public Car () {
n_seat = 0;
}
static const string [] sctable = {"a", "b"};

public new string? @get (string key) {
return null;
}

public signal void value_changed (string name, Variant value);
int addSeat (int n) { return n_seat + n; }

public class Seat {
int x;
}

public int more;
}
2 changes: 2 additions & 0 deletions Units/parser-vala.r/comments.vala.d/args.ctags
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--sort=no
--fields=+neKl
6 changes: 6 additions & 0 deletions Units/parser-vala.r/comments.vala.d/expected.tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
f1 input.vala /^void f1 () {$/;" method line:1 language:Vala end:3
f2 input.vala /^void f2 () {print ("hello");} \/\/ void g3 () { print ("hello");}$/;" method line:7 language:Vala end:7
f3 input.vala /^void f3 () {print ("hello");} void g4 () { print ("hello");}$/;" method line:8 language:Vala end:8
g4 input.vala /^void f3 () {print ("hello");} void g4 () { print ("hello");}$/;" method line:8 language:Vala end:8
f4 input.vala /^void f4 () {print ("hello"); \/\/ void g5 () { print ("hello");}$/;" method line:9 language:Vala end:11
g7 input.vala /^} void g7 () { print ("hello");} \/\/ void g8 () {} ; void f5 () { print ("hello");} # void g/;" method line:11 language:Vala end:11
11 changes: 11 additions & 0 deletions Units/parser-vala.r/comments.vala.d/input.vala
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
void f1 () {
print ("hello");
}
// void g0 () { print ("hello");}
// void g1 () { print ("hello");}

void f2 () {print ("hello");} // void g3 () { print ("hello");}
void f3 () {print ("hello");} void g4 () { print ("hello");}
void f4 () {print ("hello"); // void g5 () { print ("hello");}
// void g6 () { print ("hello");}
} void g7 () { print ("hello");} // void g8 () {} ; void f5 () { print ("hello");} # void g9 () {}
1 change: 1 addition & 0 deletions Units/parser-vala.r/construct.d/args.ctags
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--sort=no
2 changes: 2 additions & 0 deletions Units/parser-vala.r/construct.d/expected.tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Abc input.vala /^class Abc : Object {$/;" c
main input.vala /^void main(string[] args) {}$/;" m
7 changes: 7 additions & 0 deletions Units/parser-vala.r/construct.d/input.vala
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
using GLib;

class Abc : Object {
construct {}
}

void main(string[] args) {}
1 change: 1 addition & 0 deletions Units/parser-vala.r/enum.vala.d/args.ctags
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--sort=no
30 changes: 30 additions & 0 deletions Units/parser-vala.r/enum.vala.d/expected.tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Skk input.vala /^namespace Skk {$/;" n
KeyEventFormatError input.vala /^ public errordomain KeyEventFormatError {$/;" E namespace:Skk
PARSE_FAILED input.vala /^ PARSE_FAILED,$/;" r errordomain:Skk.KeyEventFormatError
KEYSYM_NOT_FOUND input.vala /^ KEYSYM_NOT_FOUND$/;" r errordomain:Skk.KeyEventFormatError
ModifierType input.vala /^ public enum ModifierType {$/;" e namespace:Skk
NONE input.vala /^ NONE = 0,$/;" v enum:Skk.ModifierType
SHIFT_MASK input.vala /^ SHIFT_MASK = 1 << 0,$/;" v enum:Skk.ModifierType
LOCK_MASK input.vala /^ LOCK_MASK = 1 << 1,$/;" v enum:Skk.ModifierType
CONTROL_MASK input.vala /^ CONTROL_MASK = 1 << 2,$/;" v enum:Skk.ModifierType
MOD1_MASK input.vala /^ MOD1_MASK = 1 << 3,$/;" v enum:Skk.ModifierType
MOD2_MASK input.vala /^ MOD2_MASK = 1 << 4,$/;" v enum:Skk.ModifierType
MOD3_MASK input.vala /^ MOD3_MASK = 1 << 5,$/;" v enum:Skk.ModifierType
MOD4_MASK input.vala /^ MOD4_MASK = 1 << 6,$/;" v enum:Skk.ModifierType
MOD5_MASK input.vala /^ MOD5_MASK = 1 << 7,$/;" v enum:Skk.ModifierType
LSHIFT_MASK input.vala /^ LSHIFT_MASK = 1 << 22,$/;" v enum:Skk.ModifierType
RSHIFT_MASK input.vala /^ RSHIFT_MASK = 1 << 23,$/;" v enum:Skk.ModifierType
USLEEP_MASK input.vala /^ USLEEP_MASK = 1 << 24,$/;" v enum:Skk.ModifierType
SUPER_MASK input.vala /^ SUPER_MASK = 1 << 26,$/;" v enum:Skk.ModifierType
HYPER_MASK input.vala /^ HYPER_MASK = 1 << 27,$/;" v enum:Skk.ModifierType
META_MASK input.vala /^ META_MASK = 1 << 28,$/;" v enum:Skk.ModifierType
RELEASE_MASK input.vala /^ RELEASE_MASK = 1 << 30$/;" v enum:Skk.ModifierType
ModifierType2 input.vala /^ public enum ModifierType2 {$/;" e namespace:Skk
ULTRA_MASK input.vala /^ ULTRA_MASK = 1 << 20,$/;" v enum:Skk.ModifierType2
MIRACLE_MASK input.vala /^ MIRACLE_MASK = 1 << 21, \/\/ valac accept this.$/;" v enum:Skk.ModifierType2
ModifierType3 input.vala /^ public enum ModifierType3 {$/;" e namespace:Skk
A_MASK input.vala /^ A_MASK = 1 << 29,$/;" v enum:Skk.ModifierType3
B_MASK input.vala /^ B_MASK = 1 << 31;$/;" v enum:Skk.ModifierType3
to_string0 input.vala /^ string to_string0() {$/;" m enum:Skk.ModifierType3
to_string1 input.vala /^ string to_string1() {$/;" m enum:Skk.ModifierType3
KeyEvent input.vala /^ public class KeyEvent : Object {$/;" c namespace:Skk
78 changes: 78 additions & 0 deletions Units/parser-vala.r/enum.vala.d/input.vala
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/* Taken from https://github.com/ueno/libskk
* (libskk/libskk/key-event.vala)
*/

/*
* Copyright (C) 2011-2018 Daiki Ueno <ueno@gnu.org>
* Copyright (C) 2011-2018 Red Hat, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using Gee;

namespace Skk {
public errordomain KeyEventFormatError {
PARSE_FAILED,
KEYSYM_NOT_FOUND
}

/**
* A set of bit-flags to indicate the state of modifier keys.
*/
[Flags]
public enum ModifierType {
NONE = 0,
SHIFT_MASK = 1 << 0,
LOCK_MASK = 1 << 1,
CONTROL_MASK = 1 << 2,
MOD1_MASK = 1 << 3,
MOD2_MASK = 1 << 4,
MOD3_MASK = 1 << 5,
MOD4_MASK = 1 << 6,
MOD5_MASK = 1 << 7,

// dummy modifiers for NICOLA
LSHIFT_MASK = 1 << 22,
RSHIFT_MASK = 1 << 23,
USLEEP_MASK = 1 << 24,

SUPER_MASK = 1 << 26,
HYPER_MASK = 1 << 27,
META_MASK = 1 << 28,
RELEASE_MASK = 1 << 30
}

public enum ModifierType2 {
ULTRA_MASK = 1 << 20,
MIRACLE_MASK = 1 << 21, // valac accept this.
}

public enum ModifierType3 {
A_MASK = 1 << 29,
B_MASK = 1 << 31;
string to_string0() {
return "";
}
string to_string1() {
return "";
}
}

/**
* Object representing a key event.
*/
public class KeyEvent : Object {
/* ... */
}
}
2 changes: 2 additions & 0 deletions Units/parser-vala.r/functions.vala.d/args.ctags
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--sort=no
--fields=+neKl{signature}
2 changes: 2 additions & 0 deletions Units/parser-vala.r/functions.vala.d/expected.tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
main input.vala /^void main(string[] args) {$/;" method line:4 language:Vala signature:(string [] args) end:6
sum input.vala /^int sum(int sum1, int sum2) {$/;" method line:8 language:Vala signature:(int sum1, int sum2) end:10
10 changes: 10 additions & 0 deletions Units/parser-vala.r/functions.vala.d/input.vala
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* vala sum
*/
void main(string[] args) {
print("Sum is: %d\n", sum(1,2));
}

int sum(int sum1, int sum2) {
return sum1 + sum2;
}
2 changes: 2 additions & 0 deletions Units/parser-vala.r/inheritance-list.d/args.ctags
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--sort=no
--fields=+i
5 changes: 5 additions & 0 deletions Units/parser-vala.r/inheritance-list.d/expected.tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
AXc input.vala /^public class AXc {$/;" c
a input.vala /^ int a;$/;" f class:AXc typeref:typename:int
BXi input.vala /^public interface BXi {$/;" i
MyObject input.vala /^public class MyObject: AXc, BXi {$/;" c inherits:AXc,BXi
c input.vala /^ int c;$/;" f class:MyObject typeref:typename:int
10 changes: 10 additions & 0 deletions Units/parser-vala.r/inheritance-list.d/input.vala
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
public class AXc {
int a;
}

public interface BXi {
}

public class MyObject: AXc, BXi {
int c;
}
2 changes: 2 additions & 0 deletions Units/parser-vala.r/namespace.vala.d/args.ctags
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--sort=no
--fields=+ea
19 changes: 19 additions & 0 deletions Units/parser-vala.r/namespace.vala.d/expected.tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
main input.vala /^void main(string[] args) {$/;" m end:11
Data input.vala /^namespace Data {$/;" n end:38
Address input.vala /^ class Address {$/;" c namespace:Data end:29
country input.vala /^ public string country;$/;" f class:Data.Address typeref:typename:string access:public end:15
city input.vala /^ public string city;$/;" f class:Data.Address typeref:typename:string access:public end:16
d_street input.vala /^ public string d_street;$/;" f class:Data.Address typeref:typename:string access:public end:17
building input.vala /^ public int building;$/;" f class:Data.Address typeref:typename:int access:public end:18
floor input.vala /^ public int floor;$/;" f class:Data.Address typeref:typename:int access:public end:19
street input.vala /^ public string street {$/;" p class:Data.Address typeref:typename:string access:public end:28
Private input.vala /^ namespace Private {$/;" n namespace:Data end:37
Contact input.vala /^ class Contact {$/;" c namespace:Data.Private end:36
email input.vala /^ public string email;$/;" f class:Data.Private.Contact typeref:typename:string access:public end:33
phone input.vala /^ public string phone;$/;" f class:Data.Private.Contact typeref:typename:string access:public end:34
id input.vala /^ public string id;$/;" f class:Data.Private.Contact typeref:typename:string access:public end:35
Person input.vala /^class Person {$/;" c end:55
address input.vala /^ public Data.Address address {get; set;}$/;" p class:Person typeref:class:Data.Address access:public end:41
name input.vala /^ public string name {get; set;}$/;" p class:Person typeref:typename:string access:public end:42
d_age input.vala /^ private int d_age;$/;" f class:Person typeref:typename:int access:private end:43
age input.vala /^ public int age {$/;" p class:Person typeref:typename:int access:public end:54
55 changes: 55 additions & 0 deletions Units/parser-vala.r/namespace.vala.d/input.vala
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
using Data;

void main(string[] args) {
var p = new Person();
var a = new Address();
a.street = "Oxford Street";
p.address = a;
p.name = "John";
p.age = 21;
print("Hello %s, you're %d years old\nliving in %s\n", p.name, p.age, p.address.street);
}

namespace Data {
class Address {
public string country;
public string city;
public string d_street;
public int building;
public int floor;

public string street {
owned get {
return d_street;
}
set {
d_street = value;
}
}
}

namespace Private {
class Contact {
public string email;
public string phone;
public string id;
}
}
}

class Person {
public Data.Address address {get; set;}
public string name {get; set;}
private int d_age;

public int age {
get { return d_age;}
set {
if (value > 0) {
d_age = value;
} else {
d_age = 0;
}
}
}
}
1 change: 1 addition & 0 deletions Units/parser-vala.r/qnamed-class.d/args.ctags
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--sort=no
6 changes: 6 additions & 0 deletions Units/parser-vala.r/qnamed-class.d/expected.tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
X input.vala /^namespace X {$/;" n
X.MyObject input.vala /^public class X.MyObject {$/;" c
a input.vala /^ int a;$/;" f class:X.MyObject typeref:typename:int
b input.vala /^ int b = 1;$/;" f class:X.MyObject typeref:typename:int
c input.vala /^ int c = 2;$/;" f class:X.MyObject typeref:typename:int
d input.vala /^ int d;$/;" f class:X.MyObject typeref:typename:int
Loading